comparison src/drawline.c @ 33103:61fc08239937 v9.0.1836

patch 9.0.1836: display wrong with virttext, linebreak and breakindent Commit: https://github.com/vim/vim/commit/ce53e3ea55d12d222a73510d772e786b7ae29c8d Author: zeertzjq <zeertzjq@outlook.com> Date: Fri Sep 1 18:49:30 2023 +0200 patch 9.0.1836: display wrong with virttext, linebreak and breakindent Problem: Wrong display with "above" virtual text and 'linebreak' or 'breakindent' and 'showbreak'. Solution: Exclude size of "above" virtual text when calculating them. closes: #13000 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Sep 2023 19:00:07 +0200
parents 0561bf3ba10c
children 22a29cc413c5
comparison
equal deleted inserted replaced
33102:e8d7f4f40a26 33103:61fc08239937
1648 return wlv.row; 1648 return wlv.row;
1649 wlv.screen_row += wlv.text_prop_above_count; 1649 wlv.screen_row += wlv.text_prop_above_count;
1650 } 1650 }
1651 #endif 1651 #endif
1652 1652
1653 #if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
1654 colnr_T vcol_first_char = 0;
1655 if (wp->w_p_lbr && !number_only)
1656 {
1657 chartabsize_T cts;
1658 init_chartabsize_arg(&cts, wp, lnum, 0, line, line);
1659 (void)win_lbr_chartabsize(&cts, NULL);
1660 vcol_first_char = cts.cts_first_char;
1661 clear_chartabsize_arg(&cts);
1662 }
1663 #endif
1664
1653 // 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the 1665 // 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
1654 // first character to be displayed. 1666 // first character to be displayed.
1655 if (wp->w_p_wrap) 1667 if (wp->w_p_wrap)
1656 v = startrow == 0 ? wp->w_skipcol - skipcol_in_text_prop_above : 0; 1668 v = startrow == 0 ? wp->w_skipcol - skipcol_in_text_prop_above : 0;
1657 else 1669 else
2877 int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) 2889 int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1)
2878 : 0; 2890 : 0;
2879 char_u *p = ptr - (mb_off + 1); 2891 char_u *p = ptr - (mb_off + 1);
2880 chartabsize_T cts; 2892 chartabsize_T cts;
2881 2893
2882 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p); 2894 init_chartabsize_arg(&cts, wp, lnum, wlv.vcol
2895 # ifdef FEAT_PROP_POPUP
2896 - vcol_first_char,
2897 # endif
2898 line, p);
2883 # ifdef FEAT_PROP_POPUP 2899 # ifdef FEAT_PROP_POPUP
2884 // do not want virtual text counted here 2900 // do not want virtual text counted here
2885 cts.cts_has_prop_with_text = FALSE; 2901 cts.cts_has_prop_with_text = FALSE;
2886 # endif 2902 # endif
2887 wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1; 2903 wlv.n_extra = win_lbr_chartabsize(&cts, NULL) - 1;