Skip to content

Commit

Permalink
[foldcode addon] Add clearOnEnter option
Browse files Browse the repository at this point in the history
Add option 'clearOnEnter' to foldcode.js and default it to true.
This option determines whether the marker added when folding a
line clears when the cursor enters it.
  • Loading branch information
Sam Wilson authored and marijnh committed Jun 2, 2016
1 parent bb91581 commit bda854e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/fold/foldcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
});
var myRange = cm.markText(range.from, range.to, {
replacedWith: myWidget,
clearOnEnter: true,
clearOnEnter: getOption(cm, options, "clearOnEnter"),
__isFold: true
});
myRange.on("clear", function(from, to) {
Expand Down Expand Up @@ -129,7 +129,8 @@
rangeFinder: CodeMirror.fold.auto,
widget: "\u2194",
minFoldSize: 0,
scanUp: false
scanUp: false,
clearOnEnter: true
};

CodeMirror.defineOption("foldOptions", null);
Expand Down

0 comments on commit bda854e

Please sign in to comment.