I think I've found a bug in the 'formatoptions' 'w' and 'a' options
of vim 7.3.3. When these are present in 'formatoptions', inserting
text in an indented line causes the cursor to jump to the right by
the indent amount for each character typed.
This didn't happen in 7.2. It's been happening to me for a while,
but I hadn't had time to investigate it and to find a small example.
I don't know in what version it started.
Here's how to reproduce it.
$ vim -N -u NONE
:set fo+=aw
:set ai
:set tw=40
I don't think the 'tw' value matters. I set it to 40 avoid a lot of
typing.
Insert enough text to create a paragraph of at least two lines,
indented by some amount. On some line other than the first, move
the cursor somewhere early in the line and attempt to insert
something. After inserting the first character, the cursor will
jump the indent amount to the right. The next character will be
inserted to the left of the cursor and the cursor will again jump
the indent amount to the right.
Here's a specific example. Put the following text into a buffer,
indented by three spaces as shown.
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Note that the first line ends with a space. Move the cursor to the
first 't' in the second line and type
i1234
The second line will then look like this:
consec1tet2uer3 ad4ipiscing elit.
I am running vim 7.3.3 on RHEL4.
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 17 2010 23:24:30)
Included patches: 1-3
Compiled by [email protected]
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
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi
+file_in_path +find_in_path +float +folding -footer +fork() +gettext
-hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall
+linebreak +lispindent +listcmds +localmap -lua +menu +mksession
+modify_fname
+mouse +mouseshape -mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm
-mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg
-osfiletype +path_extra -perl +persistent_undo +postscript +printer
-profile
-python -python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs
+smartindent -sniff +startuptime +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/garyjohn/src/Linux/vim-7.3-hg/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/lib/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/lib/glib-2.0/include -g -O2 -I/usr/X11R6/include
Linking: gcc -L/usr/X11R6/lib -L/usr/local/lib -o vim
-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
-lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
-lXt -lm -lncurses -lselinux -lacl -lgpm
Regards,
Gary
--
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