aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-23 11:28:17 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-23 13:17:17 +0800
commit908f247c224db88ffd25e207314d41031519b128 (patch)
tree32cc38ad61372c1977f7e295c4e6a6a86acad510 /src
parenta1d71ad55e0f7149f284178b2d04ac78263b09ff (diff)
downloadrneovim-908f247c224db88ffd25e207314d41031519b128.tar.gz
rneovim-908f247c224db88ffd25e207314d41031519b128.tar.bz2
rneovim-908f247c224db88ffd25e207314d41031519b128.zip
fix(plines): count 'showbreak' for virtual text at eol
Diffstat (limited to 'src')
-rw-r--r--src/nvim/plines.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index ab4a12cd89..c2447103dc 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -494,7 +494,10 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
// string at start of line.
// Do not use 'showbreak' at the NUL after the text.
int head = mb_added;
- char *const sbr = c == NUL ? empty_option : get_showbreak_value(wp);
+ char *const sbr
+ // XXX: there should be a better check deeper below
+ = ((c == NUL && cts->cts_cur_text_width_left + cts->cts_cur_text_width_right == 0)
+ ? empty_option : get_showbreak_value(wp));
if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap) {
int col_off_prev = win_col_off(wp);
int width2 = wp->w_width_inner - col_off_prev + win_col_off2(wp);