mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
EditSession.selectMarker checks if the marker is valid
Also, it returns the selected range if it's valid, and otherwise returns a falsy value. This has more utility than just true/false.
This commit is contained in:
@@ -1411,11 +1411,10 @@ class EditSession
|
||||
@getLastSelection().expandOverWord()
|
||||
|
||||
selectMarker: (marker) ->
|
||||
if bufferRange = marker.getBufferRange()
|
||||
@setSelectedBufferRange(bufferRange)
|
||||
true
|
||||
else
|
||||
false
|
||||
if marker.isValid()
|
||||
range = marker.getBufferRange()
|
||||
@setSelectedBufferRange(range)
|
||||
range
|
||||
|
||||
# Public: Given a buffer position, this finds all markers that contain the position.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user