diff options
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index ce286042df..49085a27a0 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -4763,9 +4763,14 @@ static void nv_ident(cmdarg_T *cap) * Now grab the chars in the identifier */ if (cmdchar == 'K' && !kp_ex) { - /* Escape the argument properly for a shell command */ ptr = vim_strnsave(ptr, n); - p = vim_strsave_shellescape(ptr, true, true); + if (kp_ex) { + // Escape the argument properly for an Ex command + p = vim_strsave_fnameescape(ptr, FALSE); + } else { + // Escape the argument properly for a shell command + p = vim_strsave_shellescape(ptr, TRUE, TRUE); + } xfree(ptr); char *newbuf = xrealloc(buf, STRLEN(buf) + STRLEN(p) + 1); buf = newbuf; |