Allow for case insensitive project.scan searches

This commit is contained in:
probablycorey 2013-09-18 14:41:38 -07:00
parent e509e23a0f
commit 82de7009d5
2 changed files with 9 additions and 0 deletions

View File

@ -279,6 +279,14 @@ describe "Project", ->
expect(paths[3]).toMatch /quote".txt$/m
expect(path.basename(paths[4])).toBe "utfa\u0306.md"
it "ignores case if the regex includes the `i` flag", ->
matches = []
waitsForPromise ->
project.scan /DOLLAR/i, (match) -> matches.push(match)
runs ->
expect(matches).toHaveLength 1
it "handles breaks in the search subprocess's output following the filename", ->
spyOn(BufferedProcess.prototype, 'bufferStream')

View File

@ -337,6 +337,7 @@ class Project
args = ['--hidden', '--ackmate', regex.source, @getPath()]
ignoredNames = config.get('core.ignoredNames') ? []
args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0
args.unshift('--ignoreCase') if regex.ignoreCase
args.unshift('--addVCSIgnores') if config.get('core.excludeVcsIgnoredPaths')
new BufferedNodeProcess({command, args, stdout, stderr, exit})
deferred