From ea87c55db5a8653ae7d589fd17d59ba883a37449 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 1 Nov 2012 14:50:51 -0600 Subject: [PATCH] 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. --- src/app/selection.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/selection.coffee b/src/app/selection.coffee index 95496dcbc..d0123566b 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -87,7 +87,8 @@ class Selection @editSession.buffer.getTextInRange(@getBufferRange()) clear: -> - @anchor?.destroy() + return unless @anchor + @anchor.destroy() @anchor = null @screenRangeChanged()