Friday, February 19, 2016

Re: gF doesn't work with latest vim on Windows

Ben Fritz wrote:

> On Friday, February 19, 2016 at 9:52:51 AM UTC-6, DrChip wrote:
> > Ben Fritz wrote:
> > > On Thursday, February 18, 2016 at 11:09:34 AM UTC-6, andalou wrote:
> > >> If I use "set isfname-=:" gF works, but "{visual} gF" doesn't work!
> > >> I get the same error:
> > >>
> > >> E447: Can't find file "main.c:26" in path
> > >>
> > > That's because {visual} gF doesn't pay any attention to line numbers, and visually selecting a file name is designed to let you find files whose characters may not be automatically recognized by Vim (e.g. spaces, or if you've removed ':' from isfname and want to go to a file containing one anyway).
> > >
> > > :help v_gF
> > > {Visual}[count]gF Same as "v_gf".
> > >
> > > :help v_gf
> > > {Visual}[count]gf Same as "gf", but the highlighted text is used as the
> > > name of the file to edit. 'isfname' is ignored.
> > >
> > Another way to say that -- use v or ctrl-v to do your visual selecting,
> > not V.
> >
> > Regards,
> > Chip
>
> I think that the confusion was that v_gF should logically do what gF does in normal mode; edit the file AND jump to a line number. It's confusing that v_gF is instead the same as v_gf, and just edits a file.
>
> Is there a good reason for that discrepancy?

The visual selection is used to locate the file name. Then how do we
find the line number after it?

Perhaps we can make both work better if we have characters for "gF" that
can appear between the file name and the line number. This would
overrule 'isfname', so that even when ':' is in 'isfname' gF would
recognize ":1234" as the line number.

--
You were lucky to have a LAKE! There were a hundred and sixty of
us living in a small shoebox in the middle of the road.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: