Mercurial > vim
comparison src/screen.c @ 301:006e9c8a6a8a v7.0079
updated for version 7.0079
author | vimboss |
---|---|
date | Sat, 04 Jun 2005 22:06:24 +0000 |
parents | fe16c18c24a7 |
children | 6a21eb563c34 |
comparison
equal
deleted
inserted
replaced
300:86cd0a77d2ae | 301:006e9c8a6a8a |
---|---|
241 redraw_win_later(wp, type); | 241 redraw_win_later(wp, type); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 /* | 245 /* |
246 * Mark all windows that are editing the current buffer to be udpated later. | 246 * Mark all windows that are editing the current buffer to be updated later. |
247 */ | 247 */ |
248 void | 248 void |
249 redraw_curbuf_later(type) | 249 redraw_curbuf_later(type) |
250 int type; | 250 int type; |
251 { | 251 { |
723 * INVERTED redraw the changed part of the Visual area | 723 * INVERTED redraw the changed part of the Visual area |
724 * INVERTED_ALL redraw the whole Visual area | 724 * INVERTED_ALL redraw the whole Visual area |
725 * VALID 1. scroll up/down to adjust for a changed w_topline | 725 * VALID 1. scroll up/down to adjust for a changed w_topline |
726 * 2. update lines at the top when scrolled down | 726 * 2. update lines at the top when scrolled down |
727 * 3. redraw changed text: | 727 * 3. redraw changed text: |
728 * - if wp->w_buffer->b_mod_set set, udpate lines between | 728 * - if wp->w_buffer->b_mod_set set, update lines between |
729 * b_mod_top and b_mod_bot. | 729 * b_mod_top and b_mod_bot. |
730 * - if wp->w_redraw_top non-zero, redraw lines between | 730 * - if wp->w_redraw_top non-zero, redraw lines between |
731 * wp->w_redraw_top and wp->w_redr_bot. | 731 * wp->w_redraw_top and wp->w_redr_bot. |
732 * - continue redrawing when syntax status is invalid. | 732 * - continue redrawing when syntax status is invalid. |
733 * 4. if scrolled up, update lines at the bottom. | 733 * 4. if scrolled up, update lines at the bottom. |
2502 int has_syntax = FALSE; /* this buffer has syntax highl. */ | 2502 int has_syntax = FALSE; /* this buffer has syntax highl. */ |
2503 int save_did_emsg; | 2503 int save_did_emsg; |
2504 int has_spell = FALSE; /* this buffer has spell checking */ | 2504 int has_spell = FALSE; /* this buffer has spell checking */ |
2505 int spell_attr = 0; /* attributes desired by spelling */ | 2505 int spell_attr = 0; /* attributes desired by spelling */ |
2506 int word_end = 0; /* last byte with same spell_attr */ | 2506 int word_end = 0; /* last byte with same spell_attr */ |
2507 int iswordc; /* prev. char was a word character */ | |
2508 int prev_iswordc = FALSE; /* prev. char was a word character */ | |
2509 #endif | 2507 #endif |
2510 int extra_check; /* has syntax or linebreak */ | 2508 int extra_check; /* has syntax or linebreak */ |
2511 #ifdef FEAT_MBYTE | 2509 #ifdef FEAT_MBYTE |
2512 int multi_attr = 0; /* attributes desired by multibyte */ | 2510 int multi_attr = 0; /* attributes desired by multibyte */ |
2513 int mb_l = 1; /* multi-byte byte length */ | 2511 int mb_l = 1; /* multi-byte byte length */ |
3243 else if (search_attr == 0 && has_syntax) | 3241 else if (search_attr == 0 && has_syntax) |
3244 char_attr = syntax_attr; | 3242 char_attr = syntax_attr; |
3245 #endif | 3243 #endif |
3246 else | 3244 else |
3247 char_attr = search_attr; | 3245 char_attr = search_attr; |
3248 | |
3249 #ifdef FEAT_SYN_HL | |
3250 if (spell_attr != 0) | |
3251 char_attr = hl_combine_attr(char_attr, spell_attr); | |
3252 #endif | |
3253 | 3246 |
3254 #ifdef FEAT_DIFF | 3247 #ifdef FEAT_DIFF |
3255 if (diff_hlf != (enum hlf_value)0 && n_extra == 0) | 3248 if (diff_hlf != (enum hlf_value)0 && n_extra == 0) |
3256 { | 3249 { |
3257 if (diff_hlf == HLF_CHD && ptr - line >= change_start) | 3250 if (diff_hlf == HLF_CHD && ptr - line >= change_start) |
3584 line = ml_get_buf(wp->w_buffer, lnum, FALSE); | 3577 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
3585 ptr = line + v; | 3578 ptr = line + v; |
3586 | 3579 |
3587 if (area_attr == 0 && search_attr == 0) | 3580 if (area_attr == 0 && search_attr == 0) |
3588 char_attr = syntax_attr; | 3581 char_attr = syntax_attr; |
3589 } | 3582 else |
3590 | 3583 char_attr = hl_combine_attr(char_attr, syntax_attr); |
3591 /* Check spelling at the start of a word. | 3584 } |
3585 | |
3586 /* Check spelling (unless at the end of the line). | |
3592 * Only do this when there is no syntax highlighting, there is | 3587 * Only do this when there is no syntax highlighting, there is |
3593 * on @Spell cluster or the current syntax item contains the | 3588 * on @Spell cluster or the current syntax item contains the |
3594 * @Spell cluster. */ | 3589 * @Spell cluster. */ |
3595 if (has_spell && v >= word_end) | 3590 if (has_spell && v >= word_end) |
3596 { | 3591 { |
3597 spell_attr = 0; | 3592 spell_attr = 0; |
3598 if (area_attr == 0 && search_attr == 0) | 3593 if (area_attr == 0 && search_attr == 0) |
3599 char_attr = syntax_attr; | 3594 char_attr = syntax_attr; |
3600 if (!has_syntax || can_spell) | 3595 if (c != 0 && (!has_syntax || can_spell)) |
3601 { | 3596 { |
3602 char_u *prev_ptr = ptr - ( | |
3603 # ifdef FEAT_MBYTE | 3597 # ifdef FEAT_MBYTE |
3604 has_mbyte ? mb_l : | 3598 char_u *prev_ptr = ptr - (has_mbyte ? mb_l : 1); |
3599 # else | |
3600 char_u *prev_ptr = ptr - 1; | |
3605 # endif | 3601 # endif |
3606 1); | 3602 word_end = v + spell_check(wp, prev_ptr, &spell_attr); |
3607 | 3603 |
3608 iswordc = spell_iswordc(prev_ptr); | 3604 /* In Insert mode only highlight a word that |
3609 if (iswordc && !prev_iswordc) | 3605 * doesn't touch the cursor. */ |
3606 if (spell_attr != 0 | |
3607 && (State & INSERT) != 0 | |
3608 && wp->w_cursor.lnum == lnum | |
3609 && wp->w_cursor.col >= | |
3610 (colnr_T)(prev_ptr - line) | |
3611 && wp->w_cursor.col < (colnr_T)word_end) | |
3610 { | 3612 { |
3611 word_end = v + spell_check(wp, line, prev_ptr, | 3613 spell_attr = 0; |
3612 &spell_attr); | 3614 spell_redraw_lnum = lnum; |
3613 /* In Insert mode only highlight a word that | |
3614 * doesn't touch the cursor. */ | |
3615 if (spell_attr != 0 | |
3616 && (State & INSERT) != 0 | |
3617 && wp->w_cursor.lnum == lnum | |
3618 && wp->w_cursor.col >= | |
3619 (colnr_T)(prev_ptr - line) | |
3620 && wp->w_cursor.col < (colnr_T)word_end) | |
3621 { | |
3622 spell_attr = 0; | |
3623 spell_redraw_lnum = lnum; | |
3624 } | |
3625 } | 3615 } |
3626 prev_iswordc = iswordc; | |
3627 } | 3616 } |
3628 } | 3617 } |
3629 if (spell_attr != 0) | 3618 if (spell_attr != 0) |
3630 char_attr = hl_combine_attr(char_attr, spell_attr); | 3619 char_attr = hl_combine_attr(char_attr, spell_attr); |
3631 #endif | 3620 #endif |