diff options
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c index 7c27e2ca4..bfb6bf7ba 100644 --- a/src/screen.c +++ b/src/screen.c @@ -83,16 +83,26 @@ conceal_cursor_line(win_T *wp) /* * Check if the cursor line needs to be redrawn because of 'concealcursor'. + * To be called after changing the state, "was_concealed" is the value of + * "conceal_cursor_line()" before the change. + * " */ void -conceal_check_cursor_line(void) +conceal_check_cursor_line(int was_concealed) { - if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)) + if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin) != was_concealed) { + int wcol = curwin->w_wcol; + need_cursor_line_redraw = TRUE; // Need to recompute cursor column, e.g., when starting Visual mode // without concealing. curs_columns(TRUE); + + // When concealing now w_wcol will be computed wrong, keep the previous + // value, it will be updated in win_line(). + if (!was_concealed) + curwin->w_wcol = wcol; } } #endif |