Can't make heads or tails of head & tail vs. start & end


#1

I’m getting confused with the seemingly overlapping concepts of head/tail, and start/end for markers. Some questions, with apologies if I have been to stupid to find the answers:

  • are markers’ heads the same as their start, and tails the same as ends, unless the marker is reversed? It appears so, but a confirmation would be helpful.

  • I would assume that, for a non-reversed marker, head comes before tail. But:

    1. Create a display marker with range (0,0) to (2,0):

          displayMarkerLayer = this.editor.addMarkerLayer()
          displayMarker = displayMarkerLayer.markBufferRange([[0,0],[2,0]])
      
    2. Check for the marker’s range. It is indeed lines 0 to 2:

         displayMarker.getBufferRange()
           -> Range {[..] end: Point column: 0 row: 2 start: Point column: 0 row: 0
      
  1. But: The head is actually at the end position, and tail is the start:

        displayMarker.getTailBufferPosition()
          -> Point {row: 0, column: 0}
        displayMarker.getHeadBufferPosition()
          -> Point {row: 2, column: 0}
    
  2. The marker is not reversed

        displayMarker.isReversed()
         -> false
    
  • Is displayMarker(Layer) a replacement for marker(Layer), or are these different APIs aimed at different layers within the architecture?

#3

See the documentation for “Head and Tail” in the DisplayMarker documentation: