summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-17 18:55:03 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-17 18:55:03 +0100
commitb99e6e6c5fbabbade6431fb555c4fe7409a9269a (patch)
tree665e05ed0c974ba09b5639cca7b0e4593bdd6f12 /src/drawline.c
parent8107a2a8af80a53a61734b600539c5beb4782991 (diff)
patch 9.0.0784: text prop "above" not right with 'number' and "n" in 'cpo'v9.0.0784
Problem: Text prop "above" not displayed correctly with 'number' and "n" in 'cpo'. Solution: Draw the line number column until the line text is reached.
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 8824a01212..e849f9d782 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -343,9 +343,14 @@ handle_lnum_col(
int num_attr UNUSED)
{
int has_cpo_n = vim_strchr(p_cpo, CPO_NUMCOL) != NULL;
+ int lnum_row = wlv->startrow + wlv->filler_lines
+#ifdef FEAT_PROP_POPUP
+ + wlv->text_prop_above_count
+#endif
+ ;
if ((wp->w_p_nu || wp->w_p_rnu)
- && (wlv->row == wlv->startrow + wlv->filler_lines || !has_cpo_n)
+ && (wlv->row <= lnum_row || !has_cpo_n)
// there is no line number in a wrapped line when "n" is in
// 'cpoptions', but 'breakindent' assumes it anyway.
&& !((has_cpo_n
@@ -366,10 +371,7 @@ handle_lnum_col(
// Draw the line number (empty space after wrapping).
// When there are text properties above the line put the line number
// below them.
- if (wlv->row == wlv->startrow + wlv->filler_lines
-#ifdef FEAT_PROP_POPUP
- + wlv->text_prop_above_count
-#endif
+ if (wlv->row == lnum_row
&& (wp->w_skipcol == 0 || wlv->row > wp->w_winrow
|| (wp->w_p_nu && wp->w_p_rnu)))
{
@@ -1695,6 +1697,8 @@ win_line(
{
area_highlighting = TRUE;
extra_check = TRUE;
+ // text props "above" move the line number down to where the
+ // text is.
for (int i = 0; i < text_prop_count; ++i)
if (text_props[i].tp_flags & TP_FLAG_ALIGN_ABOVE)
++wlv.text_prop_above_count;