summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-29 20:22:32 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-29 20:22:32 +0200
commitea042677ab5cab736540f3164909cac2c685de74 (patch)
tree623524f72d11b847df5de0043c42e466290e2e8b /src/screen.c
parent4067bd3604215b48e4b4201e28f9e401b08418e4 (diff)
downloadvim-git-ea042677ab5cab736540f3164909cac2c685de74.tar.gz
patch 8.2.3074: popup_atcursor() uses wrong position with concealingv8.2.3074
Problem: popup_atcursor() uses wrong position with concealing. Solution: Keep w_wcol in conceal_check_cursor_line(). (closes #8476)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c14
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