Mercurial > vim
comparison src/fold.c @ 11234:8c153d400bf4 v8.0.0503
patch 8.0.0503: endless loop in updating folds with 32 bit ints
commit https://github.com/vim/vim/commit/9d20ce6970158de69202a82529d9e97827a9e71b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 23 21:53:35 2017 +0100
patch 8.0.0503: endless loop in updating folds with 32 bit ints
Problem: Endless loop in updating folds with 32 bit ints.
Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Mar 2017 22:00:04 +0100 |
parents | f0602688b8ef |
children | dc2800c3572b |
comparison
equal
deleted
inserted
replaced
11233:d6bf6847abad | 11234:8c153d400bf4 |
---|---|
2753 if (lvl < level) | 2753 if (lvl < level) |
2754 { | 2754 { |
2755 /* End of fold found, update the length when it got shorter. */ | 2755 /* End of fold found, update the length when it got shorter. */ |
2756 if (fp->fd_len != flp->lnum - fp->fd_top) | 2756 if (fp->fd_len != flp->lnum - fp->fd_top) |
2757 { | 2757 { |
2758 if (fp->fd_top + fp->fd_len > bot + 1) | 2758 if (fp->fd_top + fp->fd_len - 1 > bot) |
2759 { | 2759 { |
2760 /* fold continued below bot */ | 2760 /* fold continued below bot */ |
2761 if (getlevel == foldlevelMarker | 2761 if (getlevel == foldlevelMarker |
2762 || getlevel == foldlevelExpr | 2762 || getlevel == foldlevelExpr |
2763 || getlevel == foldlevelSyntax) | 2763 || getlevel == foldlevelSyntax) |