mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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.
16 lines
414 B
CoffeeScript
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)
|
|
|