@@ -45,13 +45,9 @@ function getSearchState(cm) {
4545 return cm . state . search || ( cm . state . search = new SearchState ( ) ) ;
4646}
4747
48- function queryCaseInsensitive ( query ) {
49- return typeof query == 'string' && query == query . toLowerCase ( ) ;
50- }
51-
5248function getSearchCursor ( cm , query , pos ) {
5349 // Heuristic: if the query string is all lowercase, do a case insensitive search.
54- return cm . getSearchCursor ( query , pos , queryCaseInsensitive ( query ) ) ;
50+ return cm . getSearchCursor ( query , pos , getSearchState ( cm ) . caseInsensitive ) ;
5551}
5652
5753function isMouseClick ( event ) {
@@ -294,15 +290,15 @@ function parseQuery(query) {
294290function startSearch ( cm , state , query ) {
295291 state . queryText = query ;
296292 state . query = parseQuery ( query ) ;
297- cm . removeOverlay ( state . overlay , queryCaseInsensitive ( state . query ) ) ;
298- state . overlay = searchOverlay ( state . query , queryCaseInsensitive ( state . query ) ) ;
293+ cm . removeOverlay ( state . overlay , state . caseInsensitive ) ;
294+ state . overlay = searchOverlay ( state . query , state . caseInsensitive ) ;
299295 cm . addOverlay ( state . overlay ) ;
300296 if ( cm . showMatchesOnScrollbar ) {
301297 if ( state . annotate ) {
302298 state . annotate . clear ( ) ;
303299 state . annotate = null ;
304300 }
305- state . annotate = cm . showMatchesOnScrollbar ( state . query , queryCaseInsensitive ( state . query ) ) ;
301+ state . annotate = cm . showMatchesOnScrollbar ( state . query , state . caseInsensitive ) ;
306302 }
307303}
308304
0 commit comments