aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/ex_mode_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy/ex_mode_spec.lua')
-rw-r--r--test/functional/legacy/ex_mode_spec.lua58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua
index 244b6bf00f..b3fd94f4f8 100644
--- a/test/functional/legacy/ex_mode_spec.lua
+++ b/test/functional/legacy/ex_mode_spec.lua
@@ -1,4 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
@@ -39,4 +40,61 @@ describe('Ex mode', function()
test_ex_edit('\tm<C-T>n', '\tm<C-T>n')
command('set wildchar&')
end)
+
+ it('substitute confirmation prompt', function()
+ command('set noincsearch nohlsearch inccommand=')
+ local screen = Screen.new(60, 6)
+ screen:attach()
+ command([[call setline(1, ['foo foo', 'foo foo', 'foo foo'])]])
+ command([[set number]])
+ feed('gQ')
+ screen:expect([[
+ 1 foo foo |
+ 2 foo foo |
+ 3 foo foo |
+ |
+ Entering Ex mode. Type "visual" to go to Normal mode. |
+ :^ |
+ ]])
+
+ feed('%s/foo/bar/gc<CR>')
+ screen:expect([[
+ 1 foo foo |
+ |
+ Entering Ex mode. Type "visual" to go to Normal mode. |
+ :%s/foo/bar/gc |
+ 1 foo foo |
+ ^^^^ |
+ ]])
+ feed('n<CR>')
+ screen:expect([[
+ Entering Ex mode. Type "visual" to go to Normal mode. |
+ :%s/foo/bar/gc |
+ 1 foo foo |
+ ^^^n |
+ 1 foo foo |
+ ^^^^ |
+ ]])
+ feed('y<CR>')
+
+ feed('q<CR>')
+ screen:expect([[
+ 1 foo foo |
+ ^^^y |
+ 2 foo foo |
+ ^^^q |
+ 2 foo foo |
+ :^ |
+ ]])
+
+ feed(':vi<CR>')
+ screen:expect([[
+ 1 foo bar |
+ 2 fo^o foo |
+ 3 foo foo |
+ ~ |
+ ~ |
+ |
+ ]])
+ end)
end)