diff options
author | itchyny <itchyny@hatena.ne.jp> | 2021-09-20 23:33:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 07:33:10 -0700 |
commit | 1f8c91bf729707fdb005292aecca8dd79538f4a5 (patch) | |
tree | 7e669cd6e6ae76361ddc031b44d3a1303426c6f0 /test/functional/ui/inccommand_spec.lua | |
parent | 30fefee684e641a0c6867446c6de30efa2f0a126 (diff) | |
download | rneovim-1f8c91bf729707fdb005292aecca8dd79538f4a5.tar.gz rneovim-1f8c91bf729707fdb005292aecca8dd79538f4a5.tar.bz2 rneovim-1f8c91bf729707fdb005292aecca8dd79538f4a5.zip |
fix(inccommand): ignore trailing commands only for *previewed* command #15638
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.
fix #8796, update #7494
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r-- | test/functional/ui/inccommand_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 712c1f377a..b6e2f2311f 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -1487,6 +1487,29 @@ describe("inccommand=nosplit", function() ]]) eq(eval('v:null'), eval('v:exiting')) end) + + it("does not break bar-separated command #8796", function() + source([[ + function! F() + if v:false | return | endif + endfun + ]]) + command('call timer_start(10, {-> F()}, {"repeat":-1})') + feed(':%s/') + sleep(20) -- Allow some timer activity. + screen:expect([[ + Inc substitution on | + two lines | + Inc substitution on | + two lines | + | + {15:~ }| + {15:~ }| + {15:~ }| + {15:~ }| + :%s/^ | + ]]) + end) end) describe(":substitute, 'inccommand' with a failing expression", function() |