From 91507c271e9e51cefed3dcac21f7a41b9cac0bbe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 14 Nov 2016 04:16:13 +0100 Subject: 'inccommand': Detect "non-interactive", "too slow". command_line_changed: - Check (current_SID == 0) instead of KeyTyped - We want to update during mappings (KeyTyped is false then). - Check vpeekc_any() - Avoids unnecessary work. - Avoids triggering live preview during macros. - Caveat: This makes the redraw "stutter" if user spams (holds a key) in the replace pattern. But that scenario is not important. - Update screen if the command is changed to a non-live command. (`s->live` goes from true => false) => clears the preview command_line_execute: - Let CTRL-C cancel live preview do_sub: - Enforce a time limit ('redrawtime'). - Unset 'inccommand' if time limit is reached. Closes #5602 Closes #5585 --- runtime/doc/options.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d13a245d87..1789f73aa9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3418,6 +3418,9 @@ A jump table for the options with a short description can be found at |Q_op|. Works for |:substitute|, |:smagic|, |:snomagic|. |hl-Substitute| + If the preview is too slow (exceeds 'redrawtime') then 'inccommand' is + automatically disabled until |Command-line-mode| is done. + *'include'* *'inc'* 'include' 'inc' string (default "^\s*#\s*include") global or local to buffer |global-local| @@ -4733,8 +4736,8 @@ A jump table for the options with a short description can be found at |Q_op|. global {only available when compiled with the |+reltime| feature} - The time in milliseconds for redrawing the display. This applies to - searching for patterns for 'hlsearch' and |:match| highlighting. + Time in milliseconds for redrawing the display. Applies to + 'hlsearch', 'inccommand' and |:match| highlighting. When redrawing takes more than this many milliseconds no further matches will be highlighted. This is used to avoid that Vim hangs when using a very complicated pattern. -- cgit