From 99d70b4a4e5343a1ca08f35cd5a56482c8183618 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 27 Aug 2014 11:56:58 -0600 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20emit=20::onDidChangeActiveItem?= =?UTF-8?q?=20events=20unless=20it=20really=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pane.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 33846fd8c..0202f3249 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -156,8 +156,10 @@ class Pane extends Model getActiveItem: -> @activeItem - setActiveItem: (@activeItem) -> - @emitter.emit 'did-change-active-item', @activeItem + setActiveItem: (activeItem) -> + unless activeItem is @activeItem + @activeItem = activeItem + @emitter.emit 'did-change-active-item', @activeItem @activeItem # Public: Returns an {Editor} if the pane item is an {Editor}, or null