aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-01 20:17:52 +0800
committerGitHub <noreply@github.com>2022-06-01 20:17:52 +0800
commitf40adf770d090d12f7b14dd519fe649ada40bfe6 (patch)
treef4bb8fdf06c6491cadee34ef59a8ff11aabef633 /src
parentc632f64e247c672e425f609bb47a9ab0517a4c31 (diff)
downloadrneovim-f40adf770d090d12f7b14dd519fe649ada40bfe6.tar.gz
rneovim-f40adf770d090d12f7b14dd519fe649ada40bfe6.tar.bz2
rneovim-f40adf770d090d12f7b14dd519fe649ada40bfe6.zip
fix(inccommand): do not try to preview an ambiguous command (#18827)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 4b462994be..0e9c8dcf01 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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