diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-12-01 08:05:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 08:05:44 +0100 |
commit | 1f8a3da796dd3418c5204c76192179dbdd6a5373 (patch) | |
tree | 74c5d925a279cd3e59a8adace6e0cbb32c40dca0 /test | |
parent | 0e1c406df4e661602b67dde5e46d69fe7345b1a9 (diff) | |
parent | 3cf4b14e966ec04371d38af6451bc69eaadb425b (diff) | |
download | rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.tar.gz rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.tar.bz2 rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.zip |
Merge pull request #5669 from chemzqm/add-cmdline-mode-rpc
Add cmdline mode to ui_mode_change
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/screen.lua | 3 | ||||
-rw-r--r-- | test/functional/ui/screen_basic_spec.lua | 47 |
2 files changed, 49 insertions, 1 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 6c1a1788ce..ebe8af35eb 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -374,7 +374,8 @@ function Screen:_handle_mouse_off() end function Screen:_handle_mode_change(mode) - assert(mode == 'insert' or mode == 'replace' or mode == 'normal') + assert(mode == 'insert' or mode == 'replace' + or mode == 'normal' or mode == 'cmdline') self.mode = mode end diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 593b6dd763..d03f98c26f 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -642,5 +642,52 @@ describe('Screen', function() eq("normal", screen.mode) end) end) + + it('works in cmdline mode', function() + feed(':') + screen:expect([[ + | + {0:~ }| + {0:~ }| + {0:~ }| + :^ | + ]],nil,nil,function () + eq("cmdline", screen.mode) + end) + + feed('<esc>/') + screen:expect([[ + | + {0:~ }| + {0:~ }| + {0:~ }| + /^ | + ]],nil,nil,function () + eq("cmdline", screen.mode) + end) + + + feed('<esc>?') + screen:expect([[ + | + {0:~ }| + {0:~ }| + {0:~ }| + ?^ | + ]],nil,nil,function () + eq("cmdline", screen.mode) + end) + + feed('<esc>') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + end) end) end) |