From a2fcc7aa7a30111fe7fde8c7607ef9276f14a05d Mon Sep 17 00:00:00 2001 From: probablycorey Date: Tue, 11 Feb 2014 10:58:24 -0800 Subject: [PATCH] Add Workspace::getActiveEditor and Pane::getActiveEditor --- src/pane.coffee | 7 +++++++ src/workspace.coffee | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/pane.coffee b/src/pane.coffee index 6998ad938..763c37519 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -3,6 +3,7 @@ {Model, Sequence} = require 'theorist' Serializable = require 'serializable' PaneAxis = require './pane-axis' +Editor = require './editor' PaneView = null # Public: A container for multiple items, one of which is *active* at a given @@ -91,6 +92,12 @@ class Pane extends Model getActiveItem: -> @activeItem + # Public: Returns an {Editor} if the pane item is an {Editor}, or null + # otherwise. + getActiveEditor: -> + console.log + @activeItem if @activeItem instanceof Editor + # Public: Returns the item at the specified index. itemAtIndex: (index) -> @items[index] diff --git a/src/workspace.coffee b/src/workspace.coffee index d8cd563fa..c123131e7 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -155,6 +155,11 @@ class Workspace extends Model destroyActivePane: -> @activePane?.destroy() + # Public: Returns an {Editor} if the active pane item is an {Editor}, + # or null otherwise. + getActiveEditor: -> + @activePane?.getActiveEditor() + increaseFontSize: -> atom.config.set("editor.fontSize", atom.config.get("editor.fontSize") + 1)