aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorOmar El Halabi <omar_halabi25@hotmail.com>2023-11-10 05:20:26 +0100
committerGitHub <noreply@github.com>2023-11-09 22:20:26 -0600
commit9af03bcd47127a416aa6a125590b75adb5f53c3c (patch)
tree162affe49a5446ec9af7c84e10ce1faa62cdae51 /test/functional/ui/inccommand_spec.lua
parentcd63a9addd6e1114c3524fa041ece560550cfe7b (diff)
downloadrneovim-9af03bcd47127a416aa6a125590b75adb5f53c3c.tar.gz
rneovim-9af03bcd47127a416aa6a125590b75adb5f53c3c.tar.bz2
rneovim-9af03bcd47127a416aa6a125590b75adb5f53c3c.zip
fix(options): do not change inccommand during preview (#25462)
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index c9e004289d..3ee67a710c 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -3167,3 +3167,31 @@ it("with 'inccommand' typing :filter doesn't segfault or leak memory #19057", fu
feed('i')
assert_alive()
end)
+
+it("'inccommand' cannot be changed during preview #23136", function()
+ clear()
+ local screen = Screen.new(30, 6)
+ common_setup(screen, 'nosplit', 'foo\nbar\nbaz')
+ source([[
+ function! IncCommandToggle()
+ let prev = &inccommand
+
+ if &inccommand ==# 'split'
+ set inccommand=nosplit
+ elseif &inccommand ==# 'nosplit'
+ set inccommand=split
+ elseif &inccommand ==# ''
+ set inccommand=nosplit
+ else
+ throw 'unknown inccommand'
+ endif
+
+ return " \<BS>"
+ endfun
+
+ cnoremap <expr> <C-E> IncCommandToggle()
+ ]])
+
+ feed(':%s/foo/bar<C-E><C-E><C-E>')
+ assert_alive()
+end)