1
0
forked from aniani/vim

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

@@ -402,7 +402,7 @@ static struct vimoption options[] =
{"autowriteall","awa", P_BOOL|P_VI_DEF,
(char_u *)&p_awa, PV_NONE, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"background", "bg", P_STRING|P_VI_DEF|P_RCLR,
{"background", "bg", P_STRING|P_VI_DEF|P_RCLR|P_HLONLY,
(char_u *)&p_bg, PV_NONE, did_set_background, expand_set_background,
{
#if (defined(MSWIN)) && !defined(FEAT_GUI)
@@ -609,7 +609,7 @@ static struct vimoption options[] =
{"cmdwinheight", "cwh", P_NUM|P_VI_DEF,
(char_u *)&p_cwh, PV_NONE, NULL, NULL,
{(char_u *)7L, (char_u *)0L} SCTX_INIT},
{"colorcolumn", "cc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN,
{"colorcolumn", "cc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN|P_HLONLY,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CC, did_set_colorcolumn, NULL,
#else
@@ -774,21 +774,21 @@ static struct vimoption options[] =
{"cursorbind", "crb", P_BOOL|P_VI_DEF,
(char_u *)VAR_WIN, PV_CRBIND, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWINONLY,
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN|P_HLONLY,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUC, NULL, NULL,
#else
(char_u *)NULL, PV_NONE, NULL, NULL,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWINONLY,
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN|P_HLONLY,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUL, NULL, NULL,
#else
(char_u *)NULL, PV_NONE, NULL, NULL,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"cursorlineopt", "culopt", P_STRING|P_VI_DEF|P_RWIN|P_ONECOMMA|P_NODUP,
{"cursorlineopt", "culopt", P_STRING|P_VI_DEF|P_RWIN|P_HLONLY|P_ONECOMMA|P_NODUP,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CULOPT,
did_set_cursorlineopt, expand_set_cursorlineopt,
@@ -1304,7 +1304,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE, NULL, NULL,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"hlsearch", "hls", P_BOOL|P_VI_DEF|P_VIM|P_RALL,
{"hlsearch", "hls", P_BOOL|P_VI_DEF|P_VIM|P_RALL|P_HLONLY,
#if defined(FEAT_SEARCH_EXTRA)
(char_u *)&p_hls, PV_NONE, did_set_hlsearch, NULL,
#else
@@ -2350,14 +2350,14 @@ static struct vimoption options[] =
{"sourceany", NULL, P_BOOL|P_VI_DEF,
(char_u *)NULL, PV_NONE, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN,
{"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN|P_HLONLY,
#ifdef FEAT_SPELL
(char_u *)VAR_WIN, PV_SPELL, did_set_spell, NULL,
#else
(char_u *)NULL, PV_NONE, NULL, NULL,
#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF,
{"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_HLONLY,
#ifdef FEAT_SPELL
(char_u *)&p_spc, PV_SPC, did_set_spellcapcheck, NULL,
{(char_u *)"[.?!]\\_[\\])'\" ]\\+", (char_u *)0L}
@@ -2377,7 +2377,7 @@ static struct vimoption options[] =
#endif
SCTX_INIT},
{"spelllang", "spl", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA
|P_RBUF|P_EXPAND,
|P_RBUF|P_HLONLY|P_EXPAND,
#ifdef FEAT_SPELL
(char_u *)&p_spl, PV_SPL, did_set_spelllang, NULL,
{(char_u *)"en", (char_u *)0L}
@@ -2387,7 +2387,7 @@ static struct vimoption options[] =
#endif
SCTX_INIT},
{"spelloptions", "spo", P_STRING|P_ALLOCED|P_VI_DEF
|P_ONECOMMA|P_NODUP|P_RBUF,
|P_ONECOMMA|P_NODUP|P_RBUF|P_HLONLY,
#ifdef FEAT_SPELL
(char_u *)&p_spo, PV_SPO, did_set_spelloptions, expand_set_spelloptions,
{(char_u *)"", (char_u *)0L}
@@ -2596,7 +2596,7 @@ static struct vimoption options[] =
(char_u *)FALSE,
#endif
(char_u *)0L} SCTX_INIT},
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF|P_HLONLY,
(char_u *)&p_tw, PV_TW, did_set_textwidth, NULL,
{(char_u *)0L, (char_u *)0L} SCTX_INIT},
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,