-
Notifications
You must be signed in to change notification settings - Fork 55
Use vim functions instead of system() #52
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
Conversation
plugin/ranger.vim
Outdated
| exec self.edit_cmd . system('head -n1 ' . s:choice_file_path) | ||
| call system('rm ' . s:choice_file_path) | ||
| for f in readfile(s:choice_file_path) | ||
| exec 'edit '. f |
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.
please use the params self.edit_cmd instead of 'edit ' to keep the "open the file in a new tab" feature working
|
Thank you for your contribution! I will try locally |
|
@francoiscabrol: I've updated the code to use |
|
I found one weird thing: with your changes, if I try to open a folder with that fix the issue. |
|
This PR should fix also the issue #53 |
|
I removed the parameter, now it should be all done. |
|
awesome! I tried and everything looks good. Thank you! |
Fix #51 #53
Using vim functions instead of external programs dramatically reduces the delay when opening files. Tested with neovim and vim.
In order to make it work with vim I had to add the
_close_prevparameter (prefixed with underscore as unused), otherwise calling the function will cause the error too many arguments passed.I appreciate your comments on #4 about the fact that anyone want a personal version, but this PR is just an improvement and is not changing the logic (at least for what I can see).
Please let me know your feedback.