summaryrefslogtreecommitdiffstats
path: root/src/edit.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/edit.c
parent4067bd3604215b48e4b4201e28f9e401b08418e4 (diff)
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/edit.c')
-rw-r--r--src/edit.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 9162fe6298..d944080300 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -147,6 +147,9 @@ edit(
#ifdef FEAT_JOB_CHANNEL
int cmdchar_todo = cmdchar;
#endif
+#ifdef FEAT_CONCEAL
+ int cursor_line_was_concealed;
+#endif
// Remember whether editing was restarted after CTRL-O.
did_restart_edit = restart_edit;
@@ -222,9 +225,9 @@ edit(
}
#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_cursor_line();
+ // Check if the cursor line was concealed before changing State.
+ cursor_line_was_concealed = curwin->w_p_cole > 0
+ && conceal_cursor_line(curwin);
#endif
/*
@@ -283,6 +286,12 @@ edit(
stop_insert_mode = FALSE;
+#ifdef FEAT_CONCEAL
+ // Check if the cursor line needs redrawing after changing State. If
+ // 'concealcursor' is "n" it needs to be redrawn without concealing.
+ conceal_check_cursor_line(cursor_line_was_concealed);
+#endif
+
/*
* Need to recompute the cursor position, it might move when the cursor is
* on a TAB or special character.