forked from aniani/vim
patch 9.1.0667: Some other options reset curswant unnecessarily when set
Problem: Some other options reset curswant unnecessarily when set. (Andrew Haust) Solution: Don't reset curswant when setting 'comments', 'commentstring' or 'define' (zeertzjq) fixes: #15462 closes: #15467 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
9c4b2462bb
commit
b026a293b1
@@ -621,13 +621,12 @@ static struct vimoption options[] =
|
|||||||
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
|
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
|
||||||
(char_u *)&Columns, PV_NONE, NULL, NULL,
|
(char_u *)&Columns, PV_NONE, NULL, NULL,
|
||||||
{(char_u *)80L, (char_u *)0L} SCTX_INIT},
|
{(char_u *)80L, (char_u *)0L} SCTX_INIT},
|
||||||
{"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA
|
{"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
|
||||||
|P_NODUP|P_CURSWANT,
|
|
||||||
(char_u *)&p_com, PV_COM, did_set_comments, NULL,
|
(char_u *)&p_com, PV_COM, did_set_comments, NULL,
|
||||||
{(char_u *)"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-",
|
{(char_u *)"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-",
|
||||||
(char_u *)0L}
|
(char_u *)0L}
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
{"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
|
{"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF,
|
||||||
#ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
(char_u *)&p_cms, PV_CMS, did_set_commentstring, NULL,
|
(char_u *)&p_cms, PV_CMS, did_set_commentstring, NULL,
|
||||||
{(char_u *)"/* %s */", (char_u *)0L}
|
{(char_u *)"/* %s */", (char_u *)0L}
|
||||||
@@ -801,7 +800,7 @@ static struct vimoption options[] =
|
|||||||
{"debug", NULL, P_STRING|P_VI_DEF,
|
{"debug", NULL, P_STRING|P_VI_DEF,
|
||||||
(char_u *)&p_debug, PV_NONE, did_set_debug, expand_set_debug,
|
(char_u *)&p_debug, PV_NONE, did_set_debug, expand_set_debug,
|
||||||
{(char_u *)"", (char_u *)0L} SCTX_INIT},
|
{(char_u *)"", (char_u *)0L} SCTX_INIT},
|
||||||
{"define", "def", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
|
{"define", "def", P_STRING|P_ALLOCED|P_VI_DEF,
|
||||||
#ifdef FEAT_FIND_ID
|
#ifdef FEAT_FIND_ID
|
||||||
(char_u *)&p_def, PV_DEF, NULL, NULL,
|
(char_u *)&p_def, PV_DEF, NULL, NULL,
|
||||||
{(char_u *)"^\\s*#\\s*define", (char_u *)0L}
|
{(char_u *)"^\\s*#\\s*define", (char_u *)0L}
|
||||||
|
@@ -322,6 +322,7 @@ func Test_set_options_keep_col()
|
|||||||
normal j
|
normal j
|
||||||
set invhlsearch spell spelllang=en,cjk spelloptions=camel textwidth=80
|
set invhlsearch spell spelllang=en,cjk spelloptions=camel textwidth=80
|
||||||
set cursorline cursorcolumn cursorlineopt=line colorcolumn=+1 winfixbuf
|
set cursorline cursorcolumn cursorlineopt=line colorcolumn=+1 winfixbuf
|
||||||
|
set comments=:# commentstring=#%s define=function
|
||||||
set background=dark
|
set background=dark
|
||||||
set background=light
|
set background=light
|
||||||
normal k
|
normal k
|
||||||
@@ -329,6 +330,7 @@ func Test_set_options_keep_col()
|
|||||||
bwipe!
|
bwipe!
|
||||||
set hlsearch& spell& spelllang& spelloptions& textwidth&
|
set hlsearch& spell& spelllang& spelloptions& textwidth&
|
||||||
set cursorline& cursorcolumn& cursorlineopt& colorcolumn& winfixbuf&
|
set cursorline& cursorcolumn& cursorlineopt& colorcolumn& winfixbuf&
|
||||||
|
set comments& commentstring& define&
|
||||||
set background&
|
set background&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
667,
|
||||||
/**/
|
/**/
|
||||||
666,
|
666,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user