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

Possible bug related to visual mode

Expand Messages
  • Richard Hartmann
    Hi, I suspect that this issue relates to the complete removal of the lines in question. No idea how hard this makes a possible fix. As the issue is not
    Message 1 of 6 , Oct 2, 2007
      Hi,


      I suspect that this issue relates to the complete removal of the lines
      in question. No idea how hard this makes a possible fix. As the issue is
      not critical (unlikely to be scripted, a human will notice), it might
      not be worth the effort. Also, I might just no be aware of known
      behaviour. In any case, here goes:

      Select visual block : ^v
      Enter replace mode : R
      Go into command mode : <esc>
      Undo latest change : u
      Reselect latest vblock : gv

      Expected behaviour:
      Visual block mode with the block selected

      Shown behaviour:
      Visual line mode with all lines that were part of the block selected.


      Thanks
      Richard

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Andy Wokula
      ... R as a side effect changes the selection into line-wise (to replace the lines and not only the block). After gv, press Ctrl-V to get the blockwise
      Message 2 of 6 , Oct 2, 2007
        Richard Hartmann schrieb:
        > Hi,
        >
        >
        > I suspect that this issue relates to the complete removal of the lines
        > in question. No idea how hard this makes a possible fix. As the issue is
        > not critical (unlikely to be scripted, a human will notice), it might
        > not be worth the effort. Also, I might just no be aware of known
        > behaviour. In any case, here goes:
        >
        > Select visual block : ^v
        > Enter replace mode : R
        > Go into command mode : <esc>
        > Undo latest change : u
        > Reselect latest vblock : gv
        >
        > Expected behaviour:
        > Visual block mode with the block selected
        >
        > Shown behaviour:
        > Visual line mode with all lines that were part of the block selected.
        >
        >
        > Thanks
        > Richard

        R as a side effect changes the selection into line-wise (to replace the
        lines and not only the block).
        After gv, press Ctrl-V to get the blockwise selection back.

        --
        Andy

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... Here when I hit shift-R, the whole lines containing the visual block get replaced by one empty line. If I hit instead, I get a beep. Checking for ...
        Message 3 of 6 , Oct 2, 2007
          Richard Hartmann wrote:
          > Hi,
          >
          >
          > I suspect that this issue relates to the complete removal of the lines
          > in question. No idea how hard this makes a possible fix. As the issue is
          > not critical (unlikely to be scripted, a human will notice), it might
          > not be worth the effort. Also, I might just no be aware of known
          > behaviour. In any case, here goes:
          >
          > Select visual block : ^v
          > Enter replace mode : R
          > Go into command mode : <esc>
          > Undo latest change : u
          > Reselect latest vblock : gv
          >
          > Expected behaviour:
          > Visual block mode with the block selected
          >
          > Shown behaviour:
          > Visual line mode with all lines that were part of the block selected.
          >
          >
          > Thanks
          > Richard

          Here when I hit shift-R, the whole lines containing the visual block get
          replaced by one empty line. If I hit <Ins> instead, I get a beep. Checking for
          mappings:

          :map R
          No mapping found
          :map! R
          No mapping found


          It might be a feature rather than a bug: see
          :help v_R
          :help v_S

          Best regards,
          Tony.
          --
          If they can make penicillin out of moldy bread, they can sure make
          something out of you.
          -- Muhammad Ali

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Richard Hartmann
          ... I _did_ check R, but I never knew v_foo existed. Thanks! Sounds to me as if my expected behaviour is on Bram To{olong}do list, already :) Richard
          Message 4 of 6 , Oct 2, 2007
            On 02/10/2007, Tony Mechelynck <antoine.mechelynck@...> wrote:

            > It might be a feature rather than a bug: see
            > :help v_R
            > :help v_S

            I _did_ check R, but I never knew v_foo existed. Thanks! Sounds to me as
            if my expected behaviour is on Bram To{olong}do list, already :)


            Richard

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Andy Wokula
            An attempt to implement v_R: File: vbreplace.vim Created: 2007 Oct 02 Last Change: 2007 Oct 02 Implement v_b_R: works like v_b_I, but
            Message 5 of 6 , Oct 2, 2007
              An attempt to implement v_R:

              " File: vbreplace.vim
              " Created: 2007 Oct 02
              " Last Change: 2007 Oct 02

              " Implement v_b_R: works like v_b_I, but starts replace mode in every line.
              " This is different from v_s (change the selection).
              " Note: You should stick with Esc and Ctrl-C to quit replace mode.

              vno R :<c-u>call <sid>Rstart()<cr>R

              func! <sid>Rstart()
              if visualmode() != "\<c-v>"
              return
              endif
              let s:col = virtcol(".")
              ino <esc> <esc>:call <sid>Repeat()<cr>
              ino <c-c> <c-c>:call <sid>Rend()<cr>
              endfunc

              func! <sid>Repeat()
              let sav_ve = &ve
              " set virtualedit+=onemore
              set virtualedit=all
              " without ve: would change the last char of a line if one column behind
              exec "'<,'>g/\\%>".(s:col-1).'v/normal! '.s:col.'|.'
              normal! `<m[
              let &ve = sav_ve
              call <sid>Rend()
              endfunc

              func! <sid>Rend()
              iun <esc>
              iun <c-c>
              endfunc

              " just found a bug:
              " :set ve+=onemore
              "
              " works with "2|", but not with ":normal! 2|" (check out with the above
              " line)

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Richard Hartmann
              On 02/10/2007, Andy Wokula wrote: Heh, thanks. I am really amazed by the community around vim :) Did you put that script on the Wiki? I
              Message 6 of 6 , Oct 4, 2007
                On 02/10/2007, Andy Wokula <anwoku@...> wrote:


                Heh, thanks. I am really amazed by the community around vim :)

                Did you put that script on the Wiki? I suspect others might like
                it, as well.


                Richard

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.