@@ -45,13 +45,9 @@ function getSearchState(cm) {
45
45
return cm . state . search || ( cm . state . search = new SearchState ( ) ) ;
46
46
}
47
47
48
- function queryCaseInsensitive ( query ) {
49
- return typeof query == 'string' && query == query . toLowerCase ( ) ;
50
- }
51
-
52
48
function getSearchCursor ( cm , query , pos ) {
53
49
// 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 ) ;
55
51
}
56
52
57
53
function isMouseClick ( event ) {
@@ -294,15 +290,15 @@ function parseQuery(query) {
294
290
function startSearch ( cm , state , query ) {
295
291
state . queryText = query ;
296
292
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 ) ;
299
295
cm . addOverlay ( state . overlay ) ;
300
296
if ( cm . showMatchesOnScrollbar ) {
301
297
if ( state . annotate ) {
302
298
state . annotate . clear ( ) ;
303
299
state . annotate = null ;
304
300
}
305
- state . annotate = cm . showMatchesOnScrollbar ( state . query , queryCaseInsensitive ( state . query ) ) ;
301
+ state . annotate = cm . showMatchesOnScrollbar ( state . query , state . caseInsensitive ) ;
306
302
}
307
303
}
308
304
0 commit comments