From 9f8a5cd0220eecadb4e13cadc96b448bb8ea654b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 10 Aug 2024 16:05:30 +0800 Subject: [PATCH] vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set (#30020) Problem: Some other options reset curswant unnecessarily when set. (Andrew Haust) Solution: Don't reset curswant when setting 'comments', 'commentstring' or 'define' (zeertzjq) fixes: vim/vim#15462 closes: vim/vim#15467 https://github.com/vim/vim/commit/b026a293b1e9d7a30f7717e256fe5f7f1dfa20d7 (cherry picked from commit 0ec43cb4b56673d661d6bd1e39836d0a891be5cd) --- src/nvim/options.lua | 3 --- test/old/testdir/test_goto.vim | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nvim/options.lua b/src/nvim/options.lua index e9984ef8b0..58f1bbbf63 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1310,7 +1310,6 @@ return { ]=], full_name = 'comments', list = 'onecomma', - redraw = { 'curswant' }, scope = { 'buffer' }, short_desc = N_('patterns that can start a comment line'), tags = { 'E524', 'E525' }, @@ -1328,7 +1327,6 @@ return { add markers for folding, see |fold-marker|. ]=], full_name = 'commentstring', - redraw = { 'curswant' }, scope = { 'buffer' }, short_desc = N_('template for comments; used for fold marker'), tags = { 'E537' }, @@ -1956,7 +1954,6 @@ return { < ]=], full_name = 'define', - redraw = { 'curswant' }, scope = { 'global', 'buffer' }, short_desc = N_('pattern to be used to find a macro definition'), type = 'string', diff --git a/test/old/testdir/test_goto.vim b/test/old/testdir/test_goto.vim index 964d8d8083..5ec3f540dc 100644 --- a/test/old/testdir/test_goto.vim +++ b/test/old/testdir/test_goto.vim @@ -322,6 +322,7 @@ func Test_set_options_keep_col() normal j set invhlsearch spell spelllang=en,cjk spelloptions=camel textwidth=80 set cursorline cursorcolumn cursorlineopt=line colorcolumn=+1 winfixbuf + set comments=:# commentstring=#%s define=function set background=dark set background=light normal k @@ -329,6 +330,7 @@ func Test_set_options_keep_col() bwipe! set hlsearch& spell& spelllang& spelloptions& textwidth& set cursorline& cursorcolumn& cursorlineopt& colorcolumn& winfixbuf& + set comments& commentstring& define& set background& endfunc