0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 9.1.0114: Setting some options may change curswant

Problem:  Setting some options changes curswant unnecessarily.
Solution: Add a P_HLONLY flag that prevents changing curswant.
          (zeertzjq)

closes: #14044

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-02-18 09:33:54 +01:00
committed by Christian Brabandt
parent 79230f027a
commit fcaed6a70f
6 changed files with 40 additions and 24 deletions

View File

@@ -312,18 +312,23 @@ func Test_gd_string_only()
call XTest_goto_decl('gd', lines, 5, 10)
endfunc
" Check that setting 'cursorline' does not change curswant
func Test_cursorline_keep_col()
" Check that setting some options does not change curswant
func Test_set_options_keep_col()
new
call setline(1, ['long long long line', 'short line'])
normal ggfi
let pos = getcurpos()
normal j
set cursorline
set invhlsearch spell spelllang=en,cjk spelloptions=camel textwidth=80
set cursorline cursorcolumn cursorlineopt=line colorcolumn=+1
set background=dark
set background=light
normal k
call assert_equal(pos, getcurpos())
bwipe!
set nocursorline
set hlsearch& spell& spelllang& spelloptions& textwidth&
set cursorline& cursorcolumn& cursorlineopt& colorcolumn&
set background&
endfunc
func Test_gd_local_block()