mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add Workspace::getActiveEditor and Pane::getActiveEditor
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user