Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Pane/PaneView API changes #2

Closed
wants to merge 3 commits into from
Closed

Pane/PaneView API changes #2

wants to merge 3 commits into from

Conversation

probablycorey
Copy link

This combines the Pane and PaneView APIs and removes some underused methods from the API.

One thing we might want to consider, move the split methods from Pane to
Workspace. I think conceptually it makes sense to split the Workspace rather
than a Pane.

probablycorey added 3 commits July 22, 2014 10:44
The matches for this method were mostly from 
Workspace::getActiveEditor. There ended up being only two actual uses.

hashrocket/lib/hashrocket.coffee
51:    editor = atom.workspace.activePane.getActiveEditor()

nucleus/lib/core/adapters/workspace/atom/workspace_adapter.js
38:		var editor = this.paneForPath(path).getActiveEditor();
::saveActiveItemAs() 0 0 0
::saveActiveItem() 0 0 0
::destroyInactiveItems() 0 0 0
::itemAtIndex(index) 0 0 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need this for completeness. Can I only operate on the active item?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take this back, I like ::getItems()[index] better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to leave it.

@benogle
Copy link
Contributor

benogle commented Jul 23, 2014

I like these dealing with item ordering:

    ::getItems()
    ::getActiveItem()
    ::addItem(item, index)
    ::activateItem(item)
    ::moveItem(item, newIndex)
    ::moveItemToPane(item, pane, index)

I feel like we should have an easier way to handle siblings. I think whatever we do here, we should have the item siblings behave the same as panes. So we could do

    ::getPrevious()
    ::getNext()
    Item::getPrevious()
    Item::getNext()

Though I think this might be hard because an item can be anything. So maybe we have

    ::getNextItem(item)
    ::getPreviousItem(item)
    Workspace::getNextPane(pane)
    Workspace::getPreviousPane(pane)

Use cases being: focusing the next pane, moving an item to the next pane, closing the previous pane, etc.

This was referenced Jul 23, 2014
@@ -405,24 +400,11 @@ Pane called packages a
::addItem(item, index) 10 9 0
::getActiveItem() 8 6 0
::splitDown(params) 7 6 1
::activateNextItem() 4 3 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want this in

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants