aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/helphelp.txt3
-rw-r--r--runtime/doc/index.txt1
-rw-r--r--runtime/doc/spell.txt11
-rwxr-xr-xscripts/vim-patch.sh2
-rw-r--r--src/nvim/eval.c35
-rw-r--r--src/nvim/ex_cmds.c12
-rw-r--r--src/nvim/ex_cmds.lua5
-rw-r--r--src/nvim/indent_c.c5
-rw-r--r--src/nvim/spell.c10
-rw-r--r--src/nvim/testdir/test3.in8
-rw-r--r--src/nvim/testdir/test3.ok8
-rw-r--r--src/nvim/version.c10
12 files changed, 92 insertions, 18 deletions
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 87f095e56d..52b61394e3 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -96,6 +96,9 @@ Help on help files *helphelp*
find a tag in a file with the same language as the
current file. See |help-translated|.
+ *:helpc* *:helpclose*
+:helpc[lose] Close one help window.
+
*:helpg* *:helpgrep*
:helpg[rep] {pattern}[@xx]
Search all help text files and make a list of lines
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 01ec37b5a0..a4d25681ca 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1242,6 +1242,7 @@ tag command action ~
|:gvim| :gv[im] start the GUI
|:hardcopy| :ha[rdcopy] send text to the printer
|:help| :h[elp] open a help window
+|:helpclose| :helpc[lose] close one help window
|:helpfind| :helpf[ind] dialog to open a help window
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|:helptags| :helpt[ags] generate help tags for a directory
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index da447e3b78..2ae0d27690 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1053,6 +1053,9 @@ this text to start with a "#" so that mistakes don't go unnoticed. Example:
SFX F 0 in [^i]n # Spion > Spionin ~
SFX F 0 nen in # Bauerin > Bauerinnen ~
+However, to avoid lots of errors in affix files written for Myspell, you can
+add the IGNOREEXTRA flag.
+
Apparently Myspell allows an affix name to appear more than once. Since this
might also be a mistake, Vim checks for an extra "S". The affix files for
Myspell that use this feature apparently have this flag. Example:
@@ -1106,6 +1109,14 @@ Specifically, the affix flags can be used for:
- CIRCUMFIX, as explained just below.
+IGNOREEXTRA *spell-IGNOREEXTRA*
+
+Normally Vim gives an error for an extra field that does not start with '#'.
+This avoids errors going unnoticed. However, some files created for Myspell
+or Hunspell may contain many entries with an extra field. Use the IGNOREEXTRA
+flag to avoid lots of errors.
+
+
CIRCUMFIX *spell-CIRCUMFIX*
The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 7c07524090..6e098dd5eb 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -29,7 +29,7 @@ if [[ ! -d ${VIM_SOURCE_DIR} ]]; then
else
echo "Updating Vim sources in '${VIM_SOURCE_DIR}'."
cd ${VIM_SOURCE_DIR}
- hg pull --update
+ hg pull --update || echo 'Could not update Vim sources.'
fi
vim_tag="v${vim_version//./-}"
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,