'gf' bug?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

'gf' bug?

SungHyun Nam-2
Hello,

I tested it with vim-6.3.82 and vim-7.3beta.
And run vim as:
   git grep code | vim -u NONE --noplugin -

'gf' opens a file for the line below:
     somedir/somefile.c:  code...
     somedir/somefile.c:#include code...
     somedir/somefile.c:/* code...

But, 'gf' generates error for the line below:
     somedir/somefile.c://#include code...

The error message is:
     E447: Can't find file "somedir/somefile.c://#include" in path

It seems '://' pattern caused problem.

Thanks,
namsh

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: 'gf' bug?

SungHyun Nam-2
SungHyun Nam wrote:

>
> I tested it with vim-6.3.82 and vim-7.3beta.
> And run vim as:
> git grep code | vim -u NONE --noplugin -
>
> 'gf' opens a file for the line below:
> somedir/somefile.c: code...
> somedir/somefile.c:#include code...
> somedir/somefile.c:/* code...
>
> But, 'gf' generates error for the line below:
> somedir/somefile.c://#include code...
>
> The error message is:
> E447: Can't find file "somedir/somefile.c://#include" in path
>
> It seems '://' pattern caused problem.

Now I found VIM treats it as hypertext link.
Does it look like a valid hypertext link?
If VIM has trouble to detect valid hypertext link, how about added
another option such as 'nohypertextlink' or
'hypertextlinkprefix=ftp,http,dav,fetch,rcp,rsync,scp,sftp' or
something like that?

Thanks,
namsh

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: 'gf' bug?

Benjamin Fritz
In reply to this post by SungHyun Nam-2


On Jun 16, 7:26 pm, SungHyun Nam <[hidden email]> wrote:

> Hello,
>
> I tested it with vim-6.3.82 and vim-7.3beta.
> And run vim as:
>    git grep code | vim -u NONE --noplugin -
>
> 'gf' opens a file for the line below:
>      somedir/somefile.c:  code...
>      somedir/somefile.c:#include code...
>      somedir/somefile.c:/* code...
>
> But, 'gf' generates error for the line below:
>      somedir/somefile.c://#include code...
>
> The error message is:
>      E447: Can't find file "somedir/somefile.c://#include" in path
>
> It seems '://' pattern caused problem.
>

The 'gf' command opens the file under the cursor, where it gets the
file name from all characters under the cursor that are in 'isfname'.

Your problem, is ':' is in 'isfname' (and for good reason). You can
either temporarily set isfname-=: before doing your gf, or (as I would
recommend) you could change your 'grepprg' option within Vim to allow
you to do your git grep command from *within* Vim, allowing Vim to
parse the results into your quickfix list.

See http://vim.wikia.com/wiki/Find_in_files_within_Vim

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php