     @suggestedIndentForTokenizedLineAtBufferRow(bufferRow, line, tokenizedLine, options)
 
   suggestedIndentForTokenizedLineAtBufferRow: (bufferRow, line, tokenizedLine, options) ->
+    # console.log tokenizedLine
     iterator = tokenizedLine.getTokenIterator()
     iterator.next()
     scopeDescriptor = new ScopeDescriptor(scopes: iterator.getScopes())
 
     increaseIndentRegex = @increaseIndentRegexForScopeDescriptor(scopeDescriptor)
+    decreaseThisIndentRegex = @decreaseThisIndentRegexForScopeDescriptor(scopeDescriptor)
     decreaseIndentRegex = @decreaseIndentRegexForScopeDescriptor(scopeDescriptor)
-    decreaseNextIndentRegex = @decreaseNextIndentRegexForScopeDescriptor(scopeDescriptor)
 
     if options?.skipBlankLines ? true
       precedingRow = @buffer.previousNonBlankRow(bufferRow)

    if pattern = @config.get(property, scope: scopeDescriptor)
      new OnigRegExp(pattern)

  increaseIndentRegexForScopeDescriptor: (scopeDescriptor) ->
    @getRegexForProperty(scopeDescriptor, 'editor.increaseIndentPattern')

  decreaseIndentRegexForScopeDescriptor: (scopeDescriptor) ->
    @getRegexForProperty(scopeDescriptor, 'editor.decreaseIndentPattern')

  decreaseNextIndentRegexForScopeDescriptor: (scopeDescriptor) ->
    @getRegexForProperty(scopeDescriptor, 'editor.decreaseNextIndentPattern')

  foldEndRegexForScopeDescriptor: (scopeDescriptor) ->
    @getRegexForProperty(scopeDescriptor, 'editor.foldEndPattern')

    indentLevel = @suggestedIndentForBufferRow(bufferRow, options)
    @editor.setIndentationForBufferRow(bufferRow, indentLevel, options)


  # Count the number of occurence of regex in string, given its tokenized
  # version, and ignoring any occurence that start inside a quoted string
  countRegex: (regex, string, tokenized) ->
    count = 0
    m = regex.searchSync(string)
    while (m)
      quoted = false
      if scopes = tokenized.tokenAtBufferColumn(m[0].start)?.scopes
        quoted = scope for scope in scopes when scope.match '^string.quoted'
      # console.log quoted
      count += 1 unless quoted
      m = regex.searchSync(string, m[0].start + 1)
    count

  # Given a buffer row, this decreases the indentation.
  #
  # bufferRow - The row {Number}
  autoDecreaseIndentForBufferRow: (bufferRow) ->
    scopeDescriptor = @editor.scopeDescriptorForBufferPosition([bufferRow, 0])
    return unless decreaseThisIndentRegex = @decreaseThisIndentRegexForScopeDescriptor(scopeDescriptor)

    line = @buffer.lineForRow(bufferRow)
    return unless decreaseThisIndentRegex.testSync(line)

    currentIndentLevel = @editor.indentationForBufferRow(bufferRow)
    return if currentIndentLevel is 0
