fix(inccommand): do not try to preview an ambiguous command (#18827)

This commit is contained in:
zeertzjq
2022-06-01 20:17:52 +08:00
committed by GitHub
parent c632f64e24
commit f40adf770d
2 changed files with 11 additions and 2 deletions

View File

@@ -10133,9 +10133,8 @@ bool cmd_can_preview(char *cmd)
if (*ea.cmd == '*') {
ea.cmd = skipwhite(ea.cmd + 1);
}
find_ex_command(&ea, NULL);
if (ea.cmdidx == CMD_SIZE) {
if (find_ex_command(&ea, NULL) == NULL || ea.cmdidx == CMD_SIZE) {
return false;
} else if (!IS_USER_CMDIDX(ea.cmdidx)) {
// find_ex_command sets the flags for user commands automatically