mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Don't clear the selection if it's empty
This avoids emitting selection change events when they aren't really needed. This extra event was causing the highlighted line to be updated when it didn't need to be.
This commit is contained in:
@@ -87,7 +87,8 @@ class Selection
|
||||
@editSession.buffer.getTextInRange(@getBufferRange())
|
||||
|
||||
clear: ->
|
||||
@anchor?.destroy()
|
||||
return unless @anchor
|
||||
@anchor.destroy()
|
||||
@anchor = null
|
||||
@screenRangeChanged()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user