On 2013-02-06 Wednesday at 18:24 +0100 Bram Moolenaar wrote: > > Roland Eggner wrote: > > > :mksession writes wrong column number of cursor position in presence of > > multibyte characters. > > > > I have been using vim-7.3.135 with this patch applied for several > > months … it works for me: > > I do not see the problem. How to reproduce? > > Your patch can't be right, the "l" command moves over characters, not > columns.
Session files created with :mksession restore cursor line and column, as long as there is no multibyte character between start of line and cursor. Otherwise, without my patch restored column is off by the difference between character position and byte position counted from start of line. With my patch applied, cursor line and column is restored correctly, with and without multibyte characters, with and without changing of options fileencoding or binary, even with files preprocessed by BufRead autocommands gzip -dc, bzip -dc, xz -dc, pdftotext, elinks -dump, antiword, … which I find pretty cool, use and enjoy it nearly every day. My patch works for me with this vim options: :set --- Optionen --- autoindent background=dark backupdir=. cursorline foldmethod=expr hlsearch laststatus=2 modelines=1 scroll=43 shortmess=aoO showmatch splitright tabpagemax=16 whichwrap=b,s,<,> wrapmargin=6 autowrite backup cmdwinheight=60 filetype=conf helplang=de incsearch lazyredraw pastetoggle=<F10> scrolloff=99 showbreak=>> sidescrolloff=6 nostartofline tabstop=48 winwidth=1 nowrapscan autowriteall backupcopy=yes cursorcolumn foldlevel=2 history=6000 keywordprg=:he linebreak patchmode=.orig secure showcmd splitbelow syntax=conf ttyfast nowrap backspace=indent,eol,start breakat= ^I!@*-+;:,./?"'>)]} cpoptions=aABceEFJs diffopt=filler,vertical,iwhite directory=~/.vim/swap fileencoding=utf-8 fileencodings=ucs-bom,utf-8,default,latin1 foldexpr=getline(v:lnum-1)=~'^$'&&getline(v:lnum)=~'^##'?'>1':getline(v:lnum)=~'\t20[01][0-9]-[01][0-9]'?'>2':2 formatoptions=tcrqo1aw2 isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=,32,34,40,41,58,123,125 iskeyword=@,48-57,_,192-255,126 listchars=eol:$,tab:>→,trail:$,extends:>,precedes:<,nbsp:* runtimepath=~/.vim,/etc/vim,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,~/.vim/after scrollopt=ver,jump,hor sessionoptions=folds,globals,localoptions,help,tabpages statusline=%!StatuslineString() viminfo='6000,s20000,%,n/home/****/.vim/.viminfo.bash wildmode=longest,full :setlocal --- Werte lokaler Optionen --- autoindent cursorcolumn define= filetype=conf foldmethod=expr include= linebreak path= syntax=conf tags= wrapmargin=6 --autoread cursorline errorformat= foldlevel=2 grepprg= keywordprg= makeprg= scroll=43 tabstop=48 nowrap fileencoding=utf-8 foldexpr=getline(v:lnum-1)=~'^$'&&getline(v:lnum)=~'^##'?'>1':getline(v:lnum)=~'\t20[01][0-9]-[01][0-9]'?'>2':2 formatoptions=tcrqo1aw2 iskeyword=@,48-57,_,192-255,126 -- Roland Eggner
pgpyeoznmuhfB.pgp
Description: PGP signature