Mercurial > vim
diff src/drawline.c @ 30213:4fedacdad3b4 v9.0.0442
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Commit: https://github.com/vim/vim/commit/79f8b8494cd4f738f25272ece94d8b524b99cb09
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 11 13:31:01 2022 +0100
patch 9.0.0442: virtual text "above" doesn't handel line numbers
Problem: Virtual text "above" doesn't handel line numbers.
Solution: Take the left column offset into account. (issue https://github.com/vim/vim/issues/11084)
Also make padding work.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Sep 2022 14:45:04 +0200 |
parents | ed6f3d2593df |
children | 0d084880276a |
line wrap: on
line diff
--- a/src/drawline.c +++ b/src/drawline.c @@ -350,7 +350,7 @@ text_prop_position( if (above) { before = 0; - after = wp->w_width - cells; + after = wp->w_width - cells - win_col_off(wp) - padding; } else { @@ -436,6 +436,8 @@ text_prop_position( *p_extra = l; *n_extra = n_used + before + after + padding; *n_attr = mb_charlen(*p_extra); + if (above) + *n_attr -= padding; *n_attr_skip = before + padding + col_off; } } @@ -1858,8 +1860,8 @@ win_line( dont_use_showbreak = TRUE; } #endif - if ((right || above || below || !wrap || padding > 0) - && wp->w_width > 2) + if ((right || above || below || !wrap + || padding > 0) && wp->w_width > 2) { char_u *prev_p_extra = wlv.p_extra; int start_line;