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

VIM-7.2.394 multibyte related problem?

Expand Messages
  • SungHyun Nam
    Hello, With the attached files (vimrc and mb.txt), if I open the mb.txt and just type A, gvim -u vimrc -U NONE --noplugin mb.txt A, Now, I should saw (X =
    Message 1 of 6 , Mar 10, 2010
      Hello,

      With the attached files (vimrc and mb.txt), if I open the mb.txt
      and just type A,
      gvim -u vimrc -U NONE --noplugin mb.txt
      A,

      Now, I should saw (X = cursor):
      ....aaaa,X
      But, I saw
      ....aaaa, X

      It occurs on 3 different versions of gvim,
      win32/cygwin-gtk2/linux-gtk2. I included cygwin-gtk2 version info
      below.

      Thanks,
      namsh

      :ver
      VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 11 2010 08:56:42)
      Included patches: 1-394
      Compiled by namsh@namsh
      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
      +float +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_sysmouse +mouse_xterm +multi_byte
      +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl
      +postscript
      +printer -profile +python +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: "/opt/share/vim"
      Compilation: gcc-4 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
      -I/usr/include
      /gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
      -I/usr/include/cairo
      -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
      -I/usr/lib/glib-2.0/include -I/
      usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
      -O2 -m
      arch=i686 -fno-strict-aliasing -pipe -D_FORTIFY_SOURCE=1
      -I/usr/include/pyth
      on2.5
      Linking: gcc-4 -L/usr/local/lib -o vim.exe -lgtk-x11-2.0
      -lgdk-x11-2.0 -latk
      -1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lgio-2.0 -lXinerama -lXi
      -lXrandr -lXcur
      sor -lXcomposite -lXdamage -lpangoft2-1.0 -lXext -lXfixes -lcairo
      -lpixman-1 -lg
      litz -lpng12 -lxcb-render-util -lXrender -lxcb-render -lxcb -lXau
      -lpango-1.0 -l
      fontconfig -lexpat -lfreetype -lz -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
      -lintl
      -lXt -lX11 -lSM -lICE -lncurses -liconv -lintl
      -L/usr/lib/python2.5/config -l
      python2.5 -lm

      --
      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
    • Matt Wozniski
      ... I can t reproduce; the cursor winds up at the right spot for me - vim 7.2.330 in xterm, with X11-Motif GUI, and with GTK2-GNOME gui. What are your
      Message 2 of 6 , Mar 10, 2010
        On Wed, Mar 10, 2010 at 7:29 PM, SungHyun Nam <goweol@...> wrote:
        > Hello,
        >
        > With the attached files (vimrc and mb.txt), if I open the mb.txt
        > and just type A,
        >    gvim -u vimrc -U NONE --noplugin mb.txt
        >    A,
        >
        > Now, I should saw (X = cursor):
        >    ....aaaa,X
        > But, I saw
        >    ....aaaa, X
        >
        > It occurs on 3 different versions of gvim,
        > win32/cygwin-gtk2/linux-gtk2.  I included cygwin-gtk2 version info
        > below.

        I can't reproduce; the cursor winds up at the right spot for me - vim
        7.2.330 in xterm, with X11-Motif GUI, and with GTK2-GNOME gui. What
        are your encoding settings during that test case?

        :set enc? fenc? tenc?

        ~Matt

        --
        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
      • winterTTr
        ... Yes, i can reproduce some of this. If i just press A , the position is one character after the right position. like : aaaaa X But after i press , , it
        Message 3 of 6 , Mar 10, 2010
          On Thu, Mar 11, 2010 at 8:29 AM, SungHyun Nam <goweol@gmail.com> wrote:
          Hello,

          With the attached files (vimrc and mb.txt), if I open the mb.txt
          and just type A,
             gvim -u vimrc -U NONE --noplugin mb.txt
             A,

          Now, I should saw (X = cursor):
             ....aaaa,X
          But, I saw
             ....aaaa, X

          It occurs on 3 different versions of gvim,
          win32/cygwin-gtk2/linux-gtk2.  I included cygwin-gtk2 version info
          below.

          Yes, i can reproduce some of this.
          If i just press "A", the position is one character after the right position.
          like :  aaaaa X
          But after i press "," , it turns out to be right.
          like :  aaaaa,X

          VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar  4 2010 13:37:29)
          MS-Windows 32-bit GUI version with OLE support
          Included patches: 1-385
          Compiled by wanghdon@AP
          Big version with 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 +float +folding -footer +gettext/dyn -hangul_input +iconv/dyn
          +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname
          +mouse +mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript
          +printer -profile +python/dyn +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline
           -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl -tgetent -termresponse +textobjects +title +toolbar
          +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup
          -xfontset -xim -xterm_save -xpm_w32


           

          Thanks,
          namsh

          :ver
          VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 11 2010 08:56:42)
          Included patches: 1-394
          Compiled by namsh@namsh
          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
          +float +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_sysmouse +mouse_xterm +multi_byte
          +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript
          +printer -profile +python +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: "/opt/share/vim"
          Compilation: gcc-4 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include
          /gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
          -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/
          usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -O2 -m
          arch=i686 -fno-strict-aliasing -pipe -D_FORTIFY_SOURCE=1 -I/usr/include/pyth
          on2.5
          Linking: gcc-4   -L/usr/local/lib -o vim.exe   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk
          -1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lgio-2.0 -lXinerama -lXi -lXrandr -lXcur
          sor -lXcomposite -lXdamage -lpangoft2-1.0 -lXext -lXfixes -lcairo -lpixman-1 -lg
          litz -lpng12 -lxcb-render-util -lXrender -lxcb-render -lxcb -lXau -lpango-1.0 -l
          fontconfig -lexpat -lfreetype -lz -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl
          -lXt -lX11 -lSM -lICE -lncurses -liconv -lintl -L/usr/lib/python2.5/config -l
          python2.5 -lm

          --
          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 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
        • Dominique Pellé
          ... I can reproduce it too with at least Vim-7.2.394 or Vim-7.2.245 in the gnome-terminal and in xterm, as well as with gVim GTK 2 on Linux. But I can only
          Message 4 of 6 , Mar 10, 2010
            SungHyun Nam wrote:

            > Hello,
            >
            > With the attached files (vimrc and mb.txt), if I open the mb.txt
            > and just type A,
            >    gvim -u vimrc -U NONE --noplugin mb.txt
            >    A,
            >
            > Now, I should saw (X = cursor):
            >    ....aaaa,X
            > But, I saw
            >    ....aaaa, X
            >
            > It occurs on 3 different versions of gvim,
            > win32/cygwin-gtk2/linux-gtk2.  I included cygwin-gtk2 version info
            > below.
            >
            > Thanks,
            > namsh
            >
            > :ver
            > VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 11 2010 08:56:42)
            > Included patches: 1-394


            I can reproduce it too with at least Vim-7.2.394 or Vim-7.2.245
            in the gnome-terminal and in xterm, as well as with gVim GTK 2
            on Linux. But I can only reproduce it with some values of 'colums'.
            I can for example reproduce it with 50, 51, 77, 78, 79, 80, 81,
            or 82 columns. But I can't reproduce it with for example 52, 75,
            76, 83 or 84 columns.

            So to be able to reproduce it, you may have to add
            "set columns=80" to the vimrc sample file:

            $ cat vimrc
            set columns=80 tw=0 nowrap listchars+=extends:>,precedes:<
            sidescroll=1 fencs=utf-8

            Additionally, if you also put "set list" in the vimrc, you can
            see the cursor after $ (which marks the end of the line) when
            pressing A, (I would expect the cursor to be on the position
            of the $ character).

            'enc' is set to utf-8.

            Cheers
            -- Dominique

            --
            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
          • Matt Wozniski
            ... Aha, I can reproduce after dropping the number of columns to 80, in all 3 environments that I had previously tested. That was the missing element. Is
            Message 5 of 6 , Mar 10, 2010
              2010/3/10 Dominique Pellé <dominique.pelle@...>:
              > SungHyun Nam wrote:
              >
              >> Hello,
              >>
              >> With the attached files (vimrc and mb.txt), if I open the mb.txt
              >> and just type A,
              >>    gvim -u vimrc -U NONE --noplugin mb.txt
              >>    A,
              >>
              >> Now, I should saw (X = cursor):
              >>    ....aaaa,X
              >> But, I saw
              >>    ....aaaa, X
              >>
              >> It occurs on 3 different versions of gvim,
              >> win32/cygwin-gtk2/linux-gtk2.  I included cygwin-gtk2 version info
              >> below.
              >>
              >> Thanks,
              >> namsh
              >>
              >> :ver
              >> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 11 2010 08:56:42)
              >> Included patches: 1-394
              >
              >
              > I can reproduce it too with at least Vim-7.2.394 or Vim-7.2.245
              > in the gnome-terminal and in xterm, as well as with gVim GTK 2
              > on Linux. But I can only reproduce it with some values of 'colums'.
              > I can for example reproduce it with 50, 51, 77, 78, 79, 80, 81,
              > or 82 columns. But I can't reproduce it with for example 52, 75,
              > 76, 83 or 84 columns.
              >
              > So to be able to reproduce it, you may have to add
              > "set columns=80" to the vimrc sample file:
              >
              > $ cat vimrc
              > set columns=80 tw=0 nowrap listchars+=extends:>,precedes:<
              > sidescroll=1 fencs=utf-8

              Aha, I can reproduce after dropping the number of columns to 80, in
              all 3 environments that I had previously tested. That was the missing
              element. Is this something related to a doublewide character being
              scrolled offscreen by one cell?

              ~Matt

              --
              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
            • Dominique Pellé
              ... This bug happens because the :set listchars=precedes:... character printed on the left of the line is interfering with the
              Message 6 of 6 , Apr 10, 2010
                SungHyun Nam wrote:

                > Hello,
                >
                > With the attached files (vimrc and mb.txt), if I open the mb.txt
                > and just type A,
                >    gvim -u vimrc -U NONE --noplugin mb.txt
                >    A,
                >
                > Now, I should saw (X = cursor):
                >    ....aaaa,X
                > But, I saw
                >    ....aaaa, X
                >
                > It occurs on 3 different versions of gvim,
                > win32/cygwin-gtk2/linux-gtk2.  I included cygwin-gtk2 version info
                > below.
                >
                > Thanks,
                > namsh


                This bug happens because the ':set listchars=precedes:...' character
                printed on the left of the line is interfering with the '<' character
                also printed on the left of the line when a double-width char is
                partially present on the left of the window.

                Another consequence of this bug, is that columns
                in different lines can be displayed misaligned.

                Example:

                1) Load misaligned.txt attached file (utf-8 file):

                vim -u NONE misalign.txt

                2) Type Ex command:

                :set nu columns=80 tw=0 nowrap listchars=precedes:@ sidescroll=1
                enc=utf-8 fenc=utf-8

                3) Scroll horizontally in command mode with zl and zh

                4) Observe that while scrolling horizontally, vertical
                alignment of columns is not preserved.

                See screenshots before and after scrolling with zl:

                http://dominique.pelle.free.fr/pic/misaligned-1.png (OK)
                http://dominique.pelle.free.fr/pic/misaligned-2.png (BAD!)

                Notice that not only line 4 is not aligned vertically with
                other lines in second screenshot, but the '<' character
                displayed at line 3 should not be there since no
                double-width multi-byte char is truncated at line 3!

                So given these lines in buffer...

                abcdefghijklmnopqrstuvwxyz
                한cde한h한klmnopqrstuvwxyz
                a한defg한jklmnopqrstuvwxyz

                after scrolling horizontally, Vim-7.2.411 currently displays:

                @cdefghijklmnopqrstuvwxyz
                <cde한h한klmnopqrstuvwxyz
                @defg한jklmnopqrstuvwxyz

                I think that Vim should display this (vertically aligned):

                @cdefghijklmnopqrstuvwxyz
                @cde한h한klmnopqrstuvwxyz
                @<defg한jklmnopqrstuvwxyz


                Looking at the code, it's unclear to me how to implement it.
                win_line() function is quite complicated. The '<' char and '@'
                char (listchar=precedes:@) are printed in screen.c around those
                locations:

                screen.c:

                3872 /* If a double-width char doesn't fit at the left side display
                3873 * a '<' in the first column. */
                3874 if (n_skip > 0 && mb_l > 1)
                3875 {
                3876 n_extra = 1;
                3877 c_extra = '<';

                ....

                4326 /*
                4327 * Handle the case where we are in column 0 but not on the first
                4328 * character of the line and the user wants us to show us a
                4329 * special character (via 'listchars' option "precedes:<char>".
                4330 */
                4331 if (lcs_prec_todo != NUL
                4332 && (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
                4333 #ifdef FEAT_DIFF
                4334 && filler_todo <= 0
                4335 #endif
                4336 && draw_state > WL_NR
                4337 && c != NUL)
                4338 {
                4339 c = lcs_prec;
                4340 lcs_prec_todo = NUL;
                4341 #ifdef FEAT_MBYTE
                4342 mb_c = c;

                -- Dominique

                --
                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

                To unsubscribe, reply using "remove me" as the subject.
              Your message has been successfully submitted and would be delivered to recipients shortly.
              »
              «