Commit Graph

2522 Commits

Author SHA1 Message Date
Kevin Sawicki
19162db3ce Clip TextBuffer.characterIndexForPosition() position 2013-03-30 00:47:19 -04:00
Kevin Sawicki
da090b57d4 Use line ending length for mapping positions/characters
Previously the line ending length was hard-coded to one which
would cause TextBuffer.scanInRange() to return incorrect results
since one character per line wasn't being accounted for.

Closes #428
2013-03-30 00:30:54 -04:00
Kevin Sawicki
dc3b26c934 Add missing 't' in spec file name 2013-03-29 23:55:31 -04:00
probablycorey
d3920cdc05 Click and drag on the gutter selects lines correctly
Closes #352
2013-03-29 17:58:27 -07:00
probablycorey
05336dc38c Fix atom.version spec 2013-03-29 15:24:27 -07:00
Corey Johnson & Nathan Sobo
7d9e64a52d Mock getMaxTokensPerLine instead of overwriting member var 2013-03-29 11:22:01 -07:00
Kevin Sawicki
8e9a7355bc Return an empty array when the fs-utils.list() path isn't a directory
This makes the common case of iterating over an array of paths and
listing them cleaner since the return value doesn't need to be checked
before it is iterated over.
2013-03-29 13:44:03 -04:00
Kevin Sawicki
ff471ebf5b 💄 2013-03-28 22:08:53 -04:00
Kevin Sawicki
bd48cfced0 Don't track ctrl-click as the start of a selection
Closes #396
2013-03-28 22:06:56 -04:00
probablycorey
aab50d3c2c Only parse the first 100 tokens of a line
This fixes the UI thread lockup when there is a gigantic line in a
file (like minified js). I took a stab at making line tokeninization
async on the atom/async-single-line-tokenization branch, but it was
still too slow.

Closes #150
2013-03-28 17:14:45 -07:00
Kevin Sawicki
d54f2e6eab Only track selections that start with a left-click
Closes #396
2013-03-27 21:06:56 -04:00
probablycorey
72f57ad993 Remove old grammar view files 2013-03-27 17:34:14 -07:00
probablycorey
fd7772a653 Reset scrollLeft when setSoftWrapColumn is called
When the scroll view is scrolled and overflow-x is set to 
'hidden' the scroll view renders wrong. Setting scrollLeft to 0 fixes
this problem. I'm unhappy with this solution, but it was a
simple way to get the scroll view to update its layout.

Closes #137
2013-03-27 15:13:55 -07:00
probablycorey
a48a52922b Indent soft-wrap spec correctly 2013-03-27 15:13:55 -07:00
Kevin Sawicki
1d84274973 Return existing selections from addSelection()
Previously if a selection was added and then merged
away the selection-added event would still fire even
though the selection was already destroyed.

Now the existing selection that intersects with the
range is returned when the merge destroys the new selection.

Closes #374
2013-03-27 17:59:55 -04:00
probablycorey
a1b82e9dad Allow mini-editors to explicitly set their grammars 2013-03-27 11:00:53 -07:00
Cheng Zhao
b5be1c378a Replace Task's implementation with ProcessTask. 2013-03-27 12:25:54 +08:00
Cheng Zhao
142824ec01 Add test for ProcessTask. 2013-03-27 12:25:54 +08:00
Nathan Sobo
d3fa24be57 Remove scoped-properties when deactivating a TextMate package 2013-03-26 17:35:45 -06:00
Nathan Sobo
6a5ca3805e Spec loading of scoped properties when activating TextMate packages 2013-03-26 17:35:44 -06:00
Nathan Sobo
eef13e7db8 Test that deferred packages don't require their main module
As opposed to asserting that the main module isn't present, which
might not be true if a previous spec required it.
2013-03-26 17:35:44 -06:00
Nathan Sobo
e32d7b1ff1 Remove unused test.tmbundle 2013-03-26 17:35:44 -06:00
Nathan Sobo
1f74b5ccb4 Rename textmate package w/ invalid snippets 2013-03-26 17:35:44 -06:00
Nathan Sobo
a07cd87c2c Move testing of deferred deserializers to atom-spec 2013-03-26 17:35:44 -06:00
Nathan Sobo
2fe057bd9b Move deferred activation specs to atom-spec 2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
81d4b764b8 Remove a package's scoped-properties when it is deactivated
Also: don't add the properties until `activate` is called. Previously
we were still adding the properties in the `load` method, which was
wrong.
2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
c8ec73d2f0 Allow scoped-properties to be added/removed by name
Also:
  - remove "global" properties
  - clear scoped properties between specs
2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
368e10a9f5 Move spec for scoped property loading to atom-spec 2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
3c561ef208 💄 2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
c8b9622bf4 Move specs for loading config defaults to atom-spec 2013-03-26 17:35:44 -06:00
Corey Johnson & Nathan Sobo
5d822b7305 Remove a package's stylesheets when it is deactivated 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
1e51750b6c Remove a package's keymaps when it is deactivated 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
5410e9368f Add ability to add/remove keymaps by name 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
772787121c Remove atom package grammars on deactivate 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
c1954d869a Add tests for TextMateGrammar@loadSync 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
d37fbd43f1 Test that atom packages load their grammars 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
de7d9bfcb1 Get deactivatePackage specs passing w/ new fixture data 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
8c1f5658be Allow packages to have stylesheet manifests 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
b846a4db98 wip: cleanup package lifecycle specs 2013-03-26 17:35:43 -06:00
Corey Johnson
da016114b6 Add specs for activating and deactivating TextMate packages 2013-03-26 17:35:43 -06:00
Corey Johnson & Nathan Sobo
8437f3ff7f Only load TextMate packages as needed in specs
Also: when a TextMate package is deactivated, remove its grammars
2013-03-26 17:35:42 -06:00
Nathan Sobo
a41e3c1ebb Don't clear loaded packages between specs 2013-03-26 17:35:42 -06:00
Nathan Sobo
bb8b3782b9 Serialize package states independently of RootView
Previously, package specs needed to deactivate the root view to test
their package serialization. Now, specs can just deactivate and then
reactivate the package, relying on serialization infrastructure that's
independent of the lifecycle of the RootView.
2013-03-26 17:35:42 -06:00
Nathan Sobo
f5774972e9 Add atom.deactivatePackage(id)
It serializes the package state to the atom.packageStates hash when
the package is deactivated, which means we will be able to test 
package serialization independent of the overall window lifecycle by
just deactivating and re-activating the package.
2013-03-26 17:35:42 -06:00
Nathan Sobo
e3ddc3f29b Kill window.loadPackage spec helper. We use built-in methods now. 2013-03-26 17:35:42 -06:00
Nathan Sobo
58ef6c6582 Use atom.activatePackage directly in specs 2013-03-26 17:35:42 -06:00
probablycorey
187263173b Only exit specs on exceptions when exitWhenDone is true 2013-03-26 14:57:03 -07:00
probablycorey
60189c0135 exit(1) when spec-bootstrap throws an error 2013-03-26 14:20:03 -07:00
Kevin Sawicki
6d2805d782 Drop extension from requireStylesheet() 2013-03-26 00:15:32 -04:00
Kevin Sawicki
fab5842651 Support requiring stylesheets without an extension
Stylesheets will attempt to be resolved with both css
and less extensions if no extension is included in the
path specified to requireStylesheet().
2013-03-26 00:11:11 -04:00
Kevin Sawicki
513ed3b4b1 Show symlink file icon in tree view 2013-03-25 16:51:39 -04:00
Corey Johnson
ec4bb162c3 Add editor.showLineNumbers config option
Also adds toggle-line-numbers command. Closes #377
2013-03-25 10:38:06 -07:00
Kevin Sawicki
7756f8e86d Show ignored icon in status bar 2013-03-25 12:00:11 -04:00
Kevin Sawicki
0080e09065 Only check for back references in end patterns
Back references can occur in match values but should not
be treated differently when present there since they refer
to groups inside the match.

Close #370
2013-03-24 23:25:00 -04:00
Nathan Sobo
a05405370c Serialize the syntax object's grammar overrides with window state 2013-03-22 17:35:35 -06:00
Corey Johnson & Nathan Sobo
db4420e068 Move grammar overrides to syntax (no serialization yet) 2013-03-22 17:35:35 -06:00
Corey Johnson & Nathan Sobo
dacb00ed67 Simplify grammar selection and its specs 2013-03-22 17:35:34 -06:00
Nathan Sobo
a2f72882d7 Rename grammarForFilePath to selectGrammar
The old name was misleading because it the decision is based on the
file contents in some circumstances.
2013-03-22 17:35:27 -06:00
Nathan Sobo
ab934cfbfb Replace LoadTextMatePackagesTask with async grammar loading 2013-03-22 15:29:07 -06:00
Nathan Sobo
d3ead2a0d1 Update fs.list to use readdirSync and filterExtensions helper 2013-03-22 15:29:07 -06:00
Nathan Sobo
a5dcd71548 Add fs.listAsync 2013-03-22 15:29:07 -06:00
Kevin Sawicki & Nathan Sobo
e23edd02fd Use flexbox to position editor's gutter and scroll view
This removes the need to compute the width of the gutter based
on the line count in the editor and also removes the need to
set the scroll view's left position manually.
2013-03-22 12:47:56 -07:00
Corey Johnson & Nathan Sobo
84fe0a384d Pop grammar rules that result in infinite loops 2013-03-22 11:42:47 -07:00
Kevin Sawicki
712ba2c3fa Clear all syntax subscriptions after spec runs
The global syntax object is reused between specs so
each spec should start off with a clean listener list.
2013-03-21 18:46:08 -07:00
Corey Johnson & Nathan Sobo
1ad5327c99 Ensure we never load saved window in specs 2013-03-21 18:51:32 -06:00
Corey Johnson & Nathan Sobo
f4d339ccac Unify root view state with window state 2013-03-21 18:24:21 -06:00
Kevin Sawicki
f8ffe1c408 Only delete to end row when greater than start row
Closes #442
2013-03-21 17:07:36 -07:00
Corey Johnson & Nathan Sobo
2f3b4b9e5f Move scoped properties out of the grammar file and into a directory
Closes #435
2013-03-21 14:07:32 -07:00
Corey Johnson & Nathan Sobo
0b719bfecf Atom packages can load cson grammars and TextMate packages can't 2013-03-21 13:26:56 -07:00
Kevin Sawicki
77b7e71920 Move jasmine-helper from vendor/ to spec/ 2013-03-20 18:38:19 -07:00
Kevin Sawicki
8668998b1a Move jasmine-focused to spec folder
This JS file was previously loaded in the vendor folder
even though it was internally written.

It has also been converted to CoffeeScript.
2013-03-20 18:36:55 -07:00
Kevin Sawicki
661ef175d5 Remove $native.getPlatform()
process.platform should now be used instead.
2013-03-20 17:51:51 -07:00
Kevin Sawicki
61cc592605 Use absolute paths in Editor.reloadGrammar() specs 2013-03-20 15:04:20 -07:00
Kevin Sawicki & Nathan Sobo
501dc9b76c Merge remote-tracking branch 'origin/master' into cefode
Conflicts:
	native/v8_extensions/native.mm
	spec/app/config-spec.coffee
	spec/app/window-spec.coffee
	spec/spec-helper.coffee
	spec/stdlib/fs-utils-spec.coffee
	src/app/atom-package.coffee
	src/app/config.coffee
	src/app/window.coffee
	src/packages/fuzzy-finder/lib/load-paths-handler.coffee
	src/packages/markdown-preview/lib/markdown-preview-view.coffee
	src/packages/tree-view/spec/tree-view-spec.coffee
	src/stdlib/require.coffee
2013-03-20 10:46:50 -06:00
Corey Johnson & Nathan Sobo
10f405f61f Create preview list Dom elements only when needed 2013-03-19 11:30:48 -07:00
Nathan Sobo
875fbba024 Measure spec suite require time 2013-03-15 09:09:56 -06:00
Nathan Sobo
a1882ffd1f Move "GitHub" special-case to _.capitalize. Add specs. 2013-03-14 11:35:06 -06:00
Nathan Sobo
634117ed66 Make $.fn.document always take event name / doc string args
It's simpler and we don't use the other syntax right now.
2013-03-14 11:34:28 -06:00
Nathan Sobo
25839c5cf5 Add spec coverage for $.fn.command 2013-03-14 11:25:33 -06:00
Kevin Sawicki
8dbcb44d06 Rename traverseTree to traverseTreeSync
Also rename traverseTreeAsync to traverseTree
2013-03-13 14:40:31 -07:00
Corey Johnson
3ec74f3211 Move toExistOnDisk matcher to spec helper 2013-03-12 16:55:28 -07:00
Corey Johnson
c236325c1a Log errors (instead of crashing) when the config file cannot be parsed
Also, config won't overwrite changes to config.cson when the file can not be parsed. Closes #401
2013-03-12 16:47:26 -07:00
Corey Johnson
4755233f92 💄 2013-03-12 15:55:30 -07:00
Corey Johnson
d916962a80 Defer window close events until all modified pane items are handled
If the user presses cancel, the close event is canceled
2013-03-12 15:55:30 -07:00
Kevin Sawicki & Nathan Sobo
051decc08c Use fs.resolveOnLoadPath() instead of require.resolve() 2013-03-12 14:42:24 -07:00
Kevin Sawicki & Nathan Sobo
d8a3848c1a Round top position before comparing to height 2013-03-12 14:40:39 -07:00
Kevin Sawicki
96a949983c Use fs.resolveOnLoadPath() instead of require.resolve() 2013-03-12 13:33:25 -07:00
Kevin Sawicki & Nathan Sobo
1d1ba5f6d1 Use node's require instead of internal require 2013-03-12 10:38:05 -07:00
Corey Johnson
06b63c24dc Merge remote-tracking branch 'origin/dev' into md-preview-redux
Conflicts:
	src/packages/markdown-preview/stylesheets/markdown-preview.css
	static/atom.css
	static/command-panel.css
2013-03-11 17:02:36 -07:00
Corey Johnson & Nathan Sobo
7e03880bd0 Add $.fn.scrollUp and .scrollDown
These scroll the element by a small amount up or down.
2013-03-11 17:32:11 -06:00
Nathan Sobo
bf7fc39434 Rename AtomPackage.packageMain to .mainModule 2013-03-11 16:04:38 -06:00
Nathan Sobo
50b61f3a00 Test requiring of package main module via deferred deserializer 2013-03-11 15:20:51 -06:00
Nathan Sobo
10d0fdf2d7 Require a deferred package early if needed when deserializing panes
The requiring of a package's main module is now decoupled from package
activation. Non-deferred packages will always be required before the
panes are deserialized. This allows the package to register any
deserializers for objects displayed in the panes.

Deferred packages can contain a 'deferredDeserializers' array in their
package.cson. If we attempt to deserialize an object with a deserializer
in the list, the package's main module will be required first so it has
a chance to register the deserializer. But the package still won't be
activated until an activation event occurs.

We may want to add an additional optional hook called 'load' which is
called at require time. We would not guarantee that the rootView
global would exist, but we could give the package a chance to register
deserializers etc. For now, registering deserializers is a side-effect
of requiring the package.
2013-03-11 15:08:19 -06:00
Kevin Sawicki
03b32ec29c Use coffee-script node module
This required upgrading underscore which to fix issues
with _.isEqual working across objects created from different
documents.

The upgrade required adding a custom _.isEqual extension that
added back support for object's having an isEqual method that
was removed in underscore 1.4.0.
2013-03-11 13:39:17 -07:00
Kevin Sawicki
2212222c47 Use underscore node module 2013-03-11 11:22:36 -07:00
Corey Johnson & Nathan Sobo
478a376c97 Less files work in atom themes 2013-03-11 10:02:19 -07:00
probablycorey
9acd401b9e Use fixture files to requireStylesheet 2013-03-11 10:02:19 -07:00
Justin Palmer
050c376e87 remove old less require spec 2013-03-11 10:02:19 -07:00
Justin Palmer
0624ba6d3f rename remaining static css files to less 2013-03-11 10:02:19 -07:00
Justin Palmer
a448a79ae6 atom.css -> atom.less 2013-03-11 10:02:19 -07:00
Justin Palmer
2b66b033e0 add less parsing helper to spec helper 2013-03-11 10:02:19 -07:00
Justin Palmer
b502c811cb move less parsing to requireStylesheet 2013-03-11 10:02:18 -07:00
probablycorey
0b674978db Require will parse .less files into css 2013-03-11 10:02:18 -07:00
Kevin Sawicki
8cf32149b7 Return absolute paths from $native.traverseTree()
Previously relative paths were generated even though
things like fs.list() and fs.listTree() would just
recombine them with the root path.

Closes #391
2013-03-08 13:44:28 -08:00
Corey Johnson & Nathan Sobo
06c9a3ac86 Remove empty panes when PaneContainer deserializes 2013-03-08 11:45:20 -08:00
Kevin Sawicki
e7050b2083 Remove unused $native.lastModified() 2013-03-07 18:00:35 -08:00
Kevin Sawicki
acf5f4ce5e Remove fs/$native.getAllFilePathsAsync()
This was previously only used by project.getFilePath()
which should have been using fs.traverseTree() instead.
2013-03-07 17:48:36 -08:00
Kevin Sawicki
ce8867fac9 Remove unused ChildProcess class 2013-03-07 17:40:24 -08:00
Kevin Sawicki
c22d14c5b0 Use child_process.spawn from Project.scan 2013-03-07 17:36:21 -08:00
Kevin Sawicki
e36e3c0a78 Merge remote-tracking branch 'origin/dev' into cefode 2013-03-07 16:01:09 -08:00
Corey Johnson & Nathan Sobo
7e33bd17e0 Make markdown preview views fit into panes and work w/ a single buffer 2013-03-07 15:49:33 -08:00
Corey Johnson & Nathan Sobo
d84614866a Add Pane.getNextPane 2013-03-07 14:32:10 -08:00
Corey Johnson & Nathan Sobo
ff50bc2e6f Add toBeInstanceOf and toHaveLength jasmine matchers 2013-03-07 14:32:10 -08:00
Corey Johnson & Nathan Sobo
98c9012bdb 💩 2013-03-07 14:31:04 -08:00
Corey Johnson & Nathan Sobo
17f4d6f064 EditSession reloads its grammar on the 'grammars-loaded' event 2013-03-07 14:25:14 -08:00
Kevin Sawicki
b0ec0cda7f Merge remote-tracking branch 'origin/dev' into cefode 2013-03-07 11:44:46 -08:00
Corey Johnson & Nathan Sobo
39fabaa344 Update RootView.deserialize specs so they break on a version mismatch 2013-03-07 11:09:39 -08:00
Kevin Sawicki
d34796a78b Use oniguruma node module
This removes all internal native oniguruma
sources and starts using the node module
directly to create onig scanners and regexes.
2013-03-07 10:45:22 -08:00
Corey Johnson & Nathan Sobo
8333f14ef8 Throw away serialized state if its version doesn't match deserializer 2013-03-07 09:30:30 -08:00
Corey Johnson & Nathan Sobo
4f0bf9020b Fix pane focus and active item serialization
Also: Un-x root view serialization specs
2013-03-07 09:30:29 -08:00
Corey Johnson & Nathan Sobo
d4fc718e8e Update window title when a pane item's title changes 2013-03-07 09:30:29 -08:00
Corey Johnson & Nathan Sobo
c1d19c4c5c Rename restoreItem to reopenItem on pane container 2013-03-07 09:30:29 -08:00
Corey Johnson & Nathan Sobo
5ad53bb32c Add restoreItem to Pane container 2013-03-07 09:30:29 -08:00
Nathan Sobo
96fefe94f0 Fix broken specs after rebase 2013-03-07 09:30:29 -08:00
Nathan Sobo
f2e5fcc902 Move autosave from editor into panes 2013-03-07 09:30:29 -08:00
Nathan Sobo
d97e91bdcb Make meta-# bindings work with new panes 2013-03-07 09:30:29 -08:00
Nathan Sobo
f23d9091f2 Add pane:close-other-items 2013-03-07 09:30:29 -08:00
Nathan Sobo
4b8d786d2a 💄 2013-03-07 09:30:29 -08:00
Nathan Sobo
7ebce683c6 Move saveAll and specs to PaneContainer
And simplify the specs… we don't *really* need to save. We can just
ensure that save is called on everything.
2013-03-07 09:30:29 -08:00
Nathan Sobo
e4bf73b41c Give the view a chance to update before presenting next dialog 2013-03-07 09:30:28 -08:00
Nathan Sobo
f0398f2331 Ensure modal dialogs are presented in a coherent order
Modal dialogs can be presented while other modal dialogs are already
being displayed. Previously, dialogs were always displayed in the order
they were requested. But say you have two untitled buffers in a
pane and you close all items… You'll display prompt dialogs for both
buffers asking the user if they want to save. If the user answers yes
to the first dialog, they should see the path selection dialog before
they see the save prompt for the second buffer.

This commit uses a stack of queues to store deferred dialogs and allow
dialogs presented by the dismissal of another dialog to take precedence
over other pending dialogs.
2013-03-07 09:30:28 -08:00
Nathan Sobo
48c693d756 Add 'pane:close' event, which destroys all pane items.
Still have some issues with the presentation order of dialogs with
multiple unsaved buffers and no paths. But for the 99% case this works
as is.
2013-03-07 09:30:28 -08:00
Nathan Sobo
da986b6a6c Fix RootView.saveAll() 2013-03-07 09:30:28 -08:00
Nathan Sobo
685df18a3a Fix breakages due to save method moving to Pane (except saveAll specs) 2013-03-07 09:30:28 -08:00
Nathan Sobo
3f9ee08e76 Handle save-as on pane. Replace 'editor:save-as' w/ 'core:save-as'
Pane will only show the saveAs dialog if the item has a `saveAs` method.
2013-03-07 09:30:28 -08:00
Nathan Sobo
59a06acc0b Fire 'modified-status-changed' events on changes after save/reload
Buffer keeps state about the value with which it fired the last
modified-status-changed event so that it doesn't fire it twice with the
same boolean value. Every piece of code that triggers the event also
needs to set this state, so now everything goes through the
`triggerModifiedStatusChanged` method.
2013-03-07 09:30:28 -08:00
Nathan Sobo
699e780e99 Handle save in panes with new 'core:save' event 2013-03-07 09:30:28 -08:00
Nathan Sobo
6ae684d609 Kill commented specs that were used as a reminder 2013-03-07 09:30:28 -08:00
Nathan Sobo
54fc9efdcb Eliminate fixturesProject global. Use project global instead. 2013-03-07 09:30:27 -08:00
Nathan Sobo
9f7b804a6c Panes prompt to save modified items before destroying them 2013-03-07 09:30:27 -08:00
Nathan Sobo
d5654cf0df 💄 2013-03-07 09:30:27 -08:00
Nathan Sobo
298a963148 Rework Buffer's 'contents-modified' event
This event now fires whenever the content of the buffer changes (after 
a rate-limiting delay) with a single boolean indicating the modified
status of the buffer. There's now a separate event called
'modified-status-changed' to indicate events that change the boolean
value of the isModified method, so we don't need to fire
'contents-modified' when the underlying file is deleted for instance.
2013-03-07 09:30:27 -08:00
Nathan Sobo
24c9f11cc9 Trigger modified-status-changed on buffers/edit sessions 2013-03-07 09:30:27 -08:00
Corey Johnson & Nathan Sobo
ae95c04bbc Focus next pane when removing the last pane item of a focused pane
Previously, removing the last pane item also ruined our ability to 
determine if the pane had focus. Now, if we're removing the last item,
we instead just go ahead and remove the entire pane. Remove contains
logic to switch focus to the next pane if its active view is focused,
which works as intended if we leave the active view in place.
2013-03-07 09:30:26 -08:00
Corey Johnson & Nathan Sobo
52b649dca5 Preserve focus when switching between pane items
If the pane is currently focused, when showing a view associated with
a new item, focus that view.
2013-03-07 09:30:26 -08:00
Corey Johnson & Nathan Sobo
6157a75868 Spec changeFocus option of RootView.open and default it to true 2013-03-07 09:30:26 -08:00
Corey Johnson & Nathan Sobo
5291924bcc Set the project path when its first edit session is saved 2013-03-07 09:30:26 -08:00
Corey Johnson & Nathan Sobo
9a93694a4c 💄 2013-03-07 09:30:26 -08:00
Nathan Sobo
31f7d6669f Use project global in project spec 2013-03-07 09:30:26 -08:00
Nathan Sobo
2bfc73afaa These should have been renamed w/ currentView/Item -> activeView/Item 2013-03-07 09:30:25 -08:00
Nathan Sobo
fab3b4564e Add Pane.moveItemToPane specs. Fix bug moving the last edit session. 2013-03-07 09:30:25 -08:00
Nathan Sobo
fe0d3cad36 Remove multiple edit session handling from Editor 2013-03-07 09:30:25 -08:00
Nathan Sobo
2e2ff3a1d0 Add Pane.destroyItem and rename removeActiveItem -> destroyActiveItem
Pane.removeItem removes an item, but no longer tries to call destroy
on it. This will facilitate moving items between panes.
2013-03-07 09:30:24 -08:00
Nathan Sobo
887b5ea007 Add Pane.moveItem(item, index)
This is the precursor to supporting drag/drop of tabs within and
between panes.
2013-03-07 09:30:24 -08:00
Nathan Sobo
21990cf986 Add EditSession.getLongTitle 2013-03-07 09:30:24 -08:00
Nathan Sobo
de8198084c EditSession emits 'title-changed' events when its buffer path changes 2013-03-07 09:30:24 -08:00
Nathan Sobo
5240d9989f Pane emits 'pane:item-removed' events 2013-03-07 09:30:23 -08:00
Nathan Sobo
dd120663b7 Pane emits 'pane:item-added' events 2013-03-07 09:30:23 -08:00
Nathan Sobo
a40d05f6ee Rename Pane.currentItem/View to activeItem/View 2013-03-07 09:30:23 -08:00
Nathan Sobo
15d8a6cada Simplify pane:active-item-changed events
Panes now trigger an event every time their active item changes,
regardless of whether the pane itself is active. Panes also trigger
events when the become active and when they are removed. The rootView
now scopes its active-item-changed event listener only to active panes,
and also listens to listens to pane activation and removal events to
update the title when switching active panes and removing the last
pane.
2013-03-07 09:30:23 -08:00
Nathan Sobo
892ff0c51f Add PaneContainer.eachPane
It calls the given callback with all current and future panes
2013-03-07 09:30:23 -08:00
Nathan Sobo
20590f590e Make window specs pass without getActiveEditor/getEditors 2013-03-07 09:30:23 -08:00
Kevin Sawicki
a6bf7f876d Replace RootView.getActiveEditor() with getActiveView() 2013-03-07 09:30:23 -08:00
Kevin Sawicki
ff899e9c1b Replace RootView.getActiveEditor() with getActiveView() 2013-03-07 09:30:23 -08:00
Kevin Sawicki & Nathan Sobo
062adae714 Return the new pane's currentView when splitting the editor 2013-03-07 09:30:23 -08:00
Kevin Sawicki & Nathan Sobo
6304bac233 Remove RootView.getActiveEditor / getActiveEditSession
There's a bunch broken because of this… to be continued.
2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
2bf5163798 Kill pane specs on root view 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
26c63edf33 Assert against config for font-size changing events instead of editor 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
d6b85cf7e8 Base title updates on pane:active-item-changed events 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
3ae9c10ff5 Trigger 'pane:active-item-changed' w/ null when last pane is removed 2013-03-07 09:30:22 -08:00
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