diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-23 22:10:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-23 22:10:27 +0200 |
commit | f5963f719eb85e8aa71aeb5c23c4edf4949adef1 (patch) | |
tree | 9c3ab6deeb29ff964cbd77d01e885b3237f6c59a /src/edit.c | |
parent | c88ebf7fa81833b401423214c62d0ecfaaa68b78 (diff) | |
download | vim-git-f5963f719eb85e8aa71aeb5c23c4edf4949adef1.tar.gz |
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'.
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/edit.c b/src/edit.c index 87fd5696c..3370a28f2 100644 --- a/src/edit.c +++ b/src/edit.c @@ -377,6 +377,12 @@ edit(cmdchar, startln, count) } #endif +#ifdef FEAT_CONCEAL + /* Check if the cursor line needs redrawing before changing State. If + * 'concealcursor' is "n" it needs to be redrawn without concealing. */ + conceal_check_cursur_line_redraw(); +#endif + #ifdef FEAT_MOUSE /* * When doing a paste with the middle mouse button, Insstart is set to @@ -1476,7 +1482,7 @@ ins_redraw(ready) || # endif # ifdef FEAT_CONCEAL - curwin->w_p_conc > 0 + curwin->w_p_cole > 0 # endif ) && !equalpos(last_cursormoved, curwin->w_cursor) @@ -1498,7 +1504,7 @@ ins_redraw(ready) apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf); # endif # ifdef FEAT_CONCEAL - if (curwin->w_p_conc > 0) + if (curwin->w_p_cole > 0) { conceal_old_cursor_line = last_cursormoved.lnum; conceal_new_cursor_line = curwin->w_cursor.lnum; @@ -1513,11 +1519,15 @@ ins_redraw(ready) else if (clear_cmdline || redraw_cmdline) showmode(); /* clear cmdline and show mode */ # if defined(FEAT_CONCEAL) - if (conceal_update_lines - && conceal_old_cursor_line != conceal_new_cursor_line) - { - update_single_line(curwin, conceal_old_cursor_line); - update_single_line(curwin, conceal_new_cursor_line); + if ((conceal_update_lines + && (conceal_old_cursor_line != conceal_new_cursor_line + || conceal_cursor_line(curwin))) + || need_cursor_line_redraw) + { + if (conceal_old_cursor_line != conceal_new_cursor_line) + update_single_line(curwin, conceal_old_cursor_line); + update_single_line(curwin, conceal_new_cursor_line == 0 + ? curwin->w_cursor.lnum : conceal_new_cursor_line); curwin->w_valid &= ~VALID_CROW; } # endif |