wsdjeg / vim-fetch

Make Vim handle line and column numbers in file names with a minimum of fuss
http://www.vim.org/scripts/script.php?script_id=5089
MIT License
311 stars 17 forks source link

Trouble with hyphens in filename #37

Open pschmitt opened 1 year ago

pschmitt commented 1 year ago

Hi,

I've used this awesome plugin for a few years now and I finally found something wrong with it :)

So in a nutshell, given the files:

# does not work
vim /home/pschmitt/.config/zsh/plugins/local/insta-360-link.zsh:7

# works
vim /home/pschmitt/.config/zsh/plugins/local/insta360link.zsh:7

# works
vim /home/pschmitt/.config/zsh/plugins/local/insta_360_link.zsh:7
Rafflesiaceae commented 1 year ago

I can reproduce this locally.

Rafflesiaceae commented 1 year ago

This rule https://github.com/wsdjeg/vim-fetch/blob/bbb75c3172f766d1a62832df0ec7674c69a560ad/autoload/fetch.vim#L36 messes up your path:

/home/pschmitt/.config/zsh/plugins/local/insta-360-link.zsh

by mangling it to:

/home/pschmitt/.config/zsh/plugins/local/insta

This was introduced in https://github.com/wsdjeg/vim-fetch/commit/7936cba1.

I assume that this could be solved via either:

  1. Fixing the pattern (if possible)
  2. Removing the -\d- pattern
  3. Allow users to disable patterns like this individually via config variables

@wsdjeg