summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-17 17:15:33 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-17 17:15:33 +0100
commit4c7fd4d68f69b4e420a5448f144f4d57eda22f8c (patch)
tree3d2cc4e9f44d15e057e73ca9d09d59e306f94130
parentacd6b9976bd939035025a16ceb4213a680827927 (diff)
downloadvim-git-4c7fd4d68f69b4e420a5448f144f4d57eda22f8c.tar.gz
patch 9.0.0488: cursor wrong with virtual text "above" and 'showbreak'v9.0.0488
Problem: Cursor in wrong position with virtual text "above" and 'showbreak'. Solution: Take the first character column into account. (closes #11149)
-rw-r--r--src/charset.c3
-rw-r--r--src/testdir/dumps/Test_prop_with_text_above_1c.dump9
-rw-r--r--src/testdir/test_textprop.vim5
-rw-r--r--src/version.c2
4 files changed, 19 insertions, 0 deletions
diff --git a/src/charset.c b/src/charset.c
index c5edaf41e..9ddb21d96 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1280,6 +1280,9 @@ win_lbr_chartabsize(
numberextra = numberwidth;
vcol += numberextra + mb_added;
+#ifdef FEAT_PROP_POPUP
+ vcol -= wp->w_virtcol_first_char;
+#endif
if (vcol >= (colnr_T)wp->w_width)
{
vcol -= wp->w_width;
diff --git a/src/testdir/dumps/Test_prop_with_text_above_1c.dump b/src/testdir/dumps/Test_prop_with_text_above_1c.dump
new file mode 100644
index 000000000..98c85713f
--- /dev/null
+++ b/src/testdir/dumps/Test_prop_with_text_above_1c.dump
@@ -0,0 +1,9 @@
+|f+0&#ffff4012|i|r|s|t| |t|h|i|n|g| |a|b|o|v|e| @42
+|s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41
+|o+0&#ffffff0|n>e| |t|w|o| @52
+|t|h|r|e@1| |f|o|u|r| @49
+@3|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @43
+|f+0&#ffffff0|i|v|e| |s|i|x| @51
+|~+0#4040ff13&| @58
+|~| @58
+|:+0#0000000&|s|e|t| |s|h|o|w|b|r|e|a|k|=|>@1| @24|1|,|3|-|1|2|3| @6|A|l@1|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 259ff9c36..1c32cbcd0 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2874,6 +2874,11 @@ func Test_props_with_text_above()
call term_sendkeys(buf, "g0")
call VerifyScreenDump(buf, 'Test_prop_with_text_above_1b', {})
+ call term_sendkeys(buf, ":set showbreak=>>\<CR>")
+ call term_sendkeys(buf, "ggll")
+ call VerifyScreenDump(buf, 'Test_prop_with_text_above_1c', {})
+ call term_sendkeys(buf, ":set showbreak=\<CR>")
+
call term_sendkeys(buf, "ggI")
call VerifyScreenDump(buf, 'Test_prop_with_text_above_2', {})
call term_sendkeys(buf, "inserted \<Esc>")
diff --git a/src/version.c b/src/version.c
index a8d0f4815..93e706d9e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 488,
+/**/
487,
/**/
486,