           position = new Point(row, column)
           results.push {scope, position, stop}
       else
-        # [TODO] Remove this when engine updated to >=1.9
+        # [TODO] REMOVE-on=displayLayer-is-out
         if tokenIterator.isHardTab?
           column += switch
             when tokenIterator.isHardTab() then 1

  atom.views.getView(model)

# Return function to restore editor's scrollTop and fold state.
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)
      editor.foldBufferRow(row)

  rangeStart.union(rangeEnd)

getTokenizedLineForRow = (editor, row) ->
  # [TODO] REMOVE-on=displayLayer-is-out
  tokenizedBuffer = editor.tokenizedBuffer ? editor.displayBuffer.tokenizedBuffer
  tokenizedBuffer.tokenizedLineForRow(row)

getScopesForTokenizedLine = (line) ->
  for tag in line.tags when tag < 0 and (tag % 2 is -1)
