Sha256: ace22e3e441b54bbd699690e62a48932dc4fda8b0cac93c4ce1c40d396aa4569

Contents?: true

Size: 653 Bytes

Versions: 15

Compression:

Stored size: 653 Bytes

Contents

CodeMirror.registerHelper("fold", "indent", function(cm, start) {
  var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
  var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
  for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
    var curLine = cm.getLine(i);
    if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&
        CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)
      return {from: CodeMirror.Pos(start.line, firstLine.length),
              to: CodeMirror.Pos(i, curLine.length)};
  }
});
CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
codemirror-rails-3.18 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js
codemirror-rails-3.17 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
codemirror-rails-3.16 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/fold/indent-fold.js
codemirror-rails-3.15 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js