Buffer.scanInRange can do a case-insensitive search

This commit is contained in:
Corey Johnson
2012-09-25 16:30:44 -07:00
parent 00f7796e93
commit 533ad84d03
2 changed files with 10 additions and 1 deletions

View File

@@ -297,7 +297,9 @@ class Buffer
scanInRange: (regex, range, iterator, reverse=false) ->
range = Range.fromObject(range)
global = regex.global
regex = new RegExp(regex.source, 'gm')
flags = "gm"
flags += "i" if regex.ignoreCase
regex = new RegExp(regex.source, flags)
startIndex = @characterIndexForPosition(range.start)
endIndex = @characterIndexForPosition(range.end)