diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-06 10:18:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 10:18:59 +0800 |
commit | 8215c05945054755b2c3cadae198894372dbfe0f (patch) | |
tree | 777afd96a8e332d3712df0a2e26c04ed8d4c06ca /test/functional/ui/inccommand_spec.lua | |
parent | 28d5face21748bbd7b116a1e57bffb535dba392a (diff) | |
parent | d11bbacf0ffa45096364195bda4739984d25121e (diff) | |
download | rneovim-8215c05945054755b2c3cadae198894372dbfe0f.tar.gz rneovim-8215c05945054755b2c3cadae198894372dbfe0f.tar.bz2 rneovim-8215c05945054755b2c3cadae198894372dbfe0f.zip |
Merge pull request #17194 from zeertzjq/inccommand-prev-sub
fix(inccommand): do not change reg_prev_sub when previewing
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r-- | test/functional/ui/inccommand_spec.lua | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index b6e2f2311f..10700d9508 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -293,6 +293,70 @@ describe(":substitute, 'inccommand' preserves", function() end) end + for _, case in ipairs({'', 'split', 'nosplit'}) do + it('previous substitute string ~ (inccommand='..case..') #12109', function() + local screen = Screen.new(30,10) + common_setup(screen, case, default_text) + + feed(':%s/Inc/SUB<CR>') + expect([[ + SUB substitution on + two lines + ]]) + + feed(':%s/line/') + poke_eventloop() + feed('~') + poke_eventloop() + feed('<CR>') + expect([[ + SUB substitution on + two SUBs + ]]) + + feed(':%s/sti/') + poke_eventloop() + feed('~') + poke_eventloop() + feed('B') + poke_eventloop() + feed('<CR>') + expect([[ + SUB subSUBBtution on + two SUBs + ]]) + + feed(':%s/ion/NEW<CR>') + expect([[ + SUB subSUBBtutNEW on + two SUBs + ]]) + + feed(':%s/two/') + poke_eventloop() + feed('N') + poke_eventloop() + feed('~') + poke_eventloop() + feed('<CR>') + expect([[ + SUB subSUBBtutNEW on + NNEW SUBs + ]]) + + feed(':%s/bS/') + poke_eventloop() + feed('~') + poke_eventloop() + feed('W') + poke_eventloop() + feed('<CR>') + expect([[ + SUB suNNEWWUBBtutNEW on + NNEW SUBs + ]]) + end) + end end) describe(":substitute, 'inccommand' preserves undo", function() |