Skip to content

Commit ce65574

Browse files
committed
patch 8.1.0858: 'indentkeys' and 'cinkeys' defaults are different
Problem: 'indentkeys' and 'cinkeys' defaults are different. Solution: Make them the same, update docs. (close #3882)
1 parent 4b47162 commit ce65574

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

runtime/doc/indent.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ typing certain characters or commands in certain contexts. Note that this not
6060
only triggers C-indenting. When 'indentexpr' is not empty 'indentkeys' is
6161
used instead. The format of 'cinkeys' and 'indentkeys' is equal.
6262

63-
The default is "0{,0},0),:,0#,!^F,o,O,e" which specifies that indenting occurs
64-
as follows:
63+
The default is "0{,0},0),0],:,0#,!^F,o,O,e" which specifies that indenting
64+
occurs as follows:
6565

6666
"0{" if you type '{' as the first character in a line
6767
"0}" if you type '}' as the first character in a line
6868
"0)" if you type ')' as the first character in a line
69+
"0]" if you type ']' as the first character in a line
6970
":" if you type ':' after a label or case statement
7071
"0#" if you type '#' as the first character in a line
7172
"!^F" if you type CTRL-F (which is not inserted)

runtime/doc/options.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ A jump table for the options with a short description can be found at |Q_op|.
15641564
NOTE: This option is reset when 'compatible' is set.
15651565

15661566
*'cinkeys'* *'cink'*
1567-
'cinkeys' 'cink' string (default "0{,0},0),:,0#,!^F,o,O,e")
1567+
'cinkeys' 'cink' string (default "0{,0},0),0],:,0#,!^F,o,O,e")
15681568
local to buffer
15691569
{not in Vi}
15701570
{not available when compiled without the |+cindent|
@@ -4607,7 +4607,7 @@ A jump table for the options with a short description can be found at |Q_op|.
46074607

46084608

46094609
*'indentkeys'* *'indk'*
4610-
'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e")
4610+
'indentkeys' 'indk' string (default "0{,0},0),0],:,0#,!^F,o,O,e")
46114611
local to buffer
46124612
{not in Vi}
46134613
{not available when compiled without the |+cindent|

src/option.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ struct vimoption
483483
# define DEFAULT_PYTHON_VER 0
484484
#endif
485485

486+
// used for 'cinkeys' and 'indentkeys'
487+
#define INDENTKEYS_DEFAULT (char_u *)"0{,0},0),0],:,0#,!^F,o,O,e"
488+
486489
/*
487490
* options[] is initialized here.
488491
* The order of the options MUST be alphabetic for ":set all" and findoption().
@@ -757,7 +760,7 @@ static struct vimoption options[] =
757760
{"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
758761
#ifdef FEAT_CINDENT
759762
(char_u *)&p_cink, PV_CINK,
760-
{(char_u *)"0{,0},0),:,0#,!^F,o,O,e", (char_u *)0L}
763+
{INDENTKEYS_DEFAULT, (char_u *)0L}
761764
#else
762765
(char_u *)NULL, PV_NONE,
763766
{(char_u *)0L, (char_u *)0L}
@@ -1570,7 +1573,7 @@ static struct vimoption options[] =
15701573
{"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP,
15711574
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
15721575
(char_u *)&p_indk, PV_INDK,
1573-
{(char_u *)"0{,0},:,0#,!^F,o,O,e", (char_u *)0L}
1576+
{INDENTKEYS_DEFAULT, (char_u *)0L}
15741577
#else
15751578
(char_u *)NULL, PV_NONE,
15761579
{(char_u *)0L, (char_u *)0L}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@ static char *(features[]) =
783783

784784
static int included_patches[] =
785785
{ /* Add new patch number below this line */
786+
/**/
787+
858,
786788
/**/
787789
857,
788790
/**/

0 commit comments

Comments
 (0)