mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Add ability to copy display buffer markers
This commit is contained in:
@@ -27,6 +27,9 @@ class DisplayBufferMarker
|
||||
|
||||
### Public ###
|
||||
|
||||
copy: (attributes) ->
|
||||
@displayBuffer.getMarker(@bufferMarker.copy(attributes).id)
|
||||
|
||||
# Gets the screen range of the display marker.
|
||||
#
|
||||
# Returns a {Range}.
|
||||
@@ -119,6 +122,9 @@ class DisplayBufferMarker
|
||||
clearTail: ->
|
||||
@bufferMarker.clearTail()
|
||||
|
||||
hasTail: ->
|
||||
@bufferMarker.hasTail()
|
||||
|
||||
# Returns whether the head precedes the tail in the buffer
|
||||
isReversed: ->
|
||||
@bufferMarker.isReversed()
|
||||
@@ -146,6 +152,13 @@ class DisplayBufferMarker
|
||||
@bufferMarker.destroy()
|
||||
@unsubscribe()
|
||||
|
||||
isEqual: (other) ->
|
||||
return false unless other instanceof @constructor
|
||||
@getBufferRange().isEqual(other.getBufferRange()) and
|
||||
@isReversed() is other.isReversed() and
|
||||
@hasTail() is other.hasTail() and
|
||||
_.isEqual(@getAttributes(), other.getAttributes())
|
||||
|
||||
# Returns a {String} representation of the marker
|
||||
inspect: ->
|
||||
"DisplayBufferMarker(id: #{@id}, bufferRange: #{@getBufferRange().inspect()})"
|
||||
|
||||
Reference in New Issue
Block a user