diff options
author | Bram Moolenaar <bram@vim.org> | 2013-09-25 18:54:24 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2013-09-25 18:54:24 +0200 |
commit | 2cf685091a24cc00aefb79c96f093a450a53b2fc (patch) | |
tree | 6293fbf35dfc276d78e7e819271ec11e0448234f | |
parent | 8a5ca77b89ed229f31138dccfe53e3fae8c5cad3 (diff) | |
download | vim-2cf685091a24cc00aefb79c96f093a450a53b2fc.tar.gz |
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)
-rw-r--r-- | src/normal.c | 6 | ||||
-rw-r--r-- | src/spell.c | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c index 4c11a2b6..87e979d1 100644 --- a/src/normal.c +++ b/src/normal.c @@ -5246,8 +5246,12 @@ dozet: { 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; diff --git a/src/spell.c b/src/spell.c index 20344f25..3ee8b02a 100644 --- a/src/spell.c +++ b/src/spell.c @@ -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); @@ -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); } } @@ -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. diff --git a/src/version.c b/src/version.c index 08220ef8..c7b73329 100644 --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 38, +/**/ 37, /**/ 36, |