-
-
Notifications
You must be signed in to change notification settings - Fork 622
fix(#914): remove existence check before create-file, rename-file, harden clobbered buffer renaming #1977
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
I hope that it will not bite back. :) |
Rename failure case OK: Rename when both buffers open failed:
Create clobbers OK, although vim will need to reload the external changes if the buffer is open. |
That was a can of worms. Resolved an existing paste bug. Test cases: Rename:
Rename Clobber:
Paste:
Paste Clobber
Tested buffers loaded with absolute and relative paths. |
local exact_match = buf_name == old_path | ||
local child_match = ( | ||
buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator | ||
) |
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.
All callers use absolute paths hence this fuzzy matching can be removed.
I was tempted to remove the existence checks from paste, however they can be useful and nobody has reported issues. |
This was a failure; trying a simpler approach: #1988 |
fixes #914