     # if we are in a string, this tells us what character introduced the string
     # i.e., did this string start with ' or with "?
     stringDelimiter = []
+
+    # NOTE: this parsing will only be correct if the python code is well-formed
+    #       statements like "[0, (1, 2])" might break the parsing
 
     # loop over each line, adding to each stack
     for row in [0 .. lines.length-1]


    # I'm glad Atom has an optional `column` param to subtract spaces from
    # soft-tabs, though I don't see it used anywhere in the core.

    console.log('tabs:', tabs, 'offset:', offset)

    indent = editor.buildIndentString(tabs, column=offset)

    console.log('len:', indent.length, 'str: "', indent, '"')

    # Set the indent
    editor.getBuffer().setTextInRange([[row, 0], [row, editor.indentationForBufferRow(row) * tabLength]], indent)


  parseLines: (lines) ->

    row = editor.getCursorBufferPosition().row
    col = editor.getCursorBufferPosition().column

    # Parse the entire file up to the current point, keeping track of brackets
    lines = editor.getTextInBufferRange([[0,0], [row, col]]).split('\n')

    # A stack of [row, col] pairs describing where open brackets are
    bracketStack = PythonIndent.parseLines(lines)

    return unless bracketStack.length

    # bracketStack.pop()[1] is the column where the bracket was, so need to bump by one
    indentColumn = bracketStack.pop()[1] + 1

    # Get tab length for context
    tabLength = editor.getTabLength()

    # Calculate soft-tabs from spaces (can have remainder)
    tabs = (indentColumn / tabLength)
    rem = ((tabs - Math.floor(tabs)) * tabLength)

    # If there's a remainder, `editor.buildIndentString` requires the tab to
    # be set past the desired indentation level, thus the ceiling.
    # TODO: is the conditional necessary? Maybe to avoid floating point errors?
    tabs = if rem > 0 then Math.ceil tabs else tabs

    # Offset is the number of spaces to subtract from the soft-tabs if they
