Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gF fails when &isf contains spec characters #9

Open
justinmk opened this issue Jun 16, 2015 · 10 comments
Open

gF fails when &isf contains spec characters #9

justinmk opened this issue Jun 16, 2015 · 10 comments
Labels
bug os:windows Issues specific to (or particularly relevant to) the Windows platform.
Milestone

Comments

@justinmk
Copy link

Using the default vim-fetch settings, gF on foo.py:46: in the following text fails for me (Vim 7.4.618):

foo.py:46:      if(not Directory.Exists(destinationDir)):
foo.py:49:      if(File.Exists(filePath)):
foo.py:54:      if not Directory.Exists(self.PATH_TO_FILES):

Error:

Error detected while processing function fetch#cfile:
line   26:
E447: Can't find file "foo.py:46" in path

Yet :edit foo.py:46 does work.

But :edit foo.py:46: (with colon at the end) fails. These also fail:

call fetch#cfile(0)
call fetch#cfile(1)
call fetch#cfile(2)
call fetch#cfile(3)
call fetch#cfile(4)

If I unmap gF so that the default Vim gF is used, it also fails with the same error. I'm guessing this is the problem, but since :edit foo.py:46 works, why can't fetch#cfile() work also, instead of using Vim's broken thing?

@kopischke
Copy link
Collaborator

Actually, vim-fetch is not using Vim’s gF (it uses gf to fetch the file, then manages the jump on its own). The errors happen independently, albeit for the same reason: foo.py:46 is misidentified as the file name to search for.

In the case of the plugin this seems to be due to an error in the jump pattern regex. I’ll try to get to the root of this as soon as I am at my machine again, which might not be in the next few days, though – sorry about that.

@kopischke kopischke self-assigned this Jun 16, 2015
@kopischke kopischke added the bug label Jun 16, 2015
@kopischke
Copy link
Collaborator

Just to confirm something before I get to investigate further: what is the output of

:echo expand('<cfile>')

at the problematic position?

@justinmk
Copy link
Author

Output is

foo.py:46

(lacks the trailing colon)

@kopischke
Copy link
Collaborator

The output of the same command on my system is

foo.py

which would indicate that gF fails because your &isf includes :, either because your are on Windows (that would be a new one, I had you pegged as an OS X user ;)), or that you / one your plugins added : to that (default on *nix systems is @,48-57,/,.,-,_,+,,,#,$,%,~,=). If that is the case, the root bug is that I failed to account for how the value of isf could overlay the jump pattern when getting cfile; I might have to catch E447 and parse out possible jump patterns to handle this. Could you confirm that for me by giving me the output of

:echo &isf

please?

I’m not sure why :edit foo.py:46: should fail, however; in my test, both the form with and without the trailing colon work fine, independently of any isf setting (unsurprisingly, I should add, as the pattern detection is independent of Vim file name detection in that case). Could you give me some more details about how it fails exactly? If there is no error message, try logging the output of

:16verbose edit foo.py:46:

to verbosefile and uploading that somewhere for me to see?

@justinmk
Copy link
Author

gF fails because your &isf includes :, either because your are on Windows (that would be a new one, I had you pegged as an OS X user ;)),

Yes, I was on Windows :) I use all of win/osx/unix on a regular basis. I'll try to isolate it when I get back to a Windows machine.

@kopischke
Copy link
Collaborator

No need to confirm the value of isf if you were on Windows – the default there includes :. I’m still very much interested in the exact error / log of the :edit failure, however. In your own time, I’m unlikely to be able to get back to this before next weekend anyway :).

@kopischke kopischke changed the title gF fails gF fails when &isf contains spec characters Jun 25, 2015
@kopischke kopischke added this to the Release 2.1 milestone Mar 6, 2016
@kopischke
Copy link
Collaborator

@justinmk I am at long last getting to handling this (turns out it necessitates a lot of refactoring to solve cleanly). Watch out for release 2.1.

kopischke added a commit that referenced this issue Mar 6, 2016
With default &isf settings, this is currently only relevant for Windows
and specs using a “:” as separator, but this should also handle custom
&isf settings (e.g. when the parens are included). Fixes #9.
kopischke added a commit that referenced this issue Mar 8, 2016
With default &isf settings, this is currently only relevant for Windows
and specs using a “:” as separator, but this should also handle custom
&isf settings (e.g. when the parens are included). Fixes #9.
kopischke added a commit that referenced this issue Mar 9, 2016
With default &isf settings, this is currently only relevant for Windows
and specs using a “:” as separator, but this should also handle custom
&isf settings (e.g. when the parens are included). Fixes #9.
@justinmk
Copy link
Author

justinmk commented Mar 9, 2016

@kopischke Worth the wait ;)

@kopischke kopischke modified the milestones: Release 3.0, Future plans Mar 4, 2018
@kopischke kopischke added the os:windows Issues specific to (or particularly relevant to) the Windows platform. label Mar 7, 2018
@kopischke kopischke removed their assignment May 5, 2018
@wsdjeg
Copy link
Owner

wsdjeg commented Dec 25, 2018

I start to use Windows os. in my plugin flygrep, I get same error, and I have fixed it. so I will do it here.

@igrep
Copy link

igrep commented Mar 20, 2019

I'm also very interested in the status of this issue. What's the problem with the fix/gf-isfname branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug os:windows Issues specific to (or particularly relevant to) the Windows platform.
Projects
None yet
Development

No branches or pull requests

4 participants