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:
Nathan Sobo
2012-11-01 14:50:51 -06:00
parent 9cbcc9e7e3
commit ea87c55db5

View File

@@ -87,7 +87,8 @@ class Selection
@editSession.buffer.getTextInRange(@getBufferRange())
clear: ->
@anchor?.destroy()
return unless @anchor
@anchor.destroy()
@anchor = null
@screenRangeChanged()