diff options
author | Omar Sandoval <osandov@osandov.com> | 2015-05-17 01:22:46 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-07-26 23:38:35 -0400 |
commit | fa48fc667a1d27db6826075e23caff4f396f191a (patch) | |
tree | 89048cb803717bbb43b653df2e3c23a164f1741f /test | |
parent | 61e4a320658ffd64103795cf9aeb9a53c1ac2032 (diff) | |
download | rneovim-fa48fc667a1d27db6826075e23caff4f396f191a.tar.gz rneovim-fa48fc667a1d27db6826075e23caff4f396f191a.tar.bz2 rneovim-fa48fc667a1d27db6826075e23caff4f396f191a.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/screen.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 60198bb008..4b39a74957 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -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) |