diff --git a/runtime/autoload/dist/vim.vim b/runtime/autoload/dist/vim.vim index 021244c93b..d519406530 100644 --- a/runtime/autoload/dist/vim.vim +++ b/runtime/autoload/dist/vim.vim @@ -18,6 +18,10 @@ endif if !has('vim9script') function dist#vim#IsSafeExecutable(filetype, executable) let cwd = getcwd() + if empty(exepath(a:executable)) + echomsg a:executable .. " not found in $PATH" + return v:false + endif return get(g:, a:filetype .. '_exec', get(g:, 'plugin_exec', 0)) && \ (fnamemodify(exepath(a:executable), ':p:h') !=# cwd \ || (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1 && diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index 807140da7c..8fa9380f57 100644 --- a/runtime/autoload/dist/vim9.vim +++ b/runtime/autoload/dist/vim9.vim @@ -6,6 +6,10 @@ vim9script # Last Change: 2023 Oct 25 export def IsSafeExecutable(filetype: string, executable: string): bool + if empty(exepath(executable)) + echomsg executable .. " not found in $PATH" + return v:false + endif var cwd = getcwd() return get(g:, filetype .. '_exec', get(g:, 'plugin_exec', 0)) && (fnamemodify(exepath(executable), ':p:h') !=# cwd