@@ -92,26 +92,27 @@ function M.posix_to_windows(posix_path)
92
92
-- Idk if WezTerm paths behaviour leaks to msys2 actually...
93
93
if not prefix_changed then
94
94
if # posix_path == 2 and posix_path :find (" /[A-Za-z]" ) then
95
- -- vim.notify("Only '[A-Za-z]: ' case: " .. posix_path, vim.log.levels.WARN)
95
+ -- vim.notify("Only '/ [A-Za-z]' case: " .. posix_path, vim.log.levels.WARN)
96
96
posix_path = posix_path :gsub (" ^/([A-Za-z])" , " %1:\\ " )
97
97
prefix_changed = true
98
98
else
99
- -- vim.notify("'[A-Za-z]:?/' case: " .. posix_path, vim.log.levels.WARN)
99
+ -- vim.notify("'/ [A-Za-z]:?/' case: " .. posix_path, vim.log.levels.WARN)
100
100
posix_path = posix_path :gsub (" ^/([A-Za-z]):?/" , " %1:\\ " )
101
101
prefix_changed = true
102
102
end
103
103
end
104
104
105
- -- Lets try to be msys2 compliant for testing.
105
+ -- Lets try to use posix-style paths for testing.
106
106
-- posix_path = posix_path:gsub("^/([A-Za-z]):?([^0-9A-Za-z_-]?)", "/%1%2")
107
107
108
108
109
- -- Replace remaining forward slashes with backslashes .
109
+ -- Replace remaining backslashes with forward slashes .
110
110
posix_path = posix_path :gsub (" /" , " \\ " )
111
111
112
112
-- For bash.exe (nvim shell) it is better to use backslashes
113
- -- cause forward slashes must be escaped. Need to come up with something
114
- -- cause nvim for windows (even clang64 binary) prefers windows-style paths (with backslashes?).
113
+ -- cause forward slashes must to be escaped. Need to come up with something
114
+ -- cause nvim for windows (even clang64 binary) prefers windows-style paths (with backslashes as well?).
115
+ -- UPD. "set shellslash" makes the trick by converting forward slashes to backslashes in shell invocations.
115
116
-- posix_path = posix_path:gsub("\\", "/")
116
117
117
118
0 commit comments