> > Just to be clear... The version in my .vimrc appears to be correct...
>
> > autocmd BufReadPost *
> > \ if line("'\"") > 0 && line("'\"") <= line("$") |
> > \ exe "normal g`\"" |
> > \ endif
>
> > ...yet I still experience the issue.
>
> In your own .vimrc? or in a system-wide vimrc? Maybe there are two
> commands being processed.
>
> Either way, do you see anything odd in the output of:
>
> :au BufReadPost *
There is only my own .vimrc, and it matches the output of BufReadPost:
--- Auto-Commands ---
filetypedetect BufRead
* if !did_filetype() && expand("<amatch>") !~
g:ft_ignore_pat | runtime! scripts.vim | endif
* if !did_filetype() && expand("<amatch>") !~
g:ft_ignore_pat && (getline(1) =~ '^#' || getline(2) =~ '^#' ||
getline(3) =~ '^#'^I|| getline(4) =~ '^#' || getline(5) =~ '^#') |
setf conf | endif
BufRead
* if line("'\"") > 0 && line("'\"") <= line("$") | exe
"normal g`\"" | endif
I know this autocommand is correct, not only by inspection, but also
because the cursor position jumps to the end of line 1 when I do...
:doau BufReadPost *
...after the file has loaded. I loaded the file with verbose=9 to see
whether there were something that might be clobbering the position,
but didn't notice anything suspicious. Here's the output, beginning
with the cursor restoration autocommand (<<< >>> comments
interspersed):
Executing BufRead Auto commands for "*"
autocommand if line("'\"") > 0 && line("'\"") <= line("$") | exe
"normal g`\"" | endif
<<< I verified with echomsg that col("'\"") is correct at this point
>>>
Executing BufEnter Auto commands for "*"
autocommand call s:checkForBrowse(expand("<amatch>"))
Executing BufEnter Auto commands for "*"
autocommand silent call <SID>MRUPush()
Executing CursorMoved Auto commands for "*"
autocommand call s:Highlight_Matching_Pair()
<<< Cursor is at beginning of line at this point >>>
<<< However, doing...
doau BufReadPost *
...at this point moves the cursor to the end of the line
>>>
Brett Stahlman
>
> Maybe something else is resetting the position as well.
>
> --
> Best,
> Ben- Hide quoted text -
>
> - Show quoted text -
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
No comments:
Post a Comment