Skip to content
Browse files

[foldcode addon] Add an isFolded method

  • Loading branch information...
1 parent f9aa052 commit 55223f6003d372d84e631e3b257d1392187e58ef @marijnh marijnh committed Jan 28, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 addon/fold/foldcode.js
View
6 addon/fold/foldcode.js
@@ -62,6 +62,12 @@
doFold(this, pos, options, force);
});
+ CodeMirror.defineExtension("isFolded", function(pos) {
+ var marks = this.findMarksAt(pos);
+ for (var i = 0; i < marks.length; ++i)
+ if (marks[i].__isFold) return true;
+ });
+
CodeMirror.commands.fold = function(cm) {
cm.foldCode(cm.getCursor());
};

0 comments on commit 55223f6

Please sign in to comment.
Something went wrong with that request. Please try again.