This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 54551 - Improper autocmd in system vimrc
Improper autocmd in system vimrc
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: vim (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-10-11 22:34 EDT by brian medley
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-10-11 22:43:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description brian medley 2001-10-11 22:34:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.7 [en] (Win98; U)

Description of problem:
This system vimrc has a subtle bug.  It has to do with this line:
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost * if line("'\"") | exe "'\"" | endif

It should be:
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif

The original will give seemingly random error messages.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
step 1
- vim a (where 'a' is a new file)
- make it look like this:
    1
    2
    3
- :3
- :wq
 
step 2
- gvim a
- :3normal dd
- :w
- :bd (note, *don't* exit this gvim)
 
step 3
- vim a (shows error)

Actual Results:  An error from vim.

Expected Results:  No error.

Additional info:
Comment 1 brian medley 2001-10-11 22:42:59 EDT
I forgot to specify.  This is with the following packages installed (from
ftp.rawhide.com):

vim-enhanced-6.0-2
vim-common-6.0-2
vim-minimal-6.0-2
vim-X11-6.0-2
Comment 2 Bernhard Rosenkraenzer 2001-10-23 10:34:36 EDT
Thanks, changed. (6.0-3)

Note You need to log in before you can comment on or make changes to this bug.