Skip to content

Commit

Permalink
updated for version 7.4.038
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
brammool committed Sep 25, 2013
1 parent f211884 commit 134bf07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/normal.c
Expand Up @@ -5246,8 +5246,12 @@ nv_zet(cap)
{
pos_T pos = curwin->w_cursor;

/* Find bad word under the cursor. */
/* Find bad word under the cursor. When 'spell' is
* off this fails and find_ident_under_cursor() is
* used below. */
emsg_off++;
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
emsg_off--;
if (len != 0 && curwin->w_cursor.col <= pos.col)
ptr = ml_get_pos(&curwin->w_cursor);
curwin->w_cursor = pos;
Expand Down
7 changes: 4 additions & 3 deletions src/spell.c
Expand Up @@ -9479,7 +9479,8 @@ spell_add_word(word, len, bad, idx, undo)
if (undo)
{
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Word removed from %s"), NameBuff);
smsg((char_u *)_("Word '%.*s' removed from %s"),
len, word, NameBuff);
}
}
fseek(fd, fpos_next, SEEK_SET);
Expand Down Expand Up @@ -9525,7 +9526,7 @@ spell_add_word(word, len, bad, idx, undo)
fclose(fd);

home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Word added to %s"), NameBuff);
smsg((char_u *)_("Word '%.*s' added to %s"), len, word, NameBuff);
}
}

Expand Down Expand Up @@ -10135,7 +10136,7 @@ spell_check_sps()
}

/*
* "z?": Find badly spelled word under or after the cursor.
* "z=": Find badly spelled word under or after the cursor.
* Give suggestions for the properly spelled word.
* In Visual mode use the highlighted word as the bad word.
* When "count" is non-zero use that suggestion.
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -738,6 +738,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
38,
/**/
37,
/**/
Expand Down

0 comments on commit 134bf07

Please sign in to comment.