From 3f7f3257770bf0556052cc6b62bf6bdd43b910fa Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 29 Dec 2013 19:57:49 +0400 Subject: [PATCH] return removed folds from removeFolds --- lib/ace/edit_session/folding.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ace/edit_session/folding.js b/lib/ace/edit_session/folding.js index 474818b2..09d67b95 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -454,13 +454,16 @@ function Folding() { if (expandInner) { this.removeFolds(folds); } else { - // TODO: might need to remove and add folds in one go instead of using + var subFolds = folds; + // TODO: might be better to remove and add folds in one go instead of using // expandFolds several times. - while (folds.length) { - this.expandFolds(folds); - folds = this.getFoldsInRangeList(range); + while (subFolds.length) { + this.expandFolds(subFolds); + subFolds = this.getFoldsInRangeList(range); } } + if (folds.length) + return folds; }; /*