tagbar icon indicating copy to clipboard operation
tagbar copied to clipboard

Opening a file places cursor at top of file, overriding loadview autocmd

Open evanthegrayt opened this issue 1 year ago • 0 comments

I have the following lines in my vimrc.

autocmd BufWritePost * if !(empty(expand('%')) || &buftype =~ 'nofile') | mkview | endif
autocmd BufReadPost * if !(empty(expand('%')) || &buftype =~ 'nofile') | silent loadview | endif

These lines load my views, which should allow me to open a file and place the cursor on the same line as the last time I edited the file. When I install this plugin, the autocmd triggers, but my cursor is still placed at the top of the file. I've also tried the restore_view plugin, and I get the same result.

After using git bisect, I found that the bug started in this commit, way back from 2011. It appears to be due to another autocmd being triggered on the SessionLoadPost event.

evanthegrayt avatar Oct 19 '22 18:10 evanthegrayt