Summary: | app-editors/vim: last cursor position overridden when opening a UTF-8 file that doesn't have a BOM | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Kalon Mills <kalaxy> |
Component: | Current packages | Assignee: | Vim Maintainers <vim> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | dhp_gentoo |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Kalon Mills
2010-03-08 23:05:48 UTC
(In reply to comment #0) > In particular I think that the search function is moving the cursor after the > last cursor position BufReadPost has already run. Yes, that's exactly what's happening, good catch! > One workaround is to position this code above the last cursor position code so > that last cursor position get's run last. However I assume this would still > mess up the cursor position even if some has g:leave_my_cursor_position_alone > defined. Actually if I just change the flags of the search() function from 'w' to 'nw' ('n' meaning "do Not move the cursor"), we have the perfect solution. I didn't think this was worth a revbump which would force everyone to reinstall their current vim-core, and this bug only affects users who are not running a UTF-8 locale, so I have just fixed this in-place. (In other words, you will need to manually re-emerge app-editors/vim-core to get this fix once it hits your local rsync mirrors, or just edit /etc/vim/vimrc yourself since it's a pretty quick fix) Thanks again for the report and excellent investigation into the cause! *** Bug 321425 has been marked as a duplicate of this bug. *** |