summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-02-12 18:03:57 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-12 18:03:57 +0000
commit55a27d8ea7c112429fff14aba5db562de7f765f1 (patch)
treeaeb299a91f93fa48d9e73dd1f7909e4de34de067 /src/charset.c
parent234c3fab28c14846b962c90097496b27ee1b4df8 (diff)
patch 9.0.1305: cursor in wrong line with virtual text abovev9.0.1305
Problem: Cursor in wrong line with virtual text above. Solution: Count extra line for text property above/below. (closes #11959)
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/charset.c b/src/charset.c
index ebec2cf401..3ce95c7f41 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -813,6 +813,11 @@ win_linetabsize_cts(chartabsize_T *cts, colnr_T len)
{
(void)win_lbr_chartabsize(cts, NULL);
cts->cts_vcol += cts->cts_cur_text_width;
+
+ // when properties are above or below the empty line must also be
+ // counted
+ if (cts->cts_prop_lines > 0)
+ ++cts->cts_vcol;
}
#endif
}
@@ -1217,6 +1222,10 @@ win_lbr_chartabsize(
tab_size = win_chartabsize(wp, s, vcol + size);
size += tab_size;
}
+ if (tp->tp_col == MAXCOL && (tp->tp_flags
+ & (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)))
+ // count extra line for property above/below
+ ++cts->cts_prop_lines;
}
}
if (tp->tp_col != MAXCOL && tp->tp_col - 1 > col)