public/javascripts/codemirror/js/editor.js
function(direction) {
      if (!this.container.firstChild) return;
      // The line has to have up-to-date lexical information, so we
      // highlight it first.
      if (!this.highlightAtCursor()) return;
      var cursor = select.selectionTopNode(this.container, false);
      // If we couldn't determine the place of the cursor,
      // there's nothing to indent.
      if (cursor === false)
        return;
      var lineStart = startOfLine(cursor);
      var whiteSpace = this.indentLineAfter(lineStart, direction);
      if (cursor == lineStart && whiteSpace)
          cursor = whiteSpace;
      // This means the indentation has probably messed up the cursor.
      if (cursor == whiteSpace)
        select.focusAfterNode(cursor, this.container);
    }
function(direction) {
      if (!this.container.firstChild) return;
      // The line has to have up-to-date lexical information, so we
      // highlight it first.
      if (!this.highlightAtCursor()) return;
      var cursor = select.selectionTopNode(this.container, false);
      // If we couldn't determine the place of the cursor,
      // there's nothing to indent.
      if (cursor === false)
        return;
      var lineStart = startOfLine(cursor);
      var whiteSpace = this.indentLineAfter(lineStart, direction);
      if (cursor == lineStart && whiteSpace)
          cursor = whiteSpace;
      // This means the indentation has probably messed up the cursor.
      if (cursor == whiteSpace)
        select.focusAfterNode(cursor, this.container);
    }
function ( direction ) { if ( ! this . container . firstChild ) return ; // The line has to have up-to-date lexical information, so we // highlight it first. if ( ! this . highlightAtCursor ( ) ) return ; var cursor = select . selectionTopNode ( this . container , false ) ; // If we couldn't determine the place of the cursor, // there's nothing to indent. if ( cursor === false ) return ; var lineStart = startOfLine ( cursor ) ; var whiteSpace = this . indentLineAfter ( lineStart , direction ) ; if ( cursor == lineStart && whiteSpace ) cursor = whiteSpace ; // This means the indentation has probably messed up the cursor. if ( cursor == whiteSpace ) select . focusAfterNode ( cursor , this . container ) ; }
Adjust the amount of whitespace at the start of the line that the cursor is on so that it is indented properly.
Adjust the amount of whitespace at the start of the line that the cursor is on so that it is indented properly .