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

Strange buffer numbering, b# doesn't work

Expand Messages
  • Soren Edzen
    Hi! f I have one or more files open in vim and I open a new file in vim it doesn t get the next number in the buffer list. ( 9 instead of 3 etc) It s almost as
    Message 1 of 5 , Sep 2, 2003
    • 0 Attachment
      Hi!
      f I have one or more files open in vim and I open a new file in vim it
      doesn't get the next number in the buffer list. ( 9 instead of 3 etc)
      It's almost as if it's a logaritmic increse of the numbers in the buffer
      list. iI could live with that if wasn't for the fact that the command
      :b# doesn't work. When I issue the command :ls no file has the # in
      front of them.
      I have noticed two occations when this occurs. When I open saved
      sessions, the buffers becomes numbered in the described way. The other
      is when I work with files checked out from cvs. I am not sure that it
      has to do with these two occations. They are the only common things that
      I've noticed.
      Can some one please tell what's going on?

      --
      Sören Edzen
    • Antoine J. Mechelynck
      ... Some buffers (help files etc.) do not appear in the buffer list except with some commands like :ls! (with exclamation mark). When you open a new file it
      Message 2 of 5 , Sep 2, 2003
      • 0 Attachment
        Soren Edzen <soredz@...> wrote:
        > Hi!
        > f I have one or more files open in vim and I open a new file in vim it
        > doesn't get the next number in the buffer list. ( 9 instead of 3 etc)
        > It's almost as if it's a logaritmic increse of the numbers in the
        > buffer list. iI could live with that if wasn't for the fact that the
        > command
        > > b# doesn't work. When I issue the command :ls no file has the # in
        > front of them.
        > I have noticed two occations when this occurs. When I open saved
        > sessions, the buffers becomes numbered in the described way. The other
        > is when I work with files checked out from cvs. I am not sure that it
        > has to do with these two occations. They are the only common things
        > that I've noticed.
        > Can some one please tell what's going on?
        >
        > --
        > Svren Edzen

        Some buffers (help files etc.) do not appear in the buffer list except with
        some commands like :ls! (with exclamation mark). When you open a new file it
        gets the next number after all buffers including "unlisted" buffers; and
        IIUC no buffer number gets reused even after :bwipeout.

        See :help new-unlisted-buffers for an explanation of what these "unlisted"
        buffers are.

        HTH,
        Tony.
      • Sören Edzen
        ... Thanks for your replay, but that doesn t seem to be the problem. I have tested it more thoroughly and come to the conclusion that it has to do with CVS. If
        Message 3 of 5 , Sep 10, 2003
        • 0 Attachment
          * Antoine J. Mechelynck <antoine.mechelynck@...> [2003-09-10 08:08]:
          > Soren Edzen <soredz@...> wrote:
          > > Hi!
          > > f I have one or more files open in vim and I open a new file in vim it
          > > doesn't get the next number in the buffer list. ( 9 instead of 3 etc)
          > > It's almost as if it's a logaritmic increse of the numbers in the
          > > buffer list. iI could live with that if wasn't for the fact that the
          > > command
          > > > b# doesn't work. When I issue the command :ls no file has the # in
          > > front of them.
          > > I have noticed two occations when this occurs. When I open saved
          > > sessions, the buffers becomes numbered in the described way. The other
          > > is when I work with files checked out from cvs. I am not sure that it
          > > has to do with these two occations. They are the only common things
          > > that I've noticed.
          > > Can some one please tell what's going on?
          > >
          > > --
          > > Svren Edzen
          >
          > Some buffers (help files etc.) do not appear in the buffer list except with
          > some commands like :ls! (with exclamation mark). When you open a new file it
          > gets the next number after all buffers including "unlisted" buffers; and
          > IIUC no buffer number gets reused even after :bwipeout.
          >
          > See :help new-unlisted-buffers for an explanation of what these "unlisted"
          > buffers are.
          >
          > HTH,
          > Tony.
          >
          Thanks for your replay, but that doesn't seem to be the problem.
          I have tested it more thoroughly and come to the conclusion that it has
          to do with CVS. If I have a file, checked out from a cvs repository, in
          one buffer, then there is no "#" in front of any file. But if I remove
          the cvs file from the buffer list by the command :bd the "#" reappears.
          can anyone explain this strange behavior?

          TIA,
          Sören.
        • Yakov Lerner
          ... This could be result of some plugin creating then wiping out (:bw) the buffer(s) behind the scenes. If the wiped-out buffer happened to be the # buffer,
          Message 4 of 5 , Sep 10, 2003
          • 0 Attachment
            Sören Edzen wrote:
            > * Antoine J. Mechelynck <antoine.mechelynck@...> [2003-09-10 08:08]:
            >
            >>Soren Edzen <soredz@...> wrote:
            >>
            >>>Hi!
            >>>f I have one or more files open in vim and I open a new file in vim it
            >>>doesn't get the next number in the buffer list. ( 9 instead of 3 etc)
            >>>It's almost as if it's a logaritmic increse of the numbers in the
            >>>buffer list. iI could live with that if wasn't for the fact that the
            >>>command
            >>>
            >>>>b# doesn't work. When I issue the command :ls no file has the # in
            >>>
            >>>front of them.
            >>>I have noticed two occations when this occurs. When I open saved
            >>>sessions, the buffers becomes numbered in the described way. The other
            >>>is when I work with files checked out from cvs. I am not sure that it
            >>>has to do with these two occations. They are the only common things
            >>>that I've noticed.
            >>>Can some one please tell what's going on?
            >>>
            >>>--
            >
            > I have tested it more thoroughly and come to the conclusion that it has
            > to do with CVS. If I have a file, checked out from a cvs repository, in
            > one buffer, then there is no "#" in front of any file. But if I remove
            > the cvs file from the buffer list by the command :bd the "#" reappears.
            > can anyone explain this strange behavior?



            This could be result of some plugin creating then wiping out (:bw) the
            buffer(s) behind the scenes.

            If the wiped-out buffer happened to be the '#' buffer, this will
            cause exactly the situation that you describe. Try for example:

            vim a b <cr> :n <cr> :ls! <cr> :bw #<cr> :ls! <cr> )

            The question is, what plugin or script may be doing it.
            You could track this down using:

            (1) using :scriptnames to see what plugins are active

            (2) adding this to the ~/.vimrc:

            :au BufWipeout * :echomsg '*** buffer No.'.bufnr(expand('<afile>')).' wiped out!'

            it will alert you if any buffer is wiped out

            Jacob Lerner
          • Sören Edzen
            ... Thanks for the tips. I discovered that it was the script cvsmenu.vim that caused the problem with buffer #. The numering in the buffers is a minor
            Message 5 of 5 , Sep 10, 2003
            • 0 Attachment
              * Yakov Lerner <yakov.lerner@...> [2003-09-10 14:03]:
              > >
              > > I have tested it more thoroughly and come to the conclusion that it has
              > > to do with CVS. If I have a file, checked out from a cvs repository, in
              > > one buffer, then there is no "#" in front of any file. But if I remove
              > > the cvs file from the buffer list by the command :bd the "#" reappears.
              > >can anyone explain this strange behavior?
              >
              >
              >
              > This could be result of some plugin creating then wiping out (:bw) the
              > buffer(s) behind the scenes.
              >
              > If the wiped-out buffer happened to be the '#' buffer, this will
              > cause exactly the situation that you describe. Try for example:
              >
              > vim a b <cr> :n <cr> :ls! <cr> :bw #<cr> :ls! <cr> )
              >
              > The question is, what plugin or script may be doing it.
              > You could track this down using:
              >
              > (1) using :scriptnames to see what plugins are active
              >
              > (2) adding this to the ~/.vimrc:
              >
              > :au BufWipeout * :echomsg '*** buffer No.'.bufnr(expand('<afile>')).'
              > wiped out!'
              >
              > it will alert you if any buffer is wiped out
              >
              > Jacob Lerner

              Thanks for the tips. I discovered that it was the script "cvsmenu.vim"
              that caused the problem with buffer #. The numering in the buffers is a
              minor problem, I can live with that. It's the abbsens of the # buffer
              that concerns me most. I will send an e-mail to the persons responsible
              for the script about the problem.

              --
              Sören Edzen
            Your message has been successfully submitted and would be delivered to recipients shortly.