Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions plugin/ranger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ if has('nvim')
try
if filereadable(s:choice_file_path)
for f in readfile(s:choice_file_path)
exec self.edit_cmd . f
if executable('realpath')
let relpath = system('realpath --relative-to=. ' . f)
if strlen(relpath) < strlen(f)
exec self.edit_cmd . relpath
else
exec self.edit_cmd . f
endif
else
exec self.edit_cmd . f
endif
endfor
call delete(s:choice_file_path)
endif
Expand All @@ -79,7 +88,16 @@ else
endif
if filereadable(s:choice_file_path)
for f in readfile(s:choice_file_path)
exec a:edit_cmd . f
if executable('realpath')
let relpath = system('realpath --relative-to=. ' . f)
if strlen(relpath) < strlen(f)
exec a:edit_cmd . relpath
else
exec a:edit_cmd . f
endif
else
exec a:edit_cmd . f
endif
endfor
call delete(s:choice_file_path)
endif
Expand Down