File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,14 @@ M.find_executable = function(paths, default)
1818 for _ , path in ipairs (paths ) do
1919 local normpath = vim .fs .normalize (path )
2020 local is_absolute = vim .startswith (normpath , " /" )
21- if is_absolute and vim .fn .executable (normpath ) then
21+
22+ if is_absolute and vim .fn .executable (normpath ) == 1 then
2223 return normpath
2324 end
2425
2526 local idx = normpath :find (" /" , 1 , true )
2627 local dir , subpath
28+
2729 if idx then
2830 dir = normpath :sub (1 , idx - 1 )
2931 subpath = normpath :sub (idx )
@@ -32,9 +34,11 @@ M.find_executable = function(paths, default)
3234 dir = normpath
3335 subpath = " "
3436 end
37+
3538 local results = vim .fs .find (dir , { upward = true , path = ctx .dirname , limit = math.huge })
3639 for _ , result in ipairs (results ) do
3740 local fullpath = result .. subpath
41+
3842 if vim .fn .executable (fullpath ) == 1 then
3943 return fullpath
4044 end
You can’t perform that action at this time.
0 commit comments