fix: make buffer command compatible with Windows paths (#1350) #1351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an incredibly boring PR. It adds a space to the
b[uffer]
command so that buffer names that use absolute Windows paths can be used without causing errors. This is in line with usage described in:h :buffer
and:h {bufname}
.I've manually tested this change on Windows and WSL with the following types of buffers to ensure no regressions as best I can:
All cases result in the correct behavior: a warning is issued and the unsaved buffer is focused, without causing errors. Unfortunately I don't have a macOS machine handy to test but I imagine paths and buffer names behave the same or nearly the same as on WSL.
PS: The current implementation of swapping to a buffer by name may be problematic for buffer names that are numbers (see:
:h :buffer
). This is outside the scope of this PR, but for reference this comes from theutils.get_opened_buffers
function:neo-tree.nvim/lua/neo-tree/utils/init.lua
Lines 314 to 331 in cfe1920