Skip to content

Commit fd80524

Browse files
committed
updated for version 7.4.038
Problem: Using "zw" and "zg" when 'spell' is off give a confusing error message. (Gary Johnson) Solution: Ignore the error when locating the word. Explicitly mention what word was added. (Christian Brabandt)
1 parent c2cd21c commit fd80524

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/normal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5246,8 +5246,12 @@ nv_zet(cap)
52465246
{
52475247
pos_T pos = curwin->w_cursor;
52485248

5249-
/* Find bad word under the cursor. */
5249+
/* Find bad word under the cursor. When 'spell' is
5250+
* off this fails and find_ident_under_cursor() is
5251+
* used below. */
5252+
emsg_off++;
52505253
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
5254+
emsg_off--;
52515255
if (len != 0 && curwin->w_cursor.col <= pos.col)
52525256
ptr = ml_get_pos(&curwin->w_cursor);
52535257
curwin->w_cursor = pos;

src/spell.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9479,7 +9479,8 @@ spell_add_word(word, len, bad, idx, undo)
94799479
if (undo)
94809480
{
94819481
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
9482-
smsg((char_u *)_("Word removed from %s"), NameBuff);
9482+
smsg((char_u *)_("Word '%.*s' removed from %s"),
9483+
len, word, NameBuff);
94839484
}
94849485
}
94859486
fseek(fd, fpos_next, SEEK_SET);
@@ -9525,7 +9526,7 @@ spell_add_word(word, len, bad, idx, undo)
95259526
fclose(fd);
95269527

95279528
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
9528-
smsg((char_u *)_("Word added to %s"), NameBuff);
9529+
smsg((char_u *)_("Word '%.*s' added to %s"), len, word, NameBuff);
95299530
}
95309531
}
95319532

@@ -10135,7 +10136,7 @@ spell_check_sps()
1013510136
}
1013610137

1013710138
/*
10138-
* "z?": Find badly spelled word under or after the cursor.
10139+
* "z=": Find badly spelled word under or after the cursor.
1013910140
* Give suggestions for the properly spelled word.
1014010141
* In Visual mode use the highlighted word as the bad word.
1014110142
* When "count" is non-zero use that suggestion.

src/version.c

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

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
38,
741743
/**/
742744
37,
743745
/**/

0 commit comments

Comments
 (0)