comparison src/main.c @ 2282:a888ed7ba375 vim73

Make updating text for conceal mode simpler. A few compiler warning fixes.
author Bram Moolenaar <bram@vim.org>
date Fri, 02 Jul 2010 20:20:09 +0200
parents e4d849f4df03
children bbd6f5539378
comparison
equal deleted inserted replaced
2281:e41433ea71df 2282:a888ed7ba375
978 int cmdwin; /* TRUE when working in the command-line window */ 978 int cmdwin; /* TRUE when working in the command-line window */
979 int noexmode; /* TRUE when return on entering Ex mode */ 979 int noexmode; /* TRUE when return on entering Ex mode */
980 { 980 {
981 oparg_T oa; /* operator arguments */ 981 oparg_T oa; /* operator arguments */
982 int previous_got_int = FALSE; /* "got_int" was TRUE */ 982 int previous_got_int = FALSE; /* "got_int" was TRUE */
983 #ifdef FEAT_CONCEAL
984 linenr_T conceal_old_cursor_line = 0;
985 linenr_T conceal_new_cursor_line = 0;
986 int conceal_update_lines = FALSE;
987 #endif
983 988
984 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) 989 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
985 /* Setup to catch a terminating error from the X server. Just ignore 990 /* Setup to catch a terminating error from the X server. Just ignore
986 * it, restore the state and continue. This might not always work 991 * it, restore the state and continue. This might not always work
987 * properly, but at least we don't exit unexpectedly when the X server 992 * properly, but at least we don't exit unexpectedly when the X server
1077 */ 1082 */
1078 if (skip_redraw || exmode_active) 1083 if (skip_redraw || exmode_active)
1079 skip_redraw = FALSE; 1084 skip_redraw = FALSE;
1080 else if (do_redraw || stuff_empty()) 1085 else if (do_redraw || stuff_empty())
1081 { 1086 {
1082 #ifdef FEAT_AUTOCMD 1087 #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
1083 /* Trigger CursorMoved if the cursor moved. */ 1088 /* Trigger CursorMoved if the cursor moved. */
1084 if (!finish_op && has_cursormoved() 1089 if (!finish_op && (
1085 && !equalpos(last_cursormoved, curwin->w_cursor)) 1090 # ifdef FEAT_AUTOCMD
1091 has_cursormoved()
1092 # endif
1093 # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
1094 ||
1095 # endif
1096 # ifdef FEAT_CONCEAL
1097 curwin->w_p_conceal
1098 # endif
1099 )
1100 && !equalpos(last_cursormoved, curwin->w_cursor))
1086 { 1101 {
1087 apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf); 1102 # ifdef FEAT_AUTOCMD
1103 if (has_cursormoved())
1104 apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
1105 FALSE, curbuf);
1106 # endif
1107 # ifdef FEAT_CONCEAL
1108 if (curwin->w_p_conceal)
1109 {
1110 conceal_old_cursor_line = last_cursormoved.lnum;
1111 conceal_new_cursor_line = curwin->w_cursor.lnum;
1112 conceal_update_lines = TRUE;
1113 }
1114 # endif
1088 last_cursormoved = curwin->w_cursor; 1115 last_cursormoved = curwin->w_cursor;
1089 } 1116 }
1090 #endif 1117 #endif
1091 1118
1092 #if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND) 1119 #if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
1162 did_emsg = FALSE; 1189 did_emsg = FALSE;
1163 msg_didany = FALSE; /* reset lines_left in msg_start() */ 1190 msg_didany = FALSE; /* reset lines_left in msg_start() */
1164 may_clear_sb_text(); /* clear scroll-back text on next msg */ 1191 may_clear_sb_text(); /* clear scroll-back text on next msg */
1165 showruler(FALSE); 1192 showruler(FALSE);
1166 1193
1194 # if defined(FEAT_CONCEAL)
1195 if (conceal_update_lines
1196 && conceal_old_cursor_line != conceal_new_cursor_line)
1197 {
1198 update_single_line(curwin, conceal_old_cursor_line);
1199 update_single_line(curwin, conceal_new_cursor_line);
1200 curwin->w_valid &= ~VALID_CROW;
1201 }
1202 # endif
1167 setcursor(); 1203 setcursor();
1168 cursor_on(); 1204 cursor_on();
1169 1205
1170 do_redraw = FALSE; 1206 do_redraw = FALSE;
1171 1207