vim-patch:8.0.0503: endless loop in updating folds with 32 bit ints (#8433)

Problem:    Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
vim/vim@9d20ce6
This commit is contained in:
nthanben
2018-05-24 14:30:21 -07:00
committed by Justin M. Keyes
parent 418abfc9d0
commit c67139f8aa

View File

@@ -2445,7 +2445,7 @@ static linenr_T foldUpdateIEMSRecurse(garray_T *gap, int level,
if (lvl < level) {
/* End of fold found, update the length when it got shorter. */
if (fp->fd_len != flp->lnum - fp->fd_top) {
if (fp->fd_top + fp->fd_len > bot + 1) {
if (fp->fd_top + fp->fd_len - 1 > bot) {
/* fold continued below bot */
if (getlevel == foldlevelMarker
|| getlevel == foldlevelExpr