:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 22 2017 06:37:43)
Included patches: 1-983
Compiled by dza@adrafinil
tag: v8.0.0983
(3f9a1ff)
An offending legend of an autocmd did this in my self-compiled git-fetched vim. Not in Debian (stretch) and Ubuntu (xenial) provided Vim 7.4 included patches up to 8.x (Interesting way of explaining a version I hope to know someday why)
vim run as
vim --noplugin
so we can test our autocmd in action
:scriptnames
1: ~/.vimrc
:autocmd
:autocmd
--- Auto-Commands ---
vimrc BufRead
* if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"
" | endif
.vimrc
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
steps to reproduce
:write
<C-x>
proof
append into .vimrc also
map <C-x> <nop>
expect: no decrement
also tried
let loaded_matchparen = 1
set noshowmatch
exe "normal! g'\""
with echo 'test'
just to check nothing else is affecting it.cheers and thanks for many good years.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
I understand that you can't immediately recognize it- me and igemnace from #vim were puzzled as well.
Hello Bram. Like described in my issue the only .vimrc I have is what I embedded here
augroup vimrc autocmd!
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
augroup END
Removing that would make the symptom go away because the offending code is now not executed at all. But the behaviour of normal ! g'"
is different from different versions with no .vim or .vimrc at all.
Also Debian/Ubuntu 7.4 package were tested and did not have the same symptom nor do I remember ever having a similar problem.
If you have any commands I should run to verify please respond. But as I say - I have no sourced files whatsoever besides that embedded piece of vimrc.
Did you try to reproduce it given what I put here?
I cannot reproduce using vim -u yoursamplevimrc --noplugin file.txt
. (I also added a set nocp
to the top of your sample vimrc because without that vim doesn't write a .viminfo and g'
doesn't jump anywhere).
I see vim jumping to the 1st column of the line where I left it, which starts with a number -- but the number is never decremented.
I'm on Ubuntu 17.04, testing vim 8.0.987 in gnome-terminal.
can't reproduce either. Does it happen in terminal, gui? please be specific, what terminal, what is your $TERM setting, Can you please also show the output of :set all
@mgedmin you are correct.
I made some progress on this.
This is consistently reproducible for me in mintty specifically. It happens in files with numbers primarily if you leave them on a number.
What events gets translated in a terminal-emulator when you execute g'"
in terminal would be very helpful in this case.
@chrisbra issue changed when I found out mintty could have something to do with it. However vim -u nocompatiblecursorposition --noplugin .ssh/config
and :set all
contains:
--- Options --- aleph=224 fileencoding= maxmem=8364242 nosplitbelow noarabic fileformat=unix maxmemtot=8364242 nosplitright arabicshape nofileignorecase menuitems=25 startofline noallowrevins filetype= modeline statusline= noaltkeymap fixendofline modelines=5 suffixesadd= ambiwidth=single nofkmap modifiable swapfile noautochdir foldclose= nomodified swapsync=fsync noautoindent foldcolumn=0 more switchbuf= noautoread foldenable mouse= synmaxcol=3000 noautowrite foldexpr=0 nomousefocus syntax= noautowriteall foldignore=# mousehide tabline= background=dark foldlevel=0 mousemodel=extend tabpagemax=10 backspace= foldlevelstart=-1 mousetime=500 tabstop=8 nobackup foldmethod=manual nonumber tagbsearch backupcopy=auto foldminlines=1 numberwidth=4 tagcase=followic backupext=~ foldnestmax=20 omnifunc= taglength=0 backupskip=/tmp/* formatexpr= operatorfunc= tagrelative balloondelay=600 formatoptions=tcq nopaste tagstack noballooneval formatprg= pastetoggle= notermbidi balloonexpr= fsync patchexpr= termencoding= belloff= nogdefault patchmode= notermguicolors nobinary guifont= nopreserveindent noterse nobomb guifontwide= previewheight=12 textauto nobreakindent guiheadroom=50 nopreviewwindow notextmode breakindentopt= guipty printdevice= textwidth=0 browsedir=last guitablabel= printencoding= thesaurus= bufhidden= guitabtooltip= printfont=courier notildeop buflisted helpheight=20 printmbcharset= timeout buftype= helplang=en printmbfont= timeoutlen=1000 cdpath=,, nohidden printoptions= notitle cedit=^F history=50 prompt titlelen=85 charconvert= nohkmap pumheight=0 titlestring= nocindent nohkmapp pyxversion=3 nottimeout cinoptions= nohlsearch quoteescape=\ ttimeoutlen=-1 cmdheight=1 noicon noreadonly ttybuiltin cmdwinheight=7 iconstring= redrawtime=2000 ttyfast colorcolumn= noignorecase regexpengine=0 ttymouse=xterm columns=80 imactivatefunc= norelativenumber ttyscroll=999 nocompatible imactivatekey= remap undodir=. concealcursor= noimcmdline report=2 noundofile conceallevel=0 noimdisable norevins undolevels=1000 completefunc= iminsert=2 norightleft undoreload=10000 noconfirm imsearch=2 noruler updatecount=200 nocopyindent imstatusfunc= rulerformat= updatetime=4000 cpoptions=aABceFs includeexpr= scroll=5 verbose=0 cryptmethod=zip noincsearch noscrollbind verbosefile= cscopepathcomp=0 indentexpr= scrolljump=1 viminfofile= cscopeprg=cscope noinfercase scrolloff=0 virtualedit= cscopequickfix= noinsertmode nosecure novisualbell nocscoperelative isprint=@,161-255 selectmode= warn nocscopetag joinspaces shell=/bin/zsh noweirdinvert cscopetagorder=0 key= shellcmdflag=-c whichwrap=b,s nocscopeverbose keymap= shellquote= wildchar=<Tab> nocursorbind keymodel= shelltemp wildcharm=0 nocursorcolumn keywordprg=man -s shellxquote= wildignore= nocursorline langmap= shellxescape= nowildignorecase debug= langmenu= noshiftround nowildmenu nodelcombine nolangnoremap shiftwidth=8 wildmode=full dictionary= langremap noshortname wildoptions= nodiff laststatus=1 showbreak= winaltkeys=menu diffexpr= nolazyredraw noshowcmd window=23 diffopt=filler nolinebreak noshowfulltag winheight=1 nodigraph lines=24 noshowmatch nowinfixheight display= linespace=0 showmode nowinfixwidth eadirection=both nolisp showtabline=1 winminheight=1 noedcompatible nolist sidescroll=0 winminwidth=1 emoji listchars=eol:$ sidescrolloff=0 winwidth=20 encoding=utf-8 noloadplugins signcolumn=auto wrap endofline magic nosmartcase wrapmargin=0 equalalways makeef= nosmartindent wrapscan equalprg= makeencoding= nosmarttab write noerrorbells makeprg=make softtabstop=0 nowriteany esckeys matchtime=5 nospell writebackup eventignore= maxcombine=2 spellfile= writedelay=0 noexpandtab maxfuncdepth=100 spelllang=en noexrc maxmapdepth=1000 spellsuggest=best backupdir=.,~/tmp,~/ breakat= ^I!@*-+;:,./? casemap=internal,keepascii cinkeys=0{,0},0),:,0#,!^F,o,O,e cinwords=if,else,while,do,for,switch clipboard=autoselect,exclude:cons\|linux comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:- commentstring=/*%s*/ complete=.,w,b,u,t,i completeopt=menu,preview define=^\s*#\s*define directory=.,~/tmp,/var/tmp,/tmp errorfile=errors.err errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m fileencodings=ucs-bom,utf-8,default,latin1 fileformats=unix,dos fillchars=vert:|,fold:- foldmarker={{{,}}} foldopen=block,hor,mark,percent,quickfix,search,tag,undo foldtext=foldtext() formatlistpat=^\s*\d\+[\]:.)}\t ]\s* grepformat=%f:%l:%m,%f:%l%m,%f %l%m grepprg=grep -n $* /dev/null guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175 guioptions=aegimrLtT helpfile=/usr/local/share/vim/vim80/doc/help.txt highlight=8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC include=^\s*#\s*include indentkeys=0{,0},:,0#,!^F,o,O,e isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,= isident=@,48-57,_,192-255 iskeyword=@,48-57,_,192-255 lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object matchpairs=(:),{:},[:] maxmempattern=1000 mkspellmem=460000,2000,500 mouseshape=i-r:beam,s:updown,sd:udsizing,vs:leftright,vd:lrsizing,m:no,ml:up-arrow,v:rightup-arrow nrformats=bin,octal,hex packpath=~/.vim,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim80,/usr/local/share/vim/vimfiles/after,~/.vim/after paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp path=.,/usr/include,, printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error printheader=%<%f%h%m%=Page %N rightleftcmd=search runtimepath=~/.vim,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim80,/usr/local/share/vim/vimfiles/after,~/.vim/after scrollopt=ver,jump sections=SHNHH HUnhsh selection=inclusive sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize shellpipe=2>&1| tee shellredir=>%s 2>&1 shortmess=filnxtToO spellcapcheck=[.?!]\_[\])'"^I ]\+ suffixes=.bak,~,.o,.h,.info,.swp,.obj tags=./tags,./TAGS,tags,TAGS term=xterm-256color titleold=Thanks for flying Vim toolbar=icons,tooltips toolbariconsize=small ttytype=xterm-256color viewdir=~/.vim/view viewoptions=folds,options,cursor viminfo='100,<50,s10,h
term=xterm-256color
Well, is that correct for mintty? I suppose you are seeing some terminal ansi sequence, that causese it. You might try with some of the builtin terms, like :set term=builtin_ansi
or something. Check :set term=zzzzz
to see available builtin terminals. Does :set termcap
show anything suspcicious?
@chrisbra
:set termcap (from within: vim -u nocompatiblecursorposition --noplugin .ssh/config
) in a clean bash environment.
:set termcap
--- Terminal codes ---
t_AB=^[[4%p1%dm t_db= t_mr=^[[7m t_te=^[[?1049l
t_AF=^[[3%p1%dm t_DL=^[[%p1%dM t_ms=y t_ti=^[[?1049h
t_AL=^[[%p1%dL t_dl=^[[M t_nd=^[[C t_ts=^[]2;
t_al=^[[L t_EC=^G t_op=^[[39;49m t_u7=^[[6n
t_bc= t_EI= t_RB=^[]11;?^G t_ue=^[[m
t_BE=^[[?2004h t_fs=^G t_RI=^[[%p1%dC t_us=^[[4m
t_BD=^[[?2004l t_GP=^[[13t t_RS=^[P$q q^[\ t_ut=y
t_cd=^[[J t_IE=^G t_RV=^[[>c t_ve=^[[?25h
t_ce=^[[K t_IS=^[]1; t_SC=^[]12; t_vi=^[[?25l
t_cl=^[[H^[[2J t_ke=^[[?1l^[> t_se=^[[27m t_VS=^[[?12l
t_Ce= t_ks=^[[?1h^[= t_SH=^[[%p1%d q t_vs=^[[?12h
t_Co=8 t_le=^H t_SI= t_xn=y
t_CS= t_mb=^[[5m t_so=^[[7m t_xs=
t_CV= t_md=^[[1m t_SR= t_ZH=^[[3m
t_da= t_me=^[[m t_sr=^[M t_ZR=^[[23m
t_cm=^[[%i%p1%d;%p2%dH
t_Cs=^[]12;%p1%s^G
t_cs=^[[%i%p1%d;%p2%dr
t_Sb=^[[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m
t_Sf=^[[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m
t_vb=^[[?5h$<100/>^[[?5l
I believe you want me to put :set term=builtin_ansi
in the example vimrc as well. This doesn't have the same behaviour.
I don't see any particular obvious keycode. If you are really interested, you might want to compare :set termcap
output between a working terminal and the buggy terminal, and one by one try setting one of the differences.
fixed by 8.0.0993
Closed #2003.
What what whaaat!!
Awesome guys!
Will look into that commit right away!
Issue not fixed in mintty my findings are here: https://github.com/vim/vim/commit/f6d9f96b2d67327bbadd7210acc7c6028439bbcd##commitcomment-23879679
Also if you completely exclude out_str(T_CRS);
problem also goes away but breaks as well.
Excuse me for my first attempt :) not that accurate
—
Are you saying this is an old bug? I don't remember experiencing this before. I thought I could add two logs to my mintty issue mintty/wsltty#55 offending and non-offending.
Maybe he knows?
It's totally unclear why sending t_RS causes the rgb response to have an additional CTRL-X.
Do you agree this issue should remain open?
I am willing to continue experimenting with this.
Can you clarify some things for me to aid me in debugging this;
you mean 8.0.0993 did not solve it for you? I think you seem to be the only person to reproduce the issue.
BTW: perhaps you can use script to catch those response?
possibly
Released mintty 2.8.0, fixing the root cause.
thanks for noticing us.
Released mintty 2.8.0, fixing the root cause.
Yeah super nice. Thanks a lot. This was a fun ride !