aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/inccommand_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-07-28 15:41:58 +0800
committerGitHub <noreply@github.com>2023-07-28 15:41:58 +0800
commitc1c2a1b5dd1d73e5e97b94e6626aaac25a3db9bc (patch)
tree5a3463065356600dc618ca01d3b30c0abfd3bfa0 /test/functional/ui/inccommand_spec.lua
parentdf2f5e39127e283a7ac74a21cb0323c437c3294f (diff)
downloadrneovim-c1c2a1b5dd1d73e5e97b94e6626aaac25a3db9bc.tar.gz
rneovim-c1c2a1b5dd1d73e5e97b94e6626aaac25a3db9bc.tar.bz2
rneovim-c1c2a1b5dd1d73e5e97b94e6626aaac25a3db9bc.zip
fix(inccommand): don't save information of a buffer twice (#24501)
Problem: 'inccommand' doesn't restore 'undolevels' properly for a buffer shown in multiple windows. Solution: Don't save information of a buffer twice.
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r--test/functional/ui/inccommand_spec.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index dc4aeb9c83..00dfa3fd49 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -174,9 +174,12 @@ describe(":substitute, 'inccommand' preserves", function()
it("'undolevels' (inccommand="..case..")", function()
feed_command("set undolevels=139")
feed_command("setlocal undolevels=34")
+ feed_command("split") -- Show the buffer in multiple windows
feed_command("set inccommand=" .. case)
insert("as")
- feed(":%s/as/glork/<enter>")
+ feed(":%s/as/glork/")
+ poke_eventloop()
+ feed("<enter>")
eq(meths.get_option_value('undolevels', {scope='global'}), 139)
eq(meths.get_option_value('undolevels', {buf=0}), 34)
end)