Patch 8.2.3391
Problem: Crash with combination of 'linebreak' and other options.
Solution: Avoid n_extra to become negative. (Christian Brabandt,
closes #8817)
Files: src/drawline.c
*** ../vim-8.2.3390/src/drawline.c 2021-08-05 17:56:03.208718221 +0200
--- src/drawline.c 2021-08-30 22:12:32.645851577 +0200
***************
*** 1970,1986 ****
if (wp->w_p_lbr && c0 == c
&& VIM_ISBREAK(c) && !VIM_ISBREAK((int)*ptr))
{
! int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
! char_u *p = ptr - (mb_off + 1);
// TODO: is passing p for start of the line OK?
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
// We have just drawn the showbreak value, no need to add
! // space for it again
if (vcol == vcol_sbr)
n_extra -= MB_CHARLEN(get_showbreak_value(wp));
if (c == TAB && n_extra + col > wp->w_width)
# ifdef FEAT_VARTABS
--- 1970,1991 ----
if (wp->w_p_lbr && c0 == c
&& VIM_ISBREAK(c) && !VIM_ISBREAK((int)*ptr))
{
! int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1)
! : 0;
! char_u *p = ptr - (mb_off + 1);
// TODO: is passing p for start of the line OK?
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
// We have just drawn the showbreak value, no need to add
! // space for it again.
if (vcol == vcol_sbr)
+ {
n_extra -= MB_CHARLEN(get_showbreak_value(wp));
+ if (n_extra < 0)
+ n_extra = 0;
+ }
if (c == TAB && n_extra + col > wp->w_width)
# ifdef FEAT_VARTABS
*** ../vim-8.2.3390/src/version.c 2021-08-31 20:46:34.876123765 +0200
--- src/version.c 2021-08-31 20:57:07.922010233 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3391,
/**/
--
If you had to identify, in one word, the reason why the
human race has not achieved, and never will achieve, its
full potential, that word would be "meetings."
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202108311858.17VIwQ9i3954454%40masaka.moolenaar.net.