1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar 2022-09-17 17:15:33 +01:00
parent acd6b9976b
commit 4c7fd4d68f
4 changed files with 19 additions and 0 deletions

View File

@ -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;

View File

@ -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|

View File

@ -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>")

View File

@ -703,6 +703,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
488,
/**/
487,
/**/