diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-08-25 21:27:31 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-08-25 21:27:31 +0000 |
commit | 81f1ecbc4dc885a4757e5cc64002f4b22f397f18 (patch) | |
tree | 5c4ba6bc66369c24dccdd0978afc4d8fcb64251a /src/screen.c | |
parent | 955295684b1c9ba07cdd570eef8b16a60757f330 (diff) | |
download | vim-git-81f1ecbc4dc885a4757e5cc64002f4b22f397f18.tar.gz |
updated for version 7.0137v7.0137
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c index b3dbe0141..ba345ae47 100644 --- a/src/screen.c +++ b/src/screen.c @@ -2916,6 +2916,31 @@ win_line(wp, lnum, startrow, endrow) if (wp->w_p_wrap) need_showbreak = TRUE; #endif +#ifdef FEAT_SYN_HL + /* When spell checking a word we need to figure out the start of the + * word and if it's badly spelled or not. */ + if (has_spell) + { + int len; + + pos = wp->w_cursor; + wp->w_cursor.lnum = lnum; + wp->w_cursor.col = ptr - line; + len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_attr); + if (len == 0 || wp->w_cursor.col > ptr - line) + { + /* no bad word found at line start, don't check until end of a + * word */ + spell_attr = 0; + word_end = spell_to_word_end(ptr, wp->w_buffer) - line + 1; + } + else + /* bad word found, use attributes until end of word */ + word_end = wp->w_cursor.col + len + 1; + + wp->w_cursor = pos; + } +#endif } /* |