Files
atom/src/app/display-buffer-anchor-point.coffee
Nathan Sobo dfe0cad217 Replace anchor point/range with a single concept: markers
A "marker" is basically like a persistent selection/cursor composite,
having a head and a tail. The "head" is like the cursor in a selection,
and the "tail" is like the part of the selection that doesn't move. My
goal is for markers to be the only construct used to track regions
in the buffer. I want to replace anchors with them.
2013-01-30 16:52:09 -07:00

16 lines
414 B
CoffeeScript

module.exports =
class DisplayBufferAnchorPoint
bufferPosition: null
screenPosition: null
constructor: ({@displayBuffer, bufferPosition, screenPosition}) ->
{@buffer} = @displayBuffer
if screenPosition
bufferPosition = @displayBuffer.bufferPositionForScreenPosition(screenPosition)
@id = @buffer.createAnchorPoint(bufferPosition)
getBufferPosition: ->
@buffer.getAnchorPoint(@id)