On 23/06/08 19:48, Ben Schmidt wrote:
> Mikael Jansson wrote:
>> Hi,
>>
>> I'm not very familiar with the Vim code base, so I couldn't quite find
>> my way around, so I'm asking here instead:
>>
>> Will the range for % (the entire file) always be 1 for line1 and
>> number-of-lines-in-file for line2?
>
> Yes.
>
> :tag do_one_cmd | /%
>
> There is a comment there, and if you scroll down a bit you will find.
>
>           if (*ea.cmd == '%')             /* '%' - all lines */
>           {
>               ++ea.cmd;
>               ea.line1 = 1;
>               ea.line2 = curbuf->b_ml.ml_line_count;
>               ++ea.addr_count;
>           }
>
> Ben.

Before that :tag command works, you need to:

1. download the Vim source
2. make sure you have Exuberant Ctags installed (or at least a version 
of ctags which will execute correctly the command

ctags -I INIT+ --fields=+S *.c *.cpp if_perl.xs *.h

when run from the src directory).
3. run "make tags" from the top-level Makefile, or if you haven't got 
make, run the above ctags command in the src directory.
4. load one of the Vim source files into Vim. (running the same :tag 
command while looking at the Vim help, for instance, would try to find a 
help tag named do_one_cmd).

The above excerpt from the Vim code  _proves_ that :% means :1,$. If you 
aren't interested in the Vim source, :help :% _says_ that they are the 
same (it admittedly doesn't prove it, but if something like that had 
gone wrong for any length of time, either the help or the C code would 
have been changed to make them both reflect the intended behaviour).


Best regards,
Tony.
-- 
"I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has intended us to forego their use."
                -- Galileo Galilei

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui