diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 35 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 12 | ||||
-rw-r--r-- | src/nvim/ex_cmds.lua | 5 | ||||
-rw-r--r-- | src/nvim/indent_c.c | 5 | ||||
-rw-r--r-- | src/nvim/spell.c | 10 | ||||
-rw-r--r-- | src/nvim/testdir/test3.in | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test3.ok | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 10 |
8 files changed, 76 insertions, 17 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d058e6ccae..f50a215559 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -15247,16 +15247,31 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv) || (dict = argvars[0].vval.v_dict) == NULL) EMSG(_(e_invarg)); else { - curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); - curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); - curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); - curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); - curwin->w_set_curswant = FALSE; - - set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); - curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); - curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); - curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + if (dict_find(dict, (char_u *)"lnum", -1) != NULL) { + curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); + } + if (dict_find(dict, (char_u *)"col", -1) != NULL) { + curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); + } + if (dict_find(dict, (char_u *)"coladd", -1) != NULL) { + curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); + } + if (dict_find(dict, (char_u *)"curswant", -1) != NULL) { + curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); + curwin->w_set_curswant = FALSE; + } + if (dict_find(dict, (char_u *)"topline", -1) != NULL) { + set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); + } + if (dict_find(dict, (char_u *)"topfill", -1) != NULL) { + curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); + } + if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) { + curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); + } + if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) { + curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + } check_cursor(); win_new_height(curwin, curwin->w_height); diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index a8d2f5589e..3278de3561 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5644,6 +5644,18 @@ struct sign static sign_T *first_sign = NULL; static int next_sign_typenr = 1; +/* + * ":helpclose": Close one help window + */ +void ex_helpclose(exarg_T *eap) +{ + FOR_ALL_WINDOWS_IN_TAB(win, curtab) { + if (win->w_buffer->b_help) { + win_close(win, FALSE); + return; + } + } +} static char *cmds[] = { "define", diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 5cd69232aa..d5d6d39616 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -841,6 +841,11 @@ return { func='ex_help', }, { + command='helpclose', + flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR), + func='ex_helpclose', + }, + { command='helpfind', flags=bit.bor(EXTRA, NOTRLCOM), func='ex_helpfind', diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index bbc0b291dc..39ad512227 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -1545,6 +1545,7 @@ int get_c_indent(void) char_u *linecopy; pos_T *trypos; pos_T *tryposBrace = NULL; + pos_T tryposBraceCopy; pos_T our_paren_pos; char_u *start; int start_brace; @@ -2026,6 +2027,10 @@ int get_c_indent(void) } else { // We are inside braces, there is a { before this line at the position // stored in tryposBrace. + // Make a copy of tryposBrace, it may point to pos_copy inside + // find_start_brace(), which may be changed somewhere. + tryposBraceCopy = *tryposBrace; + tryposBrace = &tryposBraceCopy; trypos = tryposBrace; ourscope = trypos->lnum; start = ml_get(ourscope); diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 83dcddecd6..4759b4efa6 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -806,6 +806,7 @@ typedef struct afffile_S { unsigned af_nosuggest; // NOSUGGEST ID int af_pfxpostpone; // postpone prefixes without chop string and // without flags + bool af_ignoreextra; // IGNOREEXTRA present hashtab_T af_pref; // hashtable for prefixes, affheader_T hashtab_T af_suff; // hashtable for suffixes, affheader_T hashtab_T af_comp; // hashtable for compound flags, compitem_T @@ -4629,6 +4630,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) spin->si_nosugfile = true; } else if (is_aff_rule(items, itemcnt, "PFXPOSTPONE", 1)) { aff->af_pfxpostpone = true; + } else if (is_aff_rule(items, itemcnt, "IGNOREEXTRA", 1)) { + aff->af_ignoreextra = true; } else if ((STRCMP(items[0], "PFX") == 0 || STRCMP(items[0], "SFX") == 0) && aff_todo == 0 @@ -4692,8 +4695,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) cur_aff->ah_follows = false; // Myspell allows extra text after the item, but that might - // mean mistakes go unnoticed. Require a comment-starter. - if (itemcnt > lasti && *items[lasti] != '#') + // mean mistakes go unnoticed. Require a comment-starter, + // unless IGNOREEXTRA is used. Hunspell uses a "-" item. + if (itemcnt > lasti + && !aff->af_ignoreextra + && *items[lasti] != '#') smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]); if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0) diff --git a/src/nvim/testdir/test3.in b/src/nvim/testdir/test3.in index 7f6d412806..42255e2019 100644 --- a/src/nvim/testdir/test3.in +++ b/src/nvim/testdir/test3.in @@ -464,6 +464,14 @@ label: if (asdf && asdfasdf } +{ +for ( int i = 0; + i < 10; i++ ) +{ +} + i = 0; +} + class bob { int foo() {return 1;} diff --git a/src/nvim/testdir/test3.ok b/src/nvim/testdir/test3.ok index 0d0e76fce4..e75de0ffa3 100644 --- a/src/nvim/testdir/test3.ok +++ b/src/nvim/testdir/test3.ok @@ -452,6 +452,14 @@ label: if (asdf && asdfasdf } +{ + for ( int i = 0; + i < 10; i++ ) + { + } + i = 0; +} + class bob { int foo() {return 1;} diff --git a/src/nvim/version.c b/src/nvim/version.c index c3c41673ae..2b099fba11 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -285,12 +285,12 @@ static int included_patches[] = { 455, 454, //453 NA - //452, + 452, //451, //450, - //449, + 449, //448 NA - //447, + 447, //446, //445, 444, @@ -342,7 +342,7 @@ static int included_patches[] = { //398 NA 397, //396, - //395, + 395, //394 NA //393 NA 392, @@ -426,7 +426,7 @@ static int included_patches[] = { 314, 313, 312, - //311, + 311, 310, 309, 308, |