vim hangs loading 100%

Bug #673680 reported by marbertone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: vim

vim hang and loads 100% ad libitum when closing a 6 rows-2 column file made of numbers after typing :wq

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: vim 2:7.2.330-1ubuntu4
ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Wed Nov 10 19:46:59 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
 LANG=it_IT.utf8
 SHELL=/bin/bash
 LC_NUMERIC=en_GB.UTF-8
SourcePackage: vim

Revision history for this message
marbertone (marbertone-deactivatedaccount) wrote :
Revision history for this message
James McCoy (jamessan) wrote :

If you could confirm whether this happens when starting Vim in the following ways, that should help narrow down whether this is a bug in Vim or some script that is loaded.

1) vim -u NONE -N testfile
2) vim -u NORC -N testfile
3) vim --noplugin -N testfile
4) vim -u /etc/vim/vimrc -N testfile

Also, attaching the problematic file (or another one that exhibits the same behavior if the original has sensitive information) would help attempts to reproduce the problem.

Revision history for this message
marbertone (marbertone-deactivatedaccount) wrote : Re: [Bug 673680] Re: vim hangs loading 100%

perhaps you're right.
The script I added is the following:

" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ let JumpCursorOnEdit_foo = line("'\"") |
\ let b:doopenfold = 1 |
\ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo -
1)) |
\ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
\ let b:doopenfold = 2 |
\ endif |
\ exe JumpCursorOnEdit_foo |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ exe "normal zv" |
\ if(b:doopenfold > 1) |
\ exe "+".1 |
\ endif |
\ unlet b:doopenfold |
\ endif
augroup END

which used to work under Karmic, but not anymore under Maverick. I will
try that, even if I can assure you the bug happened just two/three
times, hence I don't know with which probability I'll be able to
reproduce the bug.

Anyway... how to tell Vim to remember cursor position?
Cheers,
Mario Alberto

Il 12/11/2010 22:21, James Vega ha scritto:
> If you could confirm whether this happens when starting Vim in the
> following ways, that should help narrow down whether this is a bug in
> Vim or some script that is loaded.
>
> 1) vim -u NONE -N testfile
> 2) vim -u NORC -N testfile
> 3) vim --noplugin -N testfile
> 4) vim -u /etc/vim/vimrc -N testfile
>
> Also, attaching the problematic file (or another one that exhibits the
> same behavior if the original has sensitive information) would help
> attempts to reproduce the problem.
>

Revision history for this message
James McCoy (jamessan) wrote :

Vim will remember the cursor position as long as ~/.viminfo is writable by your user. The ' setting in your 'viminfo' option is limiting Vim to only remember marks for the last 10 files, though.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.