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

[patch] Undo messages may not be shown

Expand Messages
  • Ken Takata
    Hi, Sometimes (maybe when scrolling occurs) undo messages like 2 fewer lines: before #79 7 seconds ago are not shown. (Vim 7.4.041 on Windows, 7.3.429 on
    Message 1 of 4 , Oct 1, 2013
    • 0 Attachment
      Hi,

      Sometimes (maybe when scrolling occurs) undo messages like
      "2 fewer lines: before #79 7 seconds ago" are not shown.
      (Vim 7.4.041 on Windows, 7.3.429 on Linux)

      E.g.

      1. $ gvim -N -u NONE -U NONE
      2. Input a line: `ifoo<CR><Esc>`.
      3. Repeat it more than 25 times (= more than the screen lines) using `.`.
      4. Go to the first line using `gg`, then undo by using `u`.
      Undo message will not be shown.
      5. Repeat `ggu` several times.
      Undo message will be shown if the file lines becomes fewer than the screen
      lines.

      Attached patch seems to fix this, but I'm not sure this is the best way.

      Regards,
      Ken Takata

      --
      --
      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/groups/opt_out.
    • Bram Moolenaar
      ... No, this forces a redraw of the whole screen. It works because instead of deleting lines, which causes the message to scroll up and be cleared, it
      Message 2 of 4 , Oct 2, 2013
      • 0 Attachment
        Ken Takata wrote:

        > Hi,
        >
        > Sometimes (maybe when scrolling occurs) undo messages like
        > "2 fewer lines: before #79 7 seconds ago" are not shown.
        > (Vim 7.4.041 on Windows, 7.3.429 on Linux)
        >
        > E.g.
        >
        > 1. $ gvim -N -u NONE -U NONE
        > 2. Input a line: `ifoo<CR><Esc>`.
        > 3. Repeat it more than 25 times (= more than the screen lines) using `.`.
        > 4. Go to the first line using `gg`, then undo by using `u`.
        > Undo message will not be shown.
        > 5. Repeat `ggu` several times.
        > Undo message will be shown if the file lines becomes fewer than the screen
        > lines.
        >
        > Attached patch seems to fix this, but I'm not sure this is the best way.

        No, this forces a redraw of the whole screen. It works because instead
        of deleting lines, which causes the message to scroll up and be cleared,
        it overwrites the screen.

        It's better to find a way to fill keep_msg. Unfortunately there is no
        asy way to call smsg() and have msg_attr_keep() called with "keep" set
        to TRUE. A global variable would be the easyest, but it's ugly.


        --
        Not too long ago, cut and paste was done with scissors and glue...

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        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/groups/opt_out.
      • Ken Takata
        Hi, ... Then I think it s better to add a new function smsg_attr_keep(). Please check the attached patch. BTW, Yukihiro Nakadaira found an easier way to
        Message 3 of 4 , Oct 2, 2013
        • 0 Attachment
          Hi,

          2013/10/02 Wed 19:52:29 UTC+9 Bram Moolenaar wrote:
          > Ken Takata wrote:
          >
          > > Hi,
          > >
          > > Sometimes (maybe when scrolling occurs) undo messages like
          > > "2 fewer lines: before #79 7 seconds ago" are not shown.
          > > (Vim 7.4.041 on Windows, 7.3.429 on Linux)
          > >
          > > E.g.
          > >
          > > 1. $ gvim -N -u NONE -U NONE
          > > 2. Input a line: `ifoo<CR><Esc>`.
          > > 3. Repeat it more than 25 times (= more than the screen lines) using `.`.
          > > 4. Go to the first line using `gg`, then undo by using `u`.
          > > Undo message will not be shown.
          > > 5. Repeat `ggu` several times.
          > > Undo message will be shown if the file lines becomes fewer than the screen
          > > lines.
          > >
          > > Attached patch seems to fix this, but I'm not sure this is the best way.
          >
          > No, this forces a redraw of the whole screen. It works because instead
          > of deleting lines, which causes the message to scroll up and be cleared,
          > it overwrites the screen.
          >
          > It's better to find a way to fill keep_msg. Unfortunately there is no
          > asy way to call smsg() and have msg_attr_keep() called with "keep" set
          > to TRUE. A global variable would be the easyest, but it's ugly.

          Then I think it's better to add a new function smsg_attr_keep().
          Please check the attached patch.

          BTW, Yukihiro Nakadaira found an easier way to reproduce the problem:

          $ vim -u NONE -N
          Ofoo<Esc>..uuu

          Now we don't need to repeat `.` 25 times ;-)

          Regards,
          Ken Takata

          --
          --
          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/groups/opt_out.
        • Yukihiro Nakadaira
          With this patch, message after undo is ignored when using macro. $vim -u NONE -N ofoo .....:normal ukkk3dd Message without patch: 3 fewer lines Message
          Message 4 of 4 , Oct 4, 2013
          • 0 Attachment
            With this patch, message after undo is ignored when using macro.

            $vim -u NONE -N
            ofoo<Esc>.....:normal ukkk3dd

            Message without patch:
            3 fewer lines

            Message with patch:
            1 line less; before #6  5 seconds ago

            --
            Yukihiro Nakadaira - yukihiro.nakadaira@...

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