mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
api: Simplify UI API on mode change
Currently, there are two functions in the UI API that are called when the mode changes: insert_mode() and normal_mode(). These can be folded into a single mode_change() entrypoint which can do whatever it wants based on the mode it is passed, limited to INSERT and NORMAL for now.
This commit is contained in:
committed by
Justin M. Keyes
parent
61e4a32065
commit
fa48fc667a
@@ -340,12 +340,9 @@ function Screen:_handle_mouse_off()
|
||||
self._mouse_enabled = false
|
||||
end
|
||||
|
||||
function Screen:_handle_insert_mode()
|
||||
self._mode = 'insert'
|
||||
end
|
||||
|
||||
function Screen:_handle_normal_mode()
|
||||
self._mode = 'normal'
|
||||
function Screen:_handle_mode_change(mode)
|
||||
assert(mode == 'insert' or mode == 'normal')
|
||||
self._mode = mode
|
||||
end
|
||||
|
||||
function Screen:_handle_set_scroll_region(top, bot, left, right)
|
||||
|
||||
Reference in New Issue
Block a user