Skip to content
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

Use fnameescape to quote filenames for :badd. #595

Merged
merged 1 commit into from
Sep 22, 2016

Conversation

zacharyvoase
Copy link
Contributor

When you move a file in NERDTree's FS menu, and a buffer is already open with it, you're prompted to delete the old buffer and replace it with a new buffer pointing to the file's new location. This wasn't working correctly for me: because the new filename is passed to badd quoted with single quotes, Vim just created a new buffer pointing to a file called '/Users/zack/.../filename' with the quotes. See the odd results of this when trying to rename a file in the nerdtree source tree:

screenshot 2016-06-30 16 20 00

This patch uses the fnameescape() function to do the filename escaping, rather than just surrounding with single quotes. I've tested it and it fixes the error seen in the above screenshot.

@PhilRunninger
Copy link
Member

👍 I've noticed this before. Thanks for the fix, @zacharyvoase.

@PhilRunninger PhilRunninger merged commit fa57b81 into preservim:master Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants