edit files using a relative path when possible#71
edit files using a relative path when possible#71fabi1cazenave wants to merge 2 commits intofrancoiscabrol:masterfrom
Conversation
f8fbf8e to
b29c0a5
Compare
|
Hey thank you for your contribution. |
|
Oh, good catch. Looking at it. I confess I hadn’t really tried the |
|
[EDIT] Got it, see commit 98e3e73, line 124. Without this PR, the command was |
e4388ee to
dbb963f
Compare
|
In fact I find the trailing space in That’s what I did in commit 60146fb, but it works without this commit. Feel free to drop it if you prefer keeping the code the other way. EDIT: updated commit references after a rebase. |
Having a trailing space in the `edit_cmd` variable is error-prone. Adding a space between this command and the file path in the `EditFiles` function should be safer.
1bbdc81 to
60146fb
Compare
|
|
||
| function! s:GetRangerCmd(path) | ||
| return s:ranger_command . ' --choosefiles=' . s:choice_file_path . | ||
| \ (isdirectory(a:path) ? ' "' : ' --selectfile="') . expand(a:path) . '"' |
There was a problem hiding this comment.
I don't know why but the path is not concatenated correctly and that breaks the default behaviour:
- if you open a file in vim
- then you open ranger in the same window
- it should select the file in Ranger and it does not (see the command RangerCurrentFile).
Files that have been chosen with Ranger are open in Vim / Neovim with their absolute paths, which is a pity.
This quick patch allows to use the relative path (from Vim’s current working directory) when possible.