summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-11 21:02:09 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-11 21:02:09 +0100
commit7e017461e21ac534f8a0d59c1165d11358c69d87 (patch)
treeea89af10bbb69abf0fe0f55a23002f54ba6490e1 /src/drawline.c
parenta275f2cdcc4353e7653a69c7c818422db5da599d (diff)
patch 9.0.0725: virtual text "after" wraps to next line when 'wrap' is offv9.0.0725
Problem: Virtual text "after" wraps to next line even when 'wrap' is off and 'list' is set. Solution: Do not use the minimum width when 'wrap' is off. (issue #11336)
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 3a4156bc2f..bc39442132 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -583,8 +583,9 @@ textprop_size_after_trunc(
int strsize = 0;
int n_used;
- // if the remaining size is to small wrap anyway and use the next line
- if (space < PROP_TEXT_MIN_CELLS)
+ // if the remaining size is to small and 'wrap' is set we wrap anyway and
+ // use the next line
+ if (space < PROP_TEXT_MIN_CELLS && wp->w_p_wrap)
space += wp->w_width;
if (flags & (TP_FLAG_ALIGN_BELOW | TP_FLAG_ALIGN_ABOVE))
space -= padding;
@@ -658,7 +659,8 @@ text_prop_position(
? (col_with_padding <= col_off || !wp->w_p_wrap)
: (n_used < *n_extra)))
{
- if (right && (wrap || room < PROP_TEXT_MIN_CELLS))
+ if (right && (wrap
+ || (room < PROP_TEXT_MIN_CELLS && wp->w_p_wrap)))
{
// right-align on next line instead of wrapping if possible
before = wp->w_width - col_off - strsize + room;