# profile-builder/3.9.9/assets/lib/codemirror/addon/fold/indent-fold.js

User Profile Builder – Beautiful User Registration Forms, User Profiles &amp; User Role Editor, version 3.9.9. 13 lines.

- Page: https://pluginprobe.com/plugins/profile-builder/3.9.9/code/assets/lib/codemirror/addon/fold/indent-fold.js
- Raw: https://pluginprobe.com/plugins/profile-builder/3.9.9/raw/assets/lib/codemirror/addon/fold/indent-fold.js
- Modified: 2022-10-05T06:23:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/profile-builder/3.9.9/code/assets/lib/codemirror/addon/fold/indent-fold.js#L10-L20`.

```javascript
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

```
