Sha256: 09c0e6d17de29662a5dba2dbbba85b216028d08a1e06a834f32cc826f2c92af2

Contents?: true

Size: 570 Bytes

Versions: 9

Compression:

Stored size: 570 Bytes

Contents

CodeMirror.indentRangeFinder = 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)};
  }
};

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
mdbe-0.1.0 public/libs/codemirror/addon/fold/indent-fold.js
codemirror-rails-3.14 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js
maglev-database-explorer-0.0.5 public/libs/codemirror/addon/fold/indent-fold.js
maglev-database-explorer-0.0.4 public/libs/codemirror/addon/fold/indent-fold.js
maglev-database-explorer-0.0.3 public/libs/codemirror/addon/fold/indent-fold.js
maglev-database-explorer-0.0.2 public/libs/codemirror/addon/fold/indent-fold.js
maglev-database-explorer-0.0.1 public/libs/codemirror/addon/fold/indent-fold.js
codemirror-rails-3.13 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js
codemirror-rails-3.12 vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js