diff options
author | KillTheMule <github@pipsfrank.de> | 2019-02-01 01:40:01 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-02-01 01:40:01 +0100 |
commit | f89d0d8230f34dca49eddbea179d274955b572b9 (patch) | |
tree | 6459c1f59e1d9ede65c0770eb0bd2c401809376c /test/functional/ui/inccommand_spec.lua | |
parent | ada82f3482ffab1d8be7e79255cc018c30f09fab (diff) | |
download | rneovim-f89d0d8230f34dca49eddbea179d274955b572b9.tar.gz rneovim-f89d0d8230f34dca49eddbea179d274955b572b9.tar.bz2 rneovim-f89d0d8230f34dca49eddbea179d274955b572b9.zip |
inccommand: auto-disable if folding is slow #9568
Fixes #9557
Diffstat (limited to 'test/functional/ui/inccommand_spec.lua')
-rw-r--r-- | test/functional/ui/inccommand_spec.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 3228d6b7fc..536264019c 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -1151,6 +1151,39 @@ describe(":substitute, inccommand=split", function() eq("split", eval("&inccommand")) end) + it("deactivates if 'foldexpr' is slow #9557", function() + insert([[ + a + a + a + a + a + a + a + a + ]]) + source([[ + function! Slowfold(lnum) + sleep 5m + return a:lnum % 3 + endfun + ]]) + command('set redrawtime=1 inccommand=split') + command('set foldmethod=expr foldexpr=Slowfold(v:lnum)') + feed(':%s/a/bcdef') + + -- Assert that 'inccommand' is DISABLED in cmdline mode. + retry(nil, nil, function() + eq('', eval('&inccommand')) + end) + + -- Assert that 'inccommand' is again ENABLED after leaving cmdline mode. + feed([[<C-\><C-N>]]) + retry(nil, nil, function() + eq('split', eval('&inccommand')) + end) + end) + it("clears preview if non-previewable command is edited #5585", function() -- Put a non-previewable command in history. feed_command("echo 'foo'") |