comparison src/screen.c @ 1536:24b7b3cc4eec v7.1.251

updated for version 7.1-251
author vimboss
date Wed, 13 Feb 2008 20:49:04 +0000
parents cc4fe241baa3
children cbe70f2e756d
comparison
equal deleted inserted replaced
1535:eb0504d00480 1536:24b7b3cc4eec
2642 int need_showbreak = FALSE; 2642 int need_showbreak = FALSE;
2643 #endif 2643 #endif
2644 #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \ 2644 #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
2645 || defined(FEAT_SYN_HL) || defined(FEAT_DIFF) 2645 || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
2646 # define LINE_ATTR 2646 # define LINE_ATTR
2647 int line_attr = 0; /* atrribute for the whole line */ 2647 int line_attr = 0; /* attribute for the whole line */
2648 #endif 2648 #endif
2649 #ifdef FEAT_SEARCH_EXTRA 2649 #ifdef FEAT_SEARCH_EXTRA
2650 matchitem_T *cur; /* points to the match list */ 2650 matchitem_T *cur; /* points to the match list */
2651 match_T *shl; /* points to search_hl or a match */ 2651 match_T *shl; /* points to search_hl or a match */
2652 int shl_flag; /* flag to indicate whether search_hl 2652 int shl_flag; /* flag to indicate whether search_hl
3038 /* When spell checking a word we need to figure out the start of the 3038 /* When spell checking a word we need to figure out the start of the
3039 * word and if it's badly spelled or not. */ 3039 * word and if it's badly spelled or not. */
3040 if (has_spell) 3040 if (has_spell)
3041 { 3041 {
3042 int len; 3042 int len;
3043 colnr_T linecol = (colnr_T)(ptr - line);
3043 hlf_T spell_hlf = HLF_COUNT; 3044 hlf_T spell_hlf = HLF_COUNT;
3044 3045
3045 pos = wp->w_cursor; 3046 pos = wp->w_cursor;
3046 wp->w_cursor.lnum = lnum; 3047 wp->w_cursor.lnum = lnum;
3047 wp->w_cursor.col = (colnr_T)(ptr - line); 3048 wp->w_cursor.col = linecol;
3048 len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf); 3049 len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf);
3050
3051 /* spell_move_to() may call ml_get() and make "line" invalid */
3052 line = ml_get_buf(wp->w_buffer, lnum, FALSE);
3053 ptr = line + linecol;
3054
3049 if (len == 0 || (int)wp->w_cursor.col > ptr - line) 3055 if (len == 0 || (int)wp->w_cursor.col > ptr - line)
3050 { 3056 {
3051 /* no bad word found at line start, don't check until end of a 3057 /* no bad word found at line start, don't check until end of a
3052 * word */ 3058 * word */
3053 spell_hlf = HLF_COUNT; 3059 spell_hlf = HLF_COUNT;
3054 word_end = (int)(spell_to_word_end(ptr, wp->w_buffer) - line + 1); 3060 word_end = (int)(spell_to_word_end(ptr, wp->w_buffer)
3061 - line + 1);
3055 } 3062 }
3056 else 3063 else
3057 { 3064 {
3058 /* bad word found, use attributes until end of word */ 3065 /* bad word found, use attributes until end of word */
3059 word_end = wp->w_cursor.col + len + 1; 3066 word_end = wp->w_cursor.col + len + 1;