From bda854e0711d3d1f21a0804aa4d3b6d972e3a930 Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Thu, 2 Jun 2016 13:36:20 -0400 Subject: [PATCH] [foldcode addon] Add clearOnEnter option 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. --- addon/fold/foldcode.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addon/fold/foldcode.js b/addon/fold/foldcode.js index 62911f9352..78b36c4641 100644 --- a/addon/fold/foldcode.js +++ b/addon/fold/foldcode.js @@ -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) { @@ -129,7 +129,8 @@ rangeFinder: CodeMirror.fold.auto, widget: "\u2194", minFoldSize: 0, - scanUp: false + scanUp: false, + clearOnEnter: true }; CodeMirror.defineOption("foldOptions", null);