mirror of
https://github.com/neovim/neovim
synced 2025-07-17 17:51:48 +00:00
committed by
Justin M. Keyes
parent
ada82f3482
commit
f89d0d8230
@ -4135,7 +4135,7 @@ skip:
|
|||||||
buf_T *preview_buf = NULL;
|
buf_T *preview_buf = NULL;
|
||||||
size_t subsize = preview_lines.subresults.size;
|
size_t subsize = preview_lines.subresults.size;
|
||||||
if (preview && !aborting()) {
|
if (preview && !aborting()) {
|
||||||
if (got_quit) { // Substitution is too slow, disable 'inccommand'.
|
if (got_quit || profile_passed_limit(timeout)) { // Too slow, disable.
|
||||||
set_string_option_direct((char_u *)"icm", -1, (char_u *)"", OPT_FREE,
|
set_string_option_direct((char_u *)"icm", -1, (char_u *)"", OPT_FREE,
|
||||||
SID_NONE);
|
SID_NONE);
|
||||||
} else if (*p_icm != NUL && pat != NULL) {
|
} else if (*p_icm != NUL && pat != NULL) {
|
||||||
|
@ -1151,6 +1151,39 @@ describe(":substitute, inccommand=split", function()
|
|||||||
eq("split", eval("&inccommand"))
|
eq("split", eval("&inccommand"))
|
||||||
end)
|
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()
|
it("clears preview if non-previewable command is edited #5585", function()
|
||||||
-- Put a non-previewable command in history.
|
-- Put a non-previewable command in history.
|
||||||
feed_command("echo 'foo'")
|
feed_command("echo 'foo'")
|
||||||
|
Reference in New Issue
Block a user