diff options
author | 2017-06-23 00:07:54 -0400 | |
---|---|---|
committer | 2017-06-23 00:07:54 -0400 | |
commit | f5aabd9def417094b478ef34acd1d89341670e3f (patch) | |
tree | 183d74bd1c3fe249776619d9519198a7836d1283 /core/ui.lua | |
parent | 823d2770fe7ea7e8269ea43119d98f3f9130611e (diff) |
Small code cleanup.
Diffstat (limited to 'core/ui.lua')
-rw-r--r-- | core/ui.lua | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/ui.lua b/core/ui.lua index 39860ac0..3b9db7a2 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -480,18 +480,12 @@ end) -- on mouse events. if CURSES then if not WIN32 then - local function enable_mouse_mode() - io.stdout:write("\x1b[?1002h") - io.stdout:flush() - end - enable_mouse_mode() - local function disable_mouse_mode() - io.stdout:write("\x1b[?1002l") -- disable mouse mode - io.stdout:flush() - end - events_connect(events.SUSPEND, disable_mouse_mode) - events_connect(events.RESUME, enable_mouse_mode) - events_connect(events.QUIT, disable_mouse_mode) + local function enable_mouse() io.stdout:write("\x1b[?1002h"):flush() end + local function disable_mouse() io.stdout:write("\x1b[?1002l"):flush() end + enable_mouse() + events_connect(events.SUSPEND, disable_mouse) + events_connect(events.RESUME, enable_mouse) + events_connect(events.QUIT, disable_mouse) end -- Retrieves the view or split at the given terminal coordinates. |