diff --git a/src/extensions/default/CodeFolding/foldhelpers/foldcode.js b/src/extensions/default/CodeFolding/foldhelpers/foldcode.js index 83b455a900f..b55366da628 100644 --- a/src/extensions/default/CodeFolding/foldhelpers/foldcode.js +++ b/src/extensions/default/CodeFolding/foldhelpers/foldcode.js @@ -139,7 +139,7 @@ define(function (require, exports, module) { keys.forEach(function (lineNumber) { lineNumber = +lineNumber; if (lineNumber >= cm.firstLine() && lineNumber <= cm.lastLine()) { - range = rf(cm, CodeMirror.Pos(lineNumber)); + range = rf(cm, CodeMirror.Pos(lineNumber, 0)); cachedRange = folds[lineNumber]; if (range && cachedRange && range.from.line === cachedRange.from.line && range.to.line === cachedRange.to.line) { diff --git a/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js b/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js index 1b9290cbf03..eda9cb6b414 100644 --- a/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js +++ b/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js @@ -92,7 +92,7 @@ define(function (require, exports, module) { var sr = _isCurrentlyFolded(i), // surrounding range for the current line if one exists range; var mark = marker("CodeMirror-foldgutter-blank"); - var pos = CodeMirror.Pos(i), + var pos = CodeMirror.Pos(i, 0), func = opts.rangeFinder || CodeMirror.fold.auto; // don't look inside collapsed ranges if (sr) { @@ -147,7 +147,7 @@ define(function (require, exports, module) { * @returns {TextMarker} A CodeMirror TextMarker object */ function getFoldOnLine(cm, line) { - var pos = CodeMirror.Pos(line); + var pos = CodeMirror.Pos(line, 0); var folds = cm.findMarksAt(pos) || []; folds = folds.filter(isFold); return folds.length ? folds[0] : undefined; @@ -220,7 +220,7 @@ define(function (require, exports, module) { if (linesDiff === 0) { if (foldedLines.indexOf(from) >= 0) { - newRange = rf(cm, CodeMirror.Pos(from)); + newRange = rf(cm, CodeMirror.Pos(from, 0)); if (newRange && newRange.to.line - newRange.from.line >= minFoldSize) { cm._lineFolds[from] = newRange; } else { diff --git a/src/extensions/default/CodeFolding/unittest-files/test.html b/src/extensions/default/CodeFolding/unittest-files/test.html index 25f9d4232f1..249fb8333bb 100644 --- a/src/extensions/default/CodeFolding/unittest-files/test.html +++ b/src/extensions/default/CodeFolding/unittest-files/test.html @@ -1,9 +1,17 @@
- + + -