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

Vim 7.4 Relative line number bug?

Expand Messages
  • Robert Arkwright
    I may have discovered a bug with relative line numbers in Vim 7.4. To reproduce: * Launch Vim with default configuration (no ~/.vimrc or ~/.vim directory). *
    Message 1 of 3 , May 11, 2014
    • 0 Attachment
      I may have discovered a bug with relative line numbers in Vim 7.4.

      To reproduce:

      * Launch Vim with default configuration (no ~/.vimrc or ~/.vim directory).
      * Immediately enter insert mode (i).
      * Enter ten lines of text. I will enter "one", "two", ..., into each line.
      * Exit insert mode (<esc>).
      * Turn on relative line numbering (:set relativenumber<CR>).
      * Move your cursor to the fifth line (5k).
      * Delete three lines (dddddd).
      * Undo the deletions (uuu).
      * The relative line numbers below the current line now display "0".
      * The current relative line numbers (top to bottom) are: 4321000045.
      * I expected the line numbers (top to bottom) to be: 4321012345.

      Moving the cursor after undoing the deletions resets the line numbering to the expected state.

      I have added the following line to my ~/.vimrc to work around this problem:

      noremap u ukj

      I am using MacVim Snapshot 73 on OS X 10.7.5.

      A slightly redacted bugreport.txt is attached.

      Thank you for your attention!

      --
      --
      You received this message from the "vim_dev" 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

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Manuel Ortega
      ... I can confirm this on OSX with plain, non-MacVim vim. I also note that the line numbers start getting crazy after the deletion of just one line; I didn t
      Message 2 of 3 , May 11, 2014
      • 0 Attachment
        On Sun, May 11, 2014 at 2:43 PM, Robert Arkwright <rarkwright@...> wrote:
        I may have discovered a bug with relative line numbers in Vim 7.4.

        To reproduce:

        * Launch Vim with default configuration (no ~/.vimrc or ~/.vim directory).
        * Immediately enter insert mode (i).
        * Enter ten lines of text. I will enter "one", "two", ..., into each line.
        * Exit insert mode (<esc>).
        * Turn on relative line numbering (:set relativenumber<CR>).
        * Move your cursor to the fifth line (5k).
        * Delete three lines (dddddd).
        * Undo the deletions (uuu).
        * The relative line numbers below the current line now display "0".
        * The current relative line numbers (top to bottom) are: 4321000045.
        * I expected the line numbers (top to bottom) to be: 4321012345.

        Moving the cursor after undoing the deletions resets the line numbering to the expected state.

        I have added the following line to my ~/.vimrc to work around this problem:

        noremap u ukj

        I am using MacVim Snapshot 73 on OS X 10.7.5.

        A slightly redacted bugreport.txt is attached.

        Thank you for your attention!

        I can confirm this on OSX with plain, non-MacVim vim.

        I also note that the line numbers start getting crazy after the deletion of just one line; I didn't have to delete all three, and I didn't have to do any undoing. 

        -Manny

        --
        --
        You received this message from the "vim_dev" 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

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Christian Brabandt
        Hi Robert! ... You could have simply used nnoremap u u ... I already some unexpected line numbers after deleting. And then again after undoing. Here is a
        Message 3 of 3 , May 12, 2014
        • 0 Attachment
          Hi Robert!

          On So, 11 Mai 2014, Robert Arkwright wrote:

          > I may have discovered a bug with relative line numbers in Vim 7.4.
          >
          > To reproduce:
          >
          > * Launch Vim with default configuration (no ~/.vimrc or ~/.vim directory).
          > * Immediately enter insert mode (i).
          > * Enter ten lines of text. I will enter "one", "two", ..., into each line.
          > * Exit insert mode (<esc>).
          > * Turn on relative line numbering (:set relativenumber<CR>).
          > * Move your cursor to the fifth line (5k).
          > * Delete three lines (dddddd).
          > * Undo the deletions (uuu).
          > * The relative line numbers below the current line now display "0".
          > * The current relative line numbers (top to bottom) are: 4321000045.
          > * I expected the line numbers (top to bottom) to be: 4321012345.
          >
          > Moving the cursor after undoing the deletions resets the line numbering to the expected state.
          >
          > I have added the following line to my ~/.vimrc to work around this problem:
          >
          > noremap u ukj

          You could have simply used
          nnoremap u u<C-L>
          >
          > I am using MacVim Snapshot 73 on OS X 10.7.5.
          >
          > A slightly redacted bugreport.txt is attached.
          >
          > Thank you for your attention!

          I already some unexpected line numbers after deleting. And then again
          after undoing.

          Here is a patch, that forces a correct redraw after those two commands.

          Best,
          Christian
          --
          Ein Künstler, der schätzbare Arbeiten verfertiget, ist nicht
          immer imstande, von eignen oder fremden Werken Rechenschaft zu geben.
          -- Goethe, Maximen und Reflektionen, Nr. 1122

          --
          --
          You received this message from the "vim_dev" 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

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        Your message has been successfully submitted and would be delivered to recipients shortly.