fix: continue improving Windows path escaping for commands #1388
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 PR addresses more edge cases with path escaping and vim commands, as noted in #1382.
After some testing, I found that only a small number of punctuation characters required the extra escape after
vim.fn.fnameescape
. They are:&
,(
,)
,;
,^
, and`
.Details
Testing method used was running
:luafile %
with the followingtest.lua
on a Windows machine:This testing logic could certainly be improved, I just quickly slapped this together.
The only reason I included the above is because it may be worth creating Windows path tests in the future and didn't want to lose this information.
I manually verified this fixes the issue in #1382, and tried to recreate some issues I've reported/worked on (such as #1352) and did not see any regressions. That being said, I would feel a bit better if someone could get a second pair of eyes on a Windows machine with this PR.