comparison src/edit.c @ 2378:85b7dc8da5eb vim73

Add the 'concealcursor' option to decide when the cursor line is to be concealed or not. Rename 'conc' to 'cole' as the short name for 'conceallevel'.
author Bram Moolenaar <bram@vim.org>
date Fri, 23 Jul 2010 22:10:27 +0200
parents 8878a9f8db87
children 0ca06a92adfb
comparison
equal deleted inserted replaced
2377:878562053ba3 2378:85b7dc8da5eb
375 # endif 375 # endif
376 apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf); 376 apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
377 } 377 }
378 #endif 378 #endif
379 379
380 #ifdef FEAT_CONCEAL
381 /* Check if the cursor line needs redrawing before changing State. If
382 * 'concealcursor' is "n" it needs to be redrawn without concealing. */
383 conceal_check_cursur_line_redraw();
384 #endif
385
380 #ifdef FEAT_MOUSE 386 #ifdef FEAT_MOUSE
381 /* 387 /*
382 * When doing a paste with the middle mouse button, Insstart is set to 388 * When doing a paste with the middle mouse button, Insstart is set to
383 * where the paste started. 389 * where the paste started.
384 */ 390 */
1474 # endif 1480 # endif
1475 # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL) 1481 # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
1476 || 1482 ||
1477 # endif 1483 # endif
1478 # ifdef FEAT_CONCEAL 1484 # ifdef FEAT_CONCEAL
1479 curwin->w_p_conc > 0 1485 curwin->w_p_cole > 0
1480 # endif 1486 # endif
1481 ) 1487 )
1482 && !equalpos(last_cursormoved, curwin->w_cursor) 1488 && !equalpos(last_cursormoved, curwin->w_cursor)
1483 # ifdef FEAT_INS_EXPAND 1489 # ifdef FEAT_INS_EXPAND
1484 && !pum_visible() 1490 && !pum_visible()
1496 # ifdef FEAT_AUTOCMD 1502 # ifdef FEAT_AUTOCMD
1497 if (has_cursormovedI()) 1503 if (has_cursormovedI())
1498 apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf); 1504 apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
1499 # endif 1505 # endif
1500 # ifdef FEAT_CONCEAL 1506 # ifdef FEAT_CONCEAL
1501 if (curwin->w_p_conc > 0) 1507 if (curwin->w_p_cole > 0)
1502 { 1508 {
1503 conceal_old_cursor_line = last_cursormoved.lnum; 1509 conceal_old_cursor_line = last_cursormoved.lnum;
1504 conceal_new_cursor_line = curwin->w_cursor.lnum; 1510 conceal_new_cursor_line = curwin->w_cursor.lnum;
1505 conceal_update_lines = TRUE; 1511 conceal_update_lines = TRUE;
1506 } 1512 }
1511 if (must_redraw) 1517 if (must_redraw)
1512 update_screen(0); 1518 update_screen(0);
1513 else if (clear_cmdline || redraw_cmdline) 1519 else if (clear_cmdline || redraw_cmdline)
1514 showmode(); /* clear cmdline and show mode */ 1520 showmode(); /* clear cmdline and show mode */
1515 # if defined(FEAT_CONCEAL) 1521 # if defined(FEAT_CONCEAL)
1516 if (conceal_update_lines 1522 if ((conceal_update_lines
1517 && conceal_old_cursor_line != conceal_new_cursor_line) 1523 && (conceal_old_cursor_line != conceal_new_cursor_line
1518 { 1524 || conceal_cursor_line(curwin)))
1519 update_single_line(curwin, conceal_old_cursor_line); 1525 || need_cursor_line_redraw)
1520 update_single_line(curwin, conceal_new_cursor_line); 1526 {
1527 if (conceal_old_cursor_line != conceal_new_cursor_line)
1528 update_single_line(curwin, conceal_old_cursor_line);
1529 update_single_line(curwin, conceal_new_cursor_line == 0
1530 ? curwin->w_cursor.lnum : conceal_new_cursor_line);
1521 curwin->w_valid &= ~VALID_CROW; 1531 curwin->w_valid &= ~VALID_CROW;
1522 } 1532 }
1523 # endif 1533 # endif
1524 showruler(FALSE); 1534 showruler(FALSE);
1525 setcursor(); 1535 setcursor();