summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-16 22:32:15 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-16 22:32:15 +0200
commit644b49fa0fb90143e8dbe90a7c14c9498d17b266 (patch)
treea2941b8f9bf49ba21dcf7b44e7a6b20aa9238c35 /src
parent3dfe2e0fb8768914a019fa04b1ed9581e33c9b26 (diff)
downloadvim-git-644b49fa0fb90143e8dbe90a7c14c9498d17b266.tar.gz
patch 8.2.3444: concealed text not revealed when leaving insert modev8.2.3444
Problem: concealed text not revealed when leaving insert mode. (Michael Soyka) Solution: Check if concealing changed when leaving insert mode. (closes #8880)
Diffstat (limited to 'src')
-rw-r--r--src/edit.c10
-rw-r--r--src/testdir/dumps/Test_conceal_two_windows_07in.dump20
-rw-r--r--src/testdir/test_conceal.vim6
-rw-r--r--src/version.c2
4 files changed, 36 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c
index e1e796f0b..070d84c60 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3582,6 +3582,11 @@ ins_esc(
{
int temp;
static int disabled_redraw = FALSE;
+#ifdef FEAT_CONCEAL
+ // Remember if the cursor line was concealed before changing State.
+ int cursor_line_was_concealed = curwin->w_p_cole > 0
+ && conceal_cursor_line(curwin);
+#endif
#ifdef FEAT_SPELL
check_spell_redraw();
@@ -3701,6 +3706,11 @@ ins_esc(
// Re-enable modifyOtherKeys.
out_str(T_CTI);
}
+#ifdef FEAT_CONCEAL
+ // Check if the cursor line needs redrawing after changing State. If
+ // 'concealcursor' is "i" it needs to be redrawn without concealing.
+ conceal_check_cursor_line(cursor_line_was_concealed);
+#endif
// When recording or for CTRL-O, need to display the new mode.
// Otherwise remove the mode message.
diff --git a/src/testdir/dumps/Test_conceal_two_windows_07in.dump b/src/testdir/dumps/Test_conceal_two_windows_07in.dump
new file mode 100644
index 000000000..67c8cdba0
--- /dev/null
+++ b/src/testdir/dumps/Test_conceal_two_windows_07in.dump
@@ -0,0 +1,20 @@
+|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| |o|n|e| |o|n|e| @55
+|t|w|o| @1|h|e|r|e| @65
+|t|h|r|e@1| @1|t|h|r|e@1| @62
+|S|e|c|o|n|d| |w|i|n|d|o|w| @61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|3|,|1|4| @10|A|l@1
+|o+0&&|n|e| |o|n|e| |o|n|e| |o|n|e| |o|n|e| @55
+|t|w|o| |||h|i|d@1|e|n||| >h|e|r|e| @57
+|t|h|r|e@1| @1|t|h|r|e@1| @62
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|2|,|1|4| @10|A|l@1
+| +0&&@74
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index b555682d2..3a24b7fd9 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -59,9 +59,11 @@ func Test_conceal_two_windows()
" Check that with cursor line is only concealed in Insert mode
call term_sendkeys(buf, ":set concealcursor=i\r")
call VerifyScreenDump(buf, 'Test_conceal_two_windows_07n', {})
- call term_sendkeys(buf, "a")
+ call term_sendkeys(buf, "14|a")
call VerifyScreenDump(buf, 'Test_conceal_two_windows_07i', {})
- call term_sendkeys(buf, "\<Esc>/e")
+ call term_sendkeys(buf, "\<Esc>")
+ call VerifyScreenDump(buf, 'Test_conceal_two_windows_07in', {})
+ call term_sendkeys(buf, "/e")
call VerifyScreenDump(buf, 'Test_conceal_two_windows_07c', {})
call term_sendkeys(buf, "\<Esc>v")
call VerifyScreenDump(buf, 'Test_conceal_two_windows_07v', {})
diff --git a/src/version.c b/src/version.c
index 4d559248e..0b714bf46 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3444,
+/**/
3443,
/**/
3442,