oberblastmeister / neuron.nvim

Make neovim the best note taking application
MIT License
398 stars 34 forks source link

Resolve & escape neuron_dir in autocmd path match #23

Open Shados opened 3 years ago

Shados commented 3 years ago

This does two things to the neuron_dir configuration argument before using it in the autocmd path match for setting up mappings:

  1. Resolves the real path; this is necessary if the path given is a link of some kind, as vim autocmds appear to compare against the real path.
  2. Escapes the path so it is safe to use a path with spaces in it.

Note: There are plenty of things other than spaces that, if present in the path, would break its use here. That said, neovim's documentation on file-pattern is lacking, and reading through the source code to try and figure out how they're actually interpreted was a complete nightmare, so I've just fixed the one problem I actually had. And hell, the other possible issues are ones people are a lot less likely to run into.