mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
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
This commit is contained in:
@@ -304,6 +304,7 @@ int do_cmdline_cmd(const char *cmd)
|
||||
/// DOCMD_KEYTYPED - Don't reset KeyTyped.
|
||||
/// DOCMD_EXCRESET - Reset the exception environment (used for debugging).
|
||||
/// DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
|
||||
/// DOCMD_PREVIEW - During 'inccommand' preview.
|
||||
///
|
||||
/// @param cookie argument for fgetline()
|
||||
///
|
||||
@@ -606,7 +607,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, void *cookie, int flags)
|
||||
recursive--;
|
||||
|
||||
// Ignore trailing '|'-separated commands in preview-mode ('inccommand').
|
||||
if (State & CMDPREVIEW) {
|
||||
if ((State & CMDPREVIEW) && (flags & DOCMD_PREVIEW)) {
|
||||
next_cmdline = NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user