Make bracket matcher work with new marker API

This commit is contained in:
Nathan Sobo
2013-04-29 10:43:09 -06:00
parent b16529bf9f
commit ae5e07ddd6

View File

@@ -168,11 +168,11 @@ module.exports =
autoCompleteOpeningBracket = @isOpeningBracket(text) and not hasWordAfterCursor and not (@isQuote(text) and hasWordBeforeCursor)
skipOverExistingClosingBracket = false
if @isClosingBracket(text) and nextCharacter == text
if bracketMarker = _.find(@bracketMarkers, (marker) => editSession.getMarkerBufferRange(marker)?.end.isEqual(cursorBufferPosition))
if bracketMarker = _.find(@bracketMarkers, (marker) => marker.isValid() and marker.getBufferRange().end.isEqual(cursorBufferPosition))
skipOverExistingClosingBracket = true
if skipOverExistingClosingBracket
editSession.destroyMarker(bracketMarker)
bracketMarker.destroy()
_.remove(@bracketMarkers, bracketMarker)
editSession.moveCursorRight()
false