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

virtualedit bug

Expand Messages
  • Ralf Wildenhues
    I noted a regression introduced recently: With a ~/.vimrc containing only set nocompatible if has( virtualedit ) set virtualedit=block endif no other own
    Message 1 of 5 , Mar 1, 2006
    • 0 Attachment
      I noted a regression introduced recently:

      With a ~/.vimrc containing only

      set nocompatible
      if has("virtualedit")
      set virtualedit=block
      endif

      no other own configuration files, and then typing
      vim
      i[

      the cursor does not move past the inserted bracket. It is not possible with
      movements to get behind the bracket. Same with parentheses.

      Please Cc: me on replies -- thanks.

      Cheers,
      Ralf

      :ve
      VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 28, compiled Mar 1 2006 13:09:39)
      Compiled by ralf@localhost
      Normal version with GTK2 GUI. Features included (+) or not (-):
      -arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
      +clientserver +clipboard +cmdline_compl +cmdline_hist
      +cmdline_info +comments +cryptv -cscope +cursorshape +dialog_con_gui +diff
      +digraphs +dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search
      -farsi +file_in_path +find_in_path +folding -footer +fork() +gettext
      -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall
      +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse
      +mouseshape -mouse_dec +mouse_gpm -mouse_jsbterm
      -mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg
      -osfiletype +path_extra -perl +postscript +printer -profile
      -python +quickfix -rightleft -ruby +scrollbind +signs +smartindent -sniff
      +statusline -sun_workshop +syntax +tag_binary +tag_old_static
      -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar
      +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
      +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
      +xsmp_interact +xterm_clipboard -xterm_save
      system vimrc file: "$VIM/vimrc"
      user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/gvimrc"
      user gvimrc file: "$HOME/.gvimrc"
      system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/home/ralf/local/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -DXTHREADS
      -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
      -I/usr/lib64/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
      -I/usr/include/pango-1.0 -I/usr/include/freetype2
      -I/usr/include/freetype2/config -I/usr/include/glib-2.0
      -I/usr/lib64/glib-2.0/include -g -O2 -I/usr/X11R6/include
      Linking: gcc -L/usr/X11R6/lib64 -L/usr/local/lib -o vim
      -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
      -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl
      -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lncurses -lgpm -ldl
    • A. J. Mechelynck
      ... [...] 1. Not even in visual block mode? (I can.) If you can move the cursor in visual block mode, then there is no bug, see :help virtualedit . 2. If
      Message 2 of 5 , Mar 1, 2006
      • 0 Attachment
        Ralf Wildenhues wrote:
        > I noted a regression introduced recently:
        >
        > With a ~/.vimrc containing only
        >
        > set nocompatible
        > if has("virtualedit")
        > set virtualedit=block
        > endif
        >
        > no other own configuration files, and then typing
        > vim
        > i[
        >
        > the cursor does not move past the inserted bracket. It is not possible with
        > movements to get behind the bracket. Same with parentheses.
        >
        > Please Cc: me on replies -- thanks.
        >
        > Cheers,
        > Ralf
        >
        > :ve
        > VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 28, compiled Mar 1 2006 13:09:39)
        > Compiled by ralf@localhost
        > Normal version with GTK2 GUI. Features included (+) or not (-):
        [...]

        1. Not even in visual block mode? (I can.) If you can move the cursor in
        visual block mode, then there is no bug, see ":help 'virtualedit'".
        2. If you can't move the cursor past the end in visual block mode when
        the last character is a (round, square or curly) bracket, then does it
        change something if you invoke gvim with the --noplugin command-line option?
        3. If it does, does it make a difference if (without --noplugin) you
        execute the ex-command

        :NoMatchParen

        defined in a very recent new plugin?
        4. If it does, then $VIMRUNTIME/plugin/matchparen.vim is the culprit. It
        was "last modified" on 27 February; I didn't notice its action before
        that date. Its help file is pi_paren.txt. If you know Vim script
        language well enough, you may try to fix the bug.


        Note: I'm not seeing that bug on my W32 "big" gvim version of the same
        date as yours.



        Best regards,
        Tony.
      • Ralf Wildenhues
        Hi Tony, ... In visual block mode, I can move past it. But not in Insert Mode. ... Yes, there is a bug. Starting in Normal Mode, I type ia[bESC and the line
        Message 3 of 5 , Mar 1, 2006
        • 0 Attachment
          Hi Tony,

          A. J. Mechelynck <antoine.mechelynck <at> skynet.be> writes:
          > Ralf Wildenhues wrote:
          > >
          > > typing
          > > vim
          > > i[
          > >
          > > the cursor does not move past the inserted bracket. It is not possible with
          > > movements to get behind the bracket. Same with parentheses.

          > 1. Not even in visual block mode? (I can.)

          In visual block mode, I can move past it. But not in Insert Mode.

          > If you can move the cursor in
          > visual block mode, then there is no bug, see ":help 'virtualedit'".

          Yes, there is a bug. Starting in Normal Mode, I type
          ia[bESC

          and the line contains three characters "ab[" in that order.

          > 2. If you can't move the cursor past the end in visual block mode when
          > the last character is a (round, square or curly) bracket, then does it
          > change something if you invoke gvim with the --noplugin command-line option?

          Yes. "vim --noplugin" seems to work as expected.

          [ Aside: I never use the GUI version, but that does not make a difference ]

          > 3. If it does, does it make a difference if (without --noplugin) you
          > execute the ex-command
          >
          > :NoMatchParen
          >
          > defined in a very recent new plugin?

          Yes, that seems to make it work as expected, too.

          > 4. If it does, then $VIMRUNTIME/plugin/matchparen.vim is the culprit.

          Ah, thanks. So I can reproduce this now with this sequence:
          vim -u NONE
          :set nocompatible virtualedit=block
          :so $VIMRUNTIME/plugin/matchparen.vim

          > If you know Vim script
          > language well enough, you may try to fix the bug.

          Let's see. The problem seems to go away if I comment out both line 85:
          call cursor(c_lnum, c_col - before)
          and line 90:
          exe 'normal ' . vcol . '|'

          The problem seems to go away if I change line 90 to be
          call cursor(0, vcol)
          instead of the normal mode command. I believe the normal mode command is
          wrong here, because we are in Insert Mode, but the vcol is not accessible
          in normal mode by the '|' movement as it's after the last character in the
          line.

          I hope this babble made a bit of sense to someone more knowledgeable.
          There is a comment above the code in question that should be adjusted, too.

          Cheers, and thanks for the quick reply!
          Ralf
        • Bram Moolenaar
          ... It is caused by the new matchparen plugin. You can disable it with :NoMatchParen . Or include this patch: diff -u -r1.1 matchparen.vim ... +++
          Message 4 of 5 , Mar 1, 2006
          • 0 Attachment
            Ralf Wildenhues wrote:

            > I noted a regression introduced recently:
            >
            > With a ~/.vimrc containing only
            >
            > set nocompatible
            > if has("virtualedit")
            > set virtualedit=block
            > endif
            >
            > no other own configuration files, and then typing
            > vim
            > i[
            >
            > the cursor does not move past the inserted bracket. It is not possible with
            > movements to get behind the bracket. Same with parentheses.

            It is caused by the new matchparen plugin. You can disable it with
            ":NoMatchParen". Or include this patch:

            diff -u -r1.1 matchparen.vim
            --- ../runtime/plugin/matchparen.vim 27 Feb 2006 23:47:59 -0000 1.1
            +++ ../runtime/plugin/matchparen.vim 1 Mar 2006 14:10:34 -0000
            @@ -81,6 +81,8 @@
            if before > 0
            if &ve != ''
            let vcol = virtcol('.')
            + let old_ve = &ve
            + set ve=all
            endif
            call cursor(c_lnum, c_col - before)
            endif
            @@ -88,6 +90,7 @@
            if before > 0
            if &ve != ''
            exe 'normal ' . vcol . '|'
            + let &ve = old_ve
            else
            call cursor(0, c_col)
            endif


            --
            Anyone who is capable of getting themselves made President should on no
            account be allowed to do the job.
            -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ download, build and distribute -- http://www.A-A-P.org ///
            \\\ help me help AIDS victims -- http://www.ICCF.nl ///
          • Ralf Wildenhues
            Hi Bram, ... Yes. Both the patch and the command fix the issue I observed. Thanks! Ralf
            Message 5 of 5 , Mar 1, 2006
            • 0 Attachment
              Hi Bram,

              Bram Moolenaar <Bram <at> moolenaar.net> writes:
              >
              > It is caused by the new matchparen plugin. You can disable it with
              > ":NoMatchParen". Or include this patch:

              Yes. Both the patch and the command fix the issue I observed.

              Thanks!
              Ralf
            Your message has been successfully submitted and would be delivered to recipients shortly.