Thursday, April 28, 2011

Re: ":windo g/pattern/q" peculiarity

* Tim Chase [2011.04.28 14:40]:
> Because each of your files have the same number of lines, it doesn't
> register a change. For a full example:
>
> bash$ cd ~/tmp; mkdir moreless; cd moreless
> bash$ for i in 10 20 30 40 50; do seq $i > ${i}.txt ; done
> bash$ sed -i '5s/$/@/' 30.txt
> bash$ sed -i '10s/$/@/' 50.txt
> bash$ vim -o *.txt
> :windo g/@/q

Got it now.

The problem is that the :g command just subtracts the number of lines in
the buffer where it starts from the number of lines in the buffer where
it ends to produce that message.

Of course it assumes those two buffers are the same but it doesn't
*check* that it is so.

I have a small patch to fix that as soon as my registration on vim-dev
goes through...

--
JR

--
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

No comments: