summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-12 17:51:07 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-12 17:51:07 +0100
commitc9dc03fff5acf6fb91a923fb95006f9c2bca6141 (patch)
tree45b3d362479f364ff79f461d459e1f2a310319d3 /src/textprop.c
parent7b2d87220c6c974d5cdae672b6f9620a6bcbd1dc (diff)
downloadvim-git-c9dc03fff5acf6fb91a923fb95006f9c2bca6141.tar.gz
patch 9.0.0451: virtual text "above" does not work with 'nowrap'v9.0.0451
Problem: Virtual text "above" does not work with 'nowrap'. Solution: Do wrap the line after. (closes #11084)
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/textprop.c b/src/textprop.c
index ff96833f6..80b015167 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -608,12 +608,12 @@ get_text_props(buf_T *buf, linenr_T lnum, char_u **props, int will_change)
}
/*
- * Return the number of text properties with "below" alignment in line "lnum".
- * A "right" aligned property also goes below after a "below" or other "right"
- * aligned property.
+ * Return the number of text properties with "above" or "below" alignment in
+ * line "lnum". A "right" aligned property also goes below after a "below" or
+ * other "right" aligned property.
*/
int
-prop_count_below(buf_T *buf, linenr_T lnum)
+prop_count_above_below(buf_T *buf, linenr_T lnum)
{
char_u *props;
int count = get_text_props(buf, lnum, &props, FALSE);
@@ -636,6 +636,11 @@ prop_count_below(buf_T *buf, linenr_T lnum)
next_right_goes_below = TRUE;
++result;
}
+ else if (prop.tp_flags & TP_FLAG_ALIGN_ABOVE)
+ {
+ next_right_goes_below = FALSE;
+ ++result;
+ }
else if (prop.tp_flags & TP_FLAG_ALIGN_RIGHT)
next_right_goes_below = TRUE;
}