 # ## Mark
 # `mark(line, col, style)` will mark the first block after the given (line, col) coordinate
 # with the given style.
-Editor::mark = (line, col, style) ->
-  # Get the start of the given line.
-  lineStart = @tree.getNewlineBefore line
-
-  # Find the necessary indent for this line, so
-  # that we can properly adjust the column number
-  chars = 0
-  parent = lineStart.parent
-  until parent is @tree
-    if parent.type is 'indent'
-      chars += parent.prefix.length
-    parent = parent.parent
-
-  # Find the first block after the given column number
-  head = lineStart.next
-  until (chars >= col and head.type is 'blockStart') or head.type is 'newline'
-    chars += head.stringify().length
-    head = head.next
-
-  if head.type is 'newline'
-    return false
+Editor::mark = (location, style) ->
+  block = @tree.getFromLocation location
+  block = block.container ? block
 
   # `key` is a unique identifier for this
   # mark, to be used later for removal
   key = @nextMarkedBlockId++
 
   @markedBlocks[key] = {
-    model: head.container
+    model: block
     style: style
   }
 


    # Add the undo operation associated
    # with creating this floating block
    @pushUndo new FloatingOperation @draggingBlock, renderPoint, 'create'

    # Add this block to our list of floating blocks
    @floatingBlocks.push new FloatingBlockRecord(

    @redrawHighlights()

Editor::performFloatingOperation = (op, direction) ->
  if (op.type is 'create') is (direction is 'forward')
    @floatingBlocks.splice op.index, 0, new FloatingBlockRecord(
      op.block.clone()
      op.position
    )
  else
    @floatingBlocks.splice op.index, 1

class FloatingOperation
  constructor: (@index, @block, @position, @type) ->

# On mousedown, we can hit test for floating blocks.
hook 'mousedown', 5, (point, event, state) ->
