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

Re: BUG in argdo/bufdo ?

Expand Messages
  • Bram Moolenaar
    ... OK, I see the problem now. Vim thinks it already is at the first argument. I ll fix that. ... I don t see a problem with :bufdo . ... Remove the o and
    Message 1 of 5 , Sep 1, 2004
    • 0 Attachment
      Hari Krishna Dara wrote:

      > > > I just observed that the :argdo and :bufdo commands don't work well if
      > > > there is only one buffer in the list (ie, in the :args or in :buffers).
      > > > The problem is when you are viewing a different buffer than what is on
      > > > the list (for :bufdo, this has to be an unlisted buffer, so that it
      > > > doesn't get included, otherwise the list becomes of size 2).
      > >
      > > I don't see this problem. How to reproduce?
      > >
      > >
      >
      > Ok, I just tried the following on an ant build script:
      >
      > gvim -u NONE
      >
      > :set nocp
      > :args build.xml
      > :buf 1
      > :argdo g/target/p
      > E486: Pattern not found: target
      > :e#
      > :argdo g/target/p
      > <target name="init" depends="standardInit, standardMakeDirs">
      > .
      > .
      >
      > When you get the E486, you can observe that the current buffer is still
      > unnamed buffer.

      OK, I see the problem now. Vim thinks it already is at the first
      argument. I'll fix that.

      > I swear, I could reproduce the same problem earlier with the :bufdo
      > command as well, but when I did the following this time, it didn't
      > happen for some reason (something was different then, may be you can
      > figure out the cause from the code):

      I don't see a problem with ":bufdo".

      > To reproduce the other problem, try the following again:
      >
      > gvim -u NONE
      > :set nocp
      > :e target1
      > :append
      > target11
      > target12
      > .
      > :w
      > :e target2
      > :append
      > target21
      > target22
      > .
      > :w
      > :bufdo g/target/p
      > "target1" 3L, 22C
      > target11
      > "target2" 3L, 22C
      > target21
      > target22
      >
      >
      > You can see that "target12" got overwritten by the message
      > ""target2" 3L, 22C". I hope you can reproduce the problems now.

      Remove the 'o' and 'O' flags from 'shortmess' to avoid messages
      overwriting each other. You will have to press Enter more often then.

      --
      There is a fine line between courage and foolishness.
      Unfortunately, it's not a fence.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.