Commit Graph

2202 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
161ed69ef0 When a pane is removed, focus/activate the next pane 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
80e736d4ee Add RootView.getActiveView and .getActivePaneItem
They will replace getActiveEditor/getActiveEditSession
2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
58228f7ff7 Remove RootView.activeKeybindings method. It was dead code. 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
4a6f05ae4e Trigger 'pane:active-item-changed' on Pane
This event is triggered when the item changes on the active pane, or
when a different pane becomes active.

Also: Pane now sets itself as the active pane, rather than letting
PaneContainer handle the focusin event.
2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
ad62f896bc Make Pane maintain a currentView pointer based on its current item 2013-03-07 09:30:21 -08:00
Kevin Sawicki & Nathan Sobo
d310fb366f Remove references to RootView from editor spec 2013-03-07 09:30:21 -08:00
Nathan Sobo
486baa393b PaneContainer.getActivePane returns the most recently focused pane 2013-03-07 09:28:52 -08:00
Nathan Sobo
2ba63e608f Don't allow core:close event to bubble out of Pane 2013-03-07 09:28:52 -08:00
Nathan Sobo
8f980a0f20 Replace Editor's next/previous edit session bindings w/ pane bindings 2013-03-07 09:28:52 -08:00
Nathan Sobo
bd8ec81b1e Make Pane close the current item when handling 'core:close' event 2013-03-07 09:28:52 -08:00
Nathan Sobo
11a702a2a6 Remove pane when its last item is removed 2013-03-07 09:28:52 -08:00
Nathan Sobo
7d147dd2ce Make Pane handle split commands instead of Editor 2013-03-07 09:28:52 -08:00
Nathan Sobo
fee835f899 Add a PaneContainer subview for RootView
PaneContainer is responsible for all pane-related logic. Laying them
out, switching focus between them, etc. This should help make RootView
simpler and keep pane-layout related tests in their own focused area.
2013-03-07 09:28:52 -08:00
Nathan Sobo
9ecb03e470 Rename PaneGrid to PaneAxis
PaneGrid is a superclass of PaneRow and PaneColumn. These are both
a type of axis for the pane layout system.
2013-03-07 09:28:52 -08:00
Nathan Sobo
19e2cab920 💄 2013-03-07 09:28:52 -08:00
Nathan Sobo
0c2a5f273c Enhance pane split methods. Spec them in pane-spec.
When a pane is split, it attempts to make a copy of its current item
if no items are passed to the split method. When splitting, multiple
items can also be passed to the constructor of the new pane.
2013-03-07 09:28:52 -08:00
Nathan Sobo
45eec6a8ff Get more specs passing. Failing specs due to missing features. 2013-03-07 09:28:52 -08:00
Nathan Sobo
281a28bb0e Add spec for pane focusing the its current item view when it's focused 2013-03-07 09:28:52 -08:00
Nathan Sobo
568fcf441e Pane serializes its serializable items 2013-03-07 09:28:52 -08:00
Nathan Sobo
bee1efed5c Make RootView.open work with new Pane behavior
Still a bit of a WIP. Panes don't yet take the "active" class
correctly when focused.
2013-03-07 09:28:51 -08:00
Nathan Sobo
829bfa0a10 Add Pane.itemForPath 2013-03-07 09:28:51 -08:00
Nathan Sobo
62729c42ee Panes destroy their items when they are removed
As a consequence of these changes, editors will no longer need to
listen for destruction of their edit sessions. An editor will
eventually only ever be displaying a single edit session, and the
editor will destroy that edit session when it is removed. Panes
will be responsible for supporting multiple edit sessions, and
they will automatically remove the editor when they have no more
edit session items.
2013-03-07 09:28:51 -08:00
Nathan Sobo
77bf3e4d74 Get root view pane specs passing 2013-03-07 09:28:51 -08:00
Nathan Sobo
d89a7eb522 When showing an item on a pane, add it to the items list if needed 2013-03-07 09:28:51 -08:00
Nathan Sobo
41f18ee6a2 Add Pane.removeItem 2013-03-07 09:28:51 -08:00
Nathan Sobo
ef0c62f532 Add show next / previous item. 2013-03-07 09:28:51 -08:00
Nathan Sobo
372393d9ca Allow panes to have model objects as items in addition to views
The problem I've been struggling with is that we need to potentially 
assign tabs both to EditSessions and also to other views added by
extensions, like a markdown preview view. EditSessions are however not
actually views… instead they plug into editors. The solution is to
have the pane ask a model object what view should be used to render
it. When asked to show a non-view item, the pane constructs and
appends a view for that item or recycles an appropriate view that it
has already appended.
2013-03-07 09:28:51 -08:00
Nathan Sobo
2bdc077d2a Construct Pane w/ multiple items. Show first item on construction. 2013-03-07 09:28:51 -08:00
Nathan Sobo
beaeac4425 Rename buildEditSessionForPath to buildEditSession
Since this is the more external method, having a shorter name
is more convenient. The former `buildEditSession` method took a
Buffer, and is now called `buildEditSessionForBuffer`.
2013-03-07 09:28:51 -08:00
Kevin Sawicki
8af55a04d8 Use a single worker for status refreshes
There still appear to be crashes occurring when
using libgit2 from multiple workers at the same time.

So only start a new status worker once the current one
completes if a refresh was requested while a worker was
running.

Closes #367
2013-03-06 14:59:12 -08:00
probablycorey
081e3a459f Replace Consolas with PCMyungjo in spec 2013-03-05 15:55:38 -08:00
Corey Johnson & Kevin Sawicki
7eee81cd6a Return early when clipping tokenless screenline
Closes #337
2013-03-05 10:44:15 -08:00
Corey Johnson & Kevin Sawicki
94099358f3 Inserting whitespace never auto-outdents
Closes #340

Shout out to @nathansobo
2013-03-05 10:19:24 -08:00
probablycorey
37e4091723 💩 2013-03-05 10:13:18 -08:00
probablycorey
17fc679b25 Trigger resize event on editor before wrap guide specs 2013-03-05 09:43:38 -08:00
Kevin Sawicki
1c09a1352b Return {} when object is empty 2013-03-05 08:46:17 -08:00
Kevin Sawicki
5ddea28d80 Wrap objects inside arrays in {} 2013-03-05 08:42:24 -08:00
Kevin Sawicki
c14aa3b86f Default status to 0 if undefined
This keeps the status-changed event from triggering
the first time the status is requested as it goes
from undefined to 0 which should be treated as no
change.
2013-03-04 21:43:34 -08:00
Kevin Sawicki
3852b7212b Remove git-status-changed event from Buffer
This is now fired as a status-changed event from
the Git class when the checkout completes normally
and the status of the path changes.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
31690d16ec Remove unused import 2013-03-04 21:43:33 -08:00
Kevin Sawicki
4fe6db240b Consolidate Git status checking
Now the status bar and tree view both listen for
status change events and use the cached information
available from the git object to update their views.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
2ec4d558ba Make project's Git repository a window global
This allows it to operate independently of the
project and mirror the availability of the root view
and project.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
68b61d71c6 Trigger event when path status changes 2013-03-04 21:43:32 -08:00
Kevin Sawicki
c6e89d33f8 Git.refreshStatuses() -> Git.refreshStatus() 2013-03-04 21:43:32 -08:00
Kevin Sawicki
50bc1aac74 Add task to refresh status of repository
By default this will occur when the window gains
focus and the Git class can now be subscribed to
so listeners can become notified when the status
of a repository changes.
2013-03-04 21:43:32 -08:00
Kevin Sawicki
4add7b6213 Support getting status of entire repository
New Git.getAllStatuses() method returns all non-ignored
status entries in the repository.
2013-03-04 21:43:32 -08:00
probablycorey
30d4cb81b8 Use Courier as the default font for specs
Fixes #323
2013-03-04 16:40:02 -08:00
probablycorey
b7976cac68 Use the /Applications directory to test cwd on Child Processes 2013-03-01 13:54:19 -08:00
Corey Johnson
595cf71d93 Return absolute path for Git repo 2013-03-01 13:54:19 -08:00
Corey Johnson & Kevin Sawicki
ec2f59836a Make patch version segment optional in spec 2013-02-28 10:15:24 -08:00