Mercurial > vim
diff src/screen.c @ 499:08012a1ff8d4 v7.0137
updated for version 7.0137
author | vimboss |
---|---|
date | Thu, 25 Aug 2005 21:27:31 +0000 |
parents | 6f8b578776ab |
children | ce2181d14aa0 |
line wrap: on
line diff
--- 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 } /*