patleeman / VSNotes

Simple VS Code extension for plain text note taking.
https://marketplace.visualstudio.com/items?itemName=patricklee.vsnotes
MIT License
174 stars 34 forks source link

Allow either / or \ as path separators regardless of platform #61

Open antonburger opened 5 years ago

antonburger commented 5 years ago

When creating new notes, it seems needlessly restrictive to require path separators to match the default used by the OS. See also #39.

  1. Plenty of tools, including core VSCode functionality (e.g. the explorer.newFile command), as well as 3rd party ones like PowerShell, allow the use of either slash interchangeably. I mostly use Windows, but English keyboard layouts tend to a) keep / in the same place, with less variation in position across US/UK layouts than \, and b) make / easier to reach. Along with not having to escape things as often, these mean it's really handy being able to use / when it's supported.
  2. Using the "wrong" separator currently results in creation of new directories anyway (nobody really wants to include either slash in a filename, right?) but with the tokens incorrectly expanded in the directory name rather than the note filename.

VSNotes 0.7.1, VSCode 1.38.0, Win10

Ragnoroct commented 4 years ago

I've created a PR to fix this. I've set it up so that the first separator found is the one used.

So input of my/separated/note\with\both is interpreted as my/separated/note/with/both And my\separated/note\with\both is interpreted as my\separated\note\with\both