From 4c7fd4d68f69b4e420a5448f144f4d57eda22f8c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 17 Sep 2022 17:15:33 +0100 Subject: [PATCH] patch 9.0.0488: cursor wrong with virtual text "above" and 'showbreak' Problem: Cursor in wrong position with virtual text "above" and 'showbreak'. Solution: Take the first character column into account. (closes #11149) --- src/charset.c | 3 +++ src/testdir/dumps/Test_prop_with_text_above_1c.dump | 9 +++++++++ src/testdir/test_textprop.vim | 5 +++++ src/version.c | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 src/testdir/dumps/Test_prop_with_text_above_1c.dump 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=>>\") + call term_sendkeys(buf, "ggll") + call VerifyScreenDump(buf, 'Test_prop_with_text_above_1c', {}) + call term_sendkeys(buf, ":set showbreak=\") + call term_sendkeys(buf, "ggI") call VerifyScreenDump(buf, 'Test_prop_with_text_above_2', {}) call term_sendkeys(buf, "inserted \") diff --git a/src/version.c b/src/version.c index a8d0f4815..93e706d9e 100644 --- a/src/version.c +++ b/src/version.c @@ -703,6 +703,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 488, /**/ 487, /**/ -- 2.40.0