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

All of getpos, col, vim.current.window.cursor report wrong col number on multibyte line

Expand Messages
  • Angri
    They calculate col number counting bytes, not chars. Also :python vim.current.line and :python vim.current.buffer holds data in strings encoded in utf-8, but
    Message 1 of 1 , Dec 13, 2008
    • 0 Attachment
      They calculate col number counting bytes, not chars.

      Also :python vim.current.line and :python vim.current.buffer holds
      data in strings encoded in utf-8, but it should be python unicode
      objects, I think.

      $ LANG=en vim --version
      VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Dec 8 2008 05:09:35)
      Included patches: 1-65
      Compiled by ArchLinux
      Big version without 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 +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 +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: "/etc/vimrc"
      user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
      fall-back for $VIM: "/usr/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -
      mtune=generic -O2 -pipe -D_FORTIFY_SOURCE=1 -D_REENTRANT -
      D_GNU_SOURCE -I/usr/local/include -D_LARGEFILE_SOURCE -
      D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/core_perl/CORE -I/usr/include/
      python2.6 -pthread -I/usr/lib/ruby/1.8/x86_64-linux
      Linking: gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E -L/usr/
      local/lib -o vim -lXt -lncurses -lacl -lgpm -Wl,-E -L/usr/local/
      lib -L/usr/lib/perl5/core_perl/CORE -lperl -lutil -lc -L/usr/lib/
      python2.6/config -lpython2.6 -lutil -Xlinker -export-dynamic -Wl,-R -
      Wl,/usr/lib -L/usr/lib -lruby -lm

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