# HG changeset patch # User Bram Moolenaar # Date 1663432204 -7200 # Node ID f1fe5917918031b01817d4e1809c3da2f8913e16 # Parent 05bd2e2a29672319b0bc2fea8df3c371938a1db2 patch 9.0.0488: cursor wrong with virtual text "above" and 'showbreak' Commit: https://github.com/vim/vim/commit/4c7fd4d68f69b4e420a5448f144f4d57eda22f8c Author: Bram Moolenaar Date: Sat Sep 17 17:15:33 2022 +0100 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) diff --git a/src/charset.c b/src/charset.c --- 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 --- /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 --- 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 --- 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,