aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornthanben <39383885+nthanben@users.noreply.github.com>2018-05-24 14:30:21 -0700
committerJustin M. Keyes <justinkz@gmail.com>2018-05-24 23:30:21 +0200
commitc67139f8aac54af9ea2095dd5028010910a588b3 (patch)
tree1e95c189c395d8221ab4f2d731e68382589de54d
parent418abfc9d06923e96f1317419fe83ed4e6d67c1d (diff)
downloadrneovim-c67139f8aac54af9ea2095dd5028010910a588b3.tar.gz
rneovim-c67139f8aac54af9ea2095dd5028010910a588b3.tar.bz2
rneovim-c67139f8aac54af9ea2095dd5028010910a588b3.zip
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
-rw-r--r--src/nvim/fold.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index ad9cd4d562..7a95f4ab0c 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -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