diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /test/functional/legacy/ex_mode_spec.lua | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/legacy/ex_mode_spec.lua')
-rw-r--r-- | test/functional/legacy/ex_mode_spec.lua | 73 |
1 files changed, 33 insertions, 40 deletions
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua index ae4c4309d1..574c3e4069 100644 --- a/test/functional/legacy/ex_mode_spec.lua +++ b/test/functional/legacy/ex_mode_spec.lua @@ -1,12 +1,14 @@ -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') -local clear = helpers.clear -local command = helpers.command -local eq = helpers.eq -local eval = helpers.eval -local feed = helpers.feed -local api = helpers.api -local poke_eventloop = helpers.poke_eventloop + +local clear = n.clear +local command = n.command +local eq = t.eq +local eval = n.eval +local feed = n.feed +local api = n.api +local poke_eventloop = n.poke_eventloop before_each(clear) @@ -45,60 +47,55 @@ describe('Ex mode', function() it('substitute confirmation prompt', function() command('set noincsearch nohlsearch inccommand=') local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, reverse = true }, -- MsgSeparator - [1] = { foreground = Screen.colors.Brown }, -- LineNr - [2] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() command([[call setline(1, ['foo foo', 'foo foo', 'foo foo'])]]) command([[set number]]) feed('gQ') screen:expect([[ - {1: 1 }foo foo | - {1: 2 }foo foo | - {1: 3 }foo foo | - {0: }| + {8: 1 }foo foo | + {8: 2 }foo foo | + {8: 3 }foo foo | + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :^ | ]]) feed('%s/foo/bar/gc<CR>') screen:expect([[ - {1: 1 }foo foo | - {0: }| + {8: 1 }foo foo | + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('N<CR>') screen:expect([[ Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^N | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('n<CR>') screen:expect([[ - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^N | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^n | - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^^ | ]]) feed('y<CR>') feed('q<CR>') screen:expect([[ - {1: 1 }foo foo | + {8: 1 }foo foo | ^^^y | - {1: 2 }foo foo | + {8: 2 }foo foo | ^^^q | - {1: 2 }foo foo | + {8: 2 }foo foo | :^ | ]]) @@ -106,35 +103,31 @@ describe('Ex mode', function() feed('<CR>') screen:expect([[ ^^^y | - {1: 2 }foo foo | + {8: 2 }foo foo | ^^^q | - {1: 2 }foo foo | - {1: 3 }foo foo | + {8: 2 }foo foo | + {8: 3 }foo foo | :^ | ]]) feed(':vi<CR>') screen:expect([[ - {1: 1 }foo bar | - {1: 2 }foo foo | - {1: 3 }^foo foo | - {2:~ }|*2 + {8: 1 }foo bar | + {8: 2 }foo foo | + {8: 3 }^foo foo | + {1:~ }|*2 | ]]) end) it('pressing Ctrl-C in :append inside a loop in Ex mode does not hang', function() local screen = Screen.new(60, 6) - screen:set_default_attr_ids({ - [0] = { bold = true, reverse = true }, -- MsgSeparator - [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText - }) screen:attach() feed('gQ') feed('for i in range(1)<CR>') feed('append<CR>') screen:expect([[ - {0: }| + {3: }| Entering Ex mode. Type "visual" to go to Normal mode. | :for i in range(1) | | |