diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-04-29 21:17:06 +0200 |
---|---|---|
committer | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-05-02 21:09:43 +0200 |
commit | 00c35ab3b4d8498c82776525de7b1afcd7b3424a (patch) | |
tree | fce72ff6c7a1adf88952c57ddb6c78246fc41c2d /src/nvim/eval.c | |
parent | d542de4a76dd9e600ebcf1405efdc9d3090ad9a8 (diff) | |
download | rneovim-00c35ab3b4d8498c82776525de7b1afcd7b3424a.tar.gz rneovim-00c35ab3b4d8498c82776525de7b1afcd7b3424a.tar.bz2 rneovim-00c35ab3b4d8498c82776525de7b1afcd7b3424a.zip |
vim-patch:7.4.672
Problem: When completing a shell command, directories in the current
directory are not listed.
Solution: When "." is not in $PATH also look in the current directory for
directories.
https://github.com/vim/vim/commit/b5971141dff0c69355fd64196fcc0d0d071d4c82
Most of it applied manually.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index fdeb2c1371..d84bdfebfe 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8692,7 +8692,11 @@ static void f_eventhandler(typval_T *argvars, typval_T *rettv) */ static void f_executable(typval_T *argvars, typval_T *rettv) { - rettv->vval.v_number = os_can_exe(get_tv_string(&argvars[0]), NULL); + char_u *name = get_tv_string(&argvars[0]); + + // Check in $PATH and also check directly if there is a directory name + rettv->vval.v_number = os_can_exe(name, NULL, true) + || (gettail_dir(name) != name && os_can_exe(name, NULL, false)); } /// "exepath()" function @@ -8701,7 +8705,7 @@ static void f_exepath(typval_T *argvars, typval_T *rettv) char_u *arg = get_tv_string(&argvars[0]); char_u *path = NULL; - (void)os_can_exe(arg, &path); + (void)os_can_exe(arg, &path, true); rettv->v_type = VAR_STRING; rettv->vval.v_string = path; @@ -11606,7 +11610,7 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd) assert(argl->lv_first); const char_u *exe = get_tv_string_chk(&argl->lv_first->li_tv); - if (!exe || !os_can_exe(exe, NULL)) { + if (!exe || !os_can_exe(exe, NULL, true)) { // String is not executable if (exe) { EMSG2(e_jobexe, exe); |