public/javascripts/codemirror/js/editor.js
function() {
        var line = cleanText(self.history.textAfter(self.line).slice(self.offset));
        var match = (self.caseFold ? line.toLowerCase() : line).indexOf(string);
        if (match > -1)
          return {from: {node: self.line, offset: self.offset + match},
                  to: {node: self.line, offset: self.offset + match + string.length}};
      }
function() {
        var line = cleanText(self.history.textAfter(self.line).slice(self.offset));
        var match = (self.caseFold ? line.toLowerCase() : line).indexOf(string);
        if (match > -1)
          return {from: {node: self.line, offset: self.offset + match},
                  to: {node: self.line, offset: self.offset + match + string.length}};
      }
function ( ) { var line = cleanText ( self . history . textAfter ( self . line ) . slice ( self . offset ) ) ; var match = ( self . caseFold ? line . toLowerCase ( ) : line ) . indexOf ( string ) ; if ( match > - 1 ) return { from : { node : self . line , offset : self . offset + match } , to : { node : self . line , offset : self . offset + match + string . length } } ; }
For one-line strings, searching can be done simply by calling indexOf on the current line.
For one - line strings searching can be done simply by calling indexOf on the current line .