-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edit files using a relative path when possible #71
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.