diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-12 14:36:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 14:36:05 +0800 |
commit | 8b75ca734541a42bf0d3f3fd8e39e94662084895 (patch) | |
tree | 688fb3b654823d7579964495fb4c5af58f7e7bd8 /test | |
parent | 540d1af90e2276a8bd3b5edb1a63c8225a1aa423 (diff) | |
parent | 1abdb3224b177078b046873dadb81381960ad52b (diff) | |
download | rneovim-8b75ca734541a42bf0d3f3fd8e39e94662084895.tar.gz rneovim-8b75ca734541a42bf0d3f3fd8e39e94662084895.tar.bz2 rneovim-8b75ca734541a42bf0d3f3fd8e39e94662084895.zip |
Merge pull request #19332 from zeertzjq/vim-8.2.0270
vim-patch:8.2.{0270,2732}
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/ex_mode_spec.lua | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua index b3fd94f4f8..e4469d53ed 100644 --- a/test/functional/legacy/ex_mode_spec.lua +++ b/test/functional/legacy/ex_mode_spec.lua @@ -44,56 +44,81 @@ 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 foo foo | - 2 foo foo | - 3 foo foo | - | + {1: 1 }foo foo | + {1: 2 }foo foo | + {1: 3 }foo foo | + {0: }| Entering Ex mode. Type "visual" to go to Normal mode. | :^ | ]]) feed('%s/foo/bar/gc<CR>') screen:expect([[ - 1 foo foo | - | + {1: 1 }foo foo | + {0: }| Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - 1 foo foo | + {1: 1 }foo foo | ^^^^ | ]]) - feed('n<CR>') + feed('N<CR>') screen:expect([[ Entering Ex mode. Type "visual" to go to Normal mode. | :%s/foo/bar/gc | - 1 foo foo | + {1: 1 }foo foo | + ^^^N | + {1: 1 }foo foo | + ^^^^ | + ]]) + feed('n<CR>') + screen:expect([[ + {1: 1 }foo foo | + ^^^N | + {1: 1 }foo foo | ^^^n | - 1 foo foo | + {1: 1 }foo foo | ^^^^ | ]]) feed('y<CR>') feed('q<CR>') screen:expect([[ - 1 foo foo | + {1: 1 }foo foo | + ^^^y | + {1: 2 }foo foo | + ^^^q | + {1: 2 }foo foo | + :^ | + ]]) + + -- Pressing enter in ex mode should print the current line + feed('<CR>') + screen:expect([[ + {1: 1 }foo foo | ^^^y | - 2 foo foo | + {1: 2 }foo foo | ^^^q | - 2 foo foo | + {1: 3 }foo foo | :^ | ]]) feed(':vi<CR>') screen:expect([[ - 1 foo bar | - 2 fo^o foo | - 3 foo foo | - ~ | - ~ | + {1: 1 }foo bar | + {1: 2 }foo foo | + {1: 3 }^foo foo | + {2:~ }| + {2:~ }| | ]]) end) |