Issue
Tilde paths work on windows, but only using forward slash (/) separated paths.
Filename completion works on windows, but only using backslash (\) separated paths.
This means that autocomplete cannot be used with home-paths on windows, despite the machinery for both being implemented.
Examples
Assuming the file C:\Users\User\foo.txt exists, micro:
- correctly autocompletes
C:\Users\User\foo to C:\Users\User\foo.txt
- fails to autocomplete
C:/Users/User/foo
- fails to autocomplete
~\foo
- fails to autocomplete
~/foo
In addition:
- micro fails to open
~\foo.txt (seemingly attempting to find some user \foo.txt)
- it does, however, successfully open
~/foo.txt
Proposed Solution:
Update homeString := strings.Split(path, "/")[0] in util.go to use string(os.PathSeparator) instead of "/", as is already the case in autocomplete.go (or vice versa), or otherwise come up with some solution to make both forward and backslashes work in both places on windows.
Issue
Tilde paths work on windows, but only using forward slash (
/) separated paths.Filename completion works on windows, but only using backslash (
\) separated paths.This means that autocomplete cannot be used with home-paths on windows, despite the machinery for both being implemented.
Examples
Assuming the file
C:\Users\User\foo.txtexists, micro:C:\Users\User\footoC:\Users\User\foo.txtC:/Users/User/foo~\foo~/fooIn addition:
~\foo.txt(seemingly attempting to find some user\foo.txt)~/foo.txtProposed Solution:
Update
homeString := strings.Split(path, "/")[0]inutil.goto usestring(os.PathSeparator)instead of"/", as is already the case inautocomplete.go(or vice versa), or otherwise come up with some solution to make both forward and backslashes work in both places on windows.