Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
correcting behaviour when Updating code folds in case of line deletions.
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Apr 14, 2015
1 parent 4cae24c commit 6194e27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ define(function (require, exports, module) {
var lineChanges = changeObj.text.length - changeObj.removed.length;
//update the lineFolds cache
updateFoldsCache(cm, changeObj.from.line, lineChanges);
if (lineChanges !== 0 && changeObj.from.line + lineChanges >= 0) {
updateFoldInfo(cm, changeObj.from.line + lineChanges, changeObj.from.line + lineChanges + 1);
if (lineChanges !== 0) {
updateFoldInfo(cm, Math.max(0, changeObj.from.line + lineChanges), Math.max(0, changeObj.from.line + lineChanges) + 1);
}
state.from = changeObj.from.line;
state.to = 0;
Expand Down

0 comments on commit 6194e27

Please sign in to comment.