Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Tim Chase
    ... That s sorta what I figured, as I mentioned in my original post: TKC lines before the :g and comparing it to number of lines after TKC the :g , and
    Message 1 of 5 , Apr 29, 2011
    • 0 Attachment
      On 04/28/2011 09:49 PM, Jean-Rene David wrote:
      > * 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.

      That's sorta what I figured, as I mentioned in my original post:

      TKC> lines before the ":g" and comparing it to number of lines after
      TKC> the ":g", and reporting the difference, but not noticing
      that the
      TKC> file/buffer/window had changed in the process.

      Thanks for throwing together a patch.

      -tim



      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.