mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 00:22:41 +00:00
'inccommand': Introduce CMDPREVIEW state.
Command "live preview" is fundamentally a non-recursive concept
("preview of a preview" is not useful). Maintaining this as a
global is less awkward and closer to what we actually want to
express, vs adorning exarg_T, CommandLineState, etc.
This commit is contained in:
@@ -1248,7 +1248,6 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
||||
memset(&ea, 0, sizeof(ea));
|
||||
ea.line1 = 1;
|
||||
ea.line2 = 1;
|
||||
ea.is_live = flags & DOCMD_LIVE;
|
||||
ex_nesting_level++;
|
||||
|
||||
/* When the last file has not been edited :q has to be typed twice. */
|
||||
@@ -9648,12 +9647,12 @@ static void ex_terminal(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
/// Check whether commandline starts with a live command
|
||||
/// Checks if `cmd` is "previewable" (i.e. supported by 'inccommand').
|
||||
///
|
||||
/// @param[in] cmd Commandline to check. May start with a range.
|
||||
///
|
||||
/// @return True if first command is a live command
|
||||
bool cmd_is_live(char_u *cmd)
|
||||
/// @return true if `cmd` is previewable
|
||||
bool cmd_can_preview(char_u *cmd)
|
||||
{
|
||||
if (cmd == NULL) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user