public/javascripts/codemirror/js/editor.js
function(text) {
      this.history.commit();

      var start = select.cursorPos(this.container, true),
          end = select.cursorPos(this.container, false);
      if (!start || !end) return;

      end = this.replaceRange(start, end, text);
      select.setCursorPos(this.container, end);
      webkitLastLineHack(this.container);
    }
function(text) {
      this.history.commit();

      var start = select.cursorPos(this.container, true),
          end = select.cursorPos(this.container, false);
      if (!start || !end) return;

      end = this.replaceRange(start, end, text);
      select.setCursorPos(this.container, end);
      webkitLastLineHack(this.container);
    }
function ( text ) { this . history . commit ( ) ; var start = select . cursorPos ( this . container , true ) , end = select . cursorPos ( this . container , false ) ; if ( ! start || ! end ) return ; end = this . replaceRange ( start , end , text ) ; select . setCursorPos ( this . container , end ) ; webkitLastLineHack ( this . container ) ; }
Replace the selection with another piece of text.
Replace the selection with another piece of text .