aboutsummaryrefslogtreecommitdiff
path: root/test/functional/visual/ctrl_o_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/visual/ctrl_o_spec.lua')
-rw-r--r--test/functional/visual/ctrl_o_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/visual/ctrl_o_spec.lua b/test/functional/visual/ctrl_o_spec.lua
new file mode 100644
index 0000000000..65a128053c
--- /dev/null
+++ b/test/functional/visual/ctrl_o_spec.lua
@@ -0,0 +1,23 @@
+local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
+local eq = helpers.eq
+local eval = helpers.eval
+local expect = helpers.expect
+local feed = helpers.feed
+local meths = helpers.meths
+
+describe('select-mode Ctrl-O', function()
+ before_each(clear)
+
+ it("doesn't cancel Ctrl-O mode when processing event", function()
+ feed('iHello World<esc>gh<c-o>')
+ eq({mode='vs', blocking=false}, meths.get_mode()) -- fast event
+ eq(2, eval('1+1')) -- causes K_EVENT key
+ eq({mode='vs', blocking=false}, meths.get_mode()) -- still in ctrl-o mode
+ feed('^')
+ eq({mode='s', blocking=false}, meths.get_mode()) -- left ctrl-o mode
+ feed('h')
+ eq({mode='i', blocking=false}, meths.get_mode()) -- entered insert mode
+ expect('h') -- selection is the whole line and is replaced
+ end)
+end)