Use backwardsScanInRange instead of passing true

This commit is contained in:
Nathan Sobo
2013-04-03 11:03:45 -06:00
parent 11f140ac5a
commit 68a02fe009

View File

@@ -116,14 +116,13 @@ module.exports =
regex = new RegExp("[#{_.escapeRegExp(startPair + endPair)}]", 'g')
startPairPosition = null
unpairedCount = 0
scanner = (match, range, {stop}) =>
buffer.backwardsScanInRange regex, scanRange, (match, range, {stop}) =>
if match[0] is endPair
unpairedCount++
else if match[0] is startPair
unpairedCount--
startPairPosition = range.start
stop() if unpairedCount < 0
buffer.scanInRange(regex, scanRange, scanner, true)
startPairPosition
updateMatch: (editor) ->