Ответ на сообщение «Bug in 7.3.3: Cursor jumps in insert mode when 'a' and 'w' 
in 
'formatoptions'», 
присланное в 10:56:15 15 сентября 2010, Среда,
отправитель Gary Johnson:

It is probably a duplicate of my report:

From: ZyX <[email protected]>
Date: Sun, 22 Aug 2010 00:23:40 +0400
Subject: [BUG] Setting formatoption to auto ('a') causes cursor to jump on input

The following script causes wrong behavior: expected to see ``^^'' in the file,
but actually first ``^'' is 8 characters far from second ``^'' (see result.txt,
notice the tab appeared at the start of the file replacing 8 spaces).

Vim version 7.3, gentoo amd64 with blank user configuration.
==== bug.sh ====
cat > input.txt <<EOF
        Word word word word word word word word word word word word word word 
        word word word word word word word word word word word word word word 
        word word word word word word word word word word word word word word
EOF
vim -u NONE --cmd 'set formatoptions=a' -c 'normal! 2ggI^^' -c 'w! result.txt' 
-c 'qa!' 
input.txt
== result.txt ==
        Word word word word word word word word word word word word word word
^word wor^d word word word word word word word word word word word word word
word word word word word word word word word word word word word
================

Текст сообщения:
> 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

Attachment: signature.asc
Description: This is a digitally signed message part.

Raspunde prin e-mail lui