   ranges = [ranges] unless _.isArray(ranges)
   return null unless ranges.length
 
-  invalidate = options.invalidate ? 'never'
-  persistent = options.persistent ? false
   markers = ranges.map (range) ->
-    editor.markBufferRange(range, {invalidate, persistent})
+    editor.markBufferRange range,
+      invalidate: options.invalidate ? 'never'
+      persistent: options.persistent ? false
 
   for marker in markers
     editor.decorateMarker marker,

    tokenIterator = tokenizedLine.getTokenIterator()
    for tag in tokenizedLine.tags
      tokenIterator.next()
      if tag > 0
        column += switch
          when tokenIterator.isHardTab() then 1
          when tokenIterator.isSoftWrapIndentation() then 0
          else tag
      else if (tag % 2 is -1)
        scope = atom.grammars.scopeForId(tag)
        position = new Point(row, column)
        results.push {scope, position, stop}

    results = results.filter(isValidToken)
    results.reverse() if direction is 'backward'

saveEditorState = (editor) ->
  editorElement = getView(editor)
  scrollTop = editorElement.getScrollTop()

  if editor.displayLayer?
    foldMarkers = editor.displayLayer.findFoldMarkers({})
  else
    foldMarkers = editor.displayBuffer.findFoldMarkers({})

  foldStartRows = foldMarkers.map (m) -> m.getStartPosition().row
  ->
    for row in foldStartRows.reverse() when not editor.isFoldedAtBufferRow(row)
