Comparar commits

...

1610 Commits

Autor SHA1 Mensagem Data
Kevin Sawicki 8acd84c7e2 Pull stdout out of results argument 2014-01-14 16:39:14 -08:00
Kevin Sawicki a53d223b6f Use package.json version in master builds only 2014-01-14 16:25:22 -08:00
Kevin Sawicki 673b78561a Rename set-development-version task to set-version 2014-01-14 16:16:31 -08:00
Kevin Sawicki 57c56fc46e Use package.json version in master janky builds 2014-01-14 16:16:28 -08:00
Kevin Sawicki d81fb8cabf Sign right before publishing 2014-01-14 16:03:58 -08:00
Kevin Sawicki 1dec9d0ad2 Run codesign task after build task 2014-01-14 15:31:49 -08:00
Kevin Sawicki a342a18440 Merge pull request #1413 from atom/ks-no-more-constructicon
Get off constructicon
2014-01-14 13:39:59 -08:00
Kevin Sawicki 047425c564 Rename createRelease to createBuildRelease 2014-01-14 13:29:35 -08:00
Kevin Sawicki 8374911dab Delete existing asset before uploading new one 2014-01-14 13:29:35 -08:00
Kevin Sawicki 6ca3c90abe Use upload urls instead of assets url 2014-01-14 13:29:35 -08:00
Kevin Sawicki 96cb266c27 Release properties are _ separated 2014-01-14 13:29:35 -08:00
Kevin Sawicki 21723b155e Remove unneeded assets prefix 2014-01-14 13:29:34 -08:00
Kevin Sawicki 14c3feee17 Publish master builds to the draft release 2014-01-14 13:29:34 -08:00
Kevin Sawicki 0255f1e223 Remove unused require 2014-01-14 13:29:34 -08:00
Kevin Sawicki 76a5912126 Update expected callback name 2014-01-14 13:29:34 -08:00
Kevin Sawicki 848dc12f28 Add unlock-keychain arg 2014-01-14 13:29:34 -08:00
Kevin Sawicki 7a41fabf60 Unlock keychain before signing 2014-01-14 13:29:34 -08:00
Kevin Sawicki f4b82fe3a4 Load env vars from /var/lib/jenkins/config/xcodekeychain 2014-01-14 13:29:34 -08:00
Kevin Sawicki aec32b65a0 Remove constructicon files 2014-01-14 13:29:34 -08:00
Kevin Sawicki 01e0970406 Sign CI builds 2014-01-14 13:29:34 -08:00
Kevin Sawicki b08978a431 Add back linting of build files 2014-01-14 13:28:30 -08:00
Kevin Sawicki b72028c68d Invoke deploy task using script/grunt 2014-01-14 10:03:05 -08:00
Kevin Sawicki 332b918c01 Ignore build/atom.build 2014-01-14 10:03:05 -08:00
Kevin Sawicki bc94dc63e6 Ignore atom.xcodeproj 2014-01-14 10:03:05 -08:00
Nathan Sobo adb174ef5f Remove pane-model, which should have been removed during rename
Missed this somehow.
2014-01-14 10:57:50 -07:00
Kevin Sawicki d3a016bf69 Delete build/node_modules before bootstrapping 2014-01-14 09:43:03 -08:00
Nathan Sobo 6ef6fb77f9 Rename pane-*-model specs 2014-01-13 17:22:02 -07:00
Nathan Sobo 159adcb00c Bump serialization version on WorkspaceView
Since we've replaced views with models, the 'PaneContainer' deserializer
now loads a model instead of a view, which isn't what we want at this
layer.
2014-01-13 16:57:17 -07:00
Kevin Sawicki 12bf0f5381 Delete apm's node_modules folders on clean 2014-01-13 14:51:24 -08:00
Nathan Sobo 08716fd888 Merge pull request #1410 from atom/ns-rename-pane-views
Add -View suffix to pane views and remove -Model suffix from pane models
2014-01-13 13:39:13 -08:00
Kevin Sawicki 16c86047eb Add buffer delegates for getLineCount/getTextInRange 2014-01-13 13:30:32 -08:00
Nathan Sobo 97999f1080 Rename PaneContainerModel to PaneContainer 2014-01-13 13:56:31 -07:00
Nathan Sobo a268b3e963 Rename PaneAxisModel to PaneAxis 2014-01-13 13:54:04 -07:00
Nathan Sobo 8931bf8f3a Rename PaneModel to Pane 2014-01-13 13:51:15 -07:00
Nathan Sobo 918c31905f Rename PaneContainer to PaneContainerView 2014-01-13 13:46:28 -07:00
Nathan Sobo c7ff4f9897 Rename PaneAxis to PaneAxisView 2014-01-13 13:46:27 -07:00
Nathan Sobo 4f604ced3c Rename Pane to PaneView 2014-01-13 13:46:22 -07:00
Nathan Sobo a29c18f8c0 And again 2014-01-13 13:14:41 -07:00
Nathan Sobo 43f517abff Fix botched merge of package.json. Sorry. 2014-01-13 13:13:57 -07:00
Nathan Sobo 8b901f81e0 Merge pull request #1379 from atom/cj-ns-pane-models
Separate models from PaneContainer, PaneAxis, and Pane
2014-01-13 12:08:34 -08:00
Nathan Sobo fe0cdbf349 Merge remote-tracking branch 'origin/master' into cj-ns-pane-models
Conflicts:
	package.json
2014-01-13 12:55:02 -07:00
Kevin Sawicki c2381ba61c Upgrade to timecop@0.13.0 2014-01-13 11:40:01 -08:00
Nathan Sobo 4179d9d268 Add deprecated Pane::removeItem 2014-01-12 17:55:29 -07:00
Nathan Sobo 3fc3d48def Destroy empty panes after deserializing
Fixes #1399
2014-01-12 17:53:25 -07:00
Nathan Sobo b438b311f3 Rename showItem methods to activateItem
These methods set the *active* item, so the verb activate provides a
clearer correspondence. We could change the noun to "shown" item, but
that's awkward and having both active panes and active items is a nice
correspondence in terminology.
2014-01-12 17:40:57 -07:00
Nathan Sobo 561e31c0c5 Remove ::removeItemAtIndex and make ::removeItem private
Call ::destroyItem or just destroy the item directly (it should emit the
'destroyed' event)
2014-01-12 17:25:51 -07:00
Nathan Sobo 2a8a5268c6 Clean up PaneModel api docs 2014-01-11 22:09:10 -07:00
Nathan Sobo 28b085be1c Rename ::makeActive to ::activate and focus panes when they're activated 2014-01-11 20:48:01 -07:00
Nathan Sobo f5bc71e559 Move $.fn.hasFocus to space-pen 2014-01-11 19:49:25 -07:00
Nathan Sobo 2188dd201d Update wrap-guide to 0.11.0 for specs fix with flexbox panes 2014-01-11 19:28:33 -07:00
Nathan Sobo b21eb6f934 Drop .flexbox-repaint-hack div and use pseudo selector instead
We don't actually need structural markup to ensure that all pane views
are absolutely positioned. We can just use the `> *` selector inside of
.pane-items.

/cc @probablycorey is there anything I'm missing here?
2014-01-11 19:13:00 -07:00
Kevin Sawicki 9b0d8ec242 💄 Sort dependencies 2014-01-11 17:51:59 -08:00
Kevin Sawicki 3c32a8e8fb Throw error when sending to terminated process
Mirrors behavior of start method
2014-01-11 17:23:53 -08:00
Nathan Sobo 3ab7836ab2 Upgrade to emissary 0.31.0 for implicit 'value' subscriptions on signals
Previously, when you always had to specify the event name of 'value'
when calling `::subscribe` with a signal. Now, if you don't specify an
event name, 'value' is assumed.
2014-01-11 11:22:31 -07:00
Nathan Sobo ef8b7531b0 Upgrade to theorist 0.13.0 to rename Signal::flatMapLatest -> ::switch
Shorter, simpler, less intimidating.
2014-01-11 11:19:19 -07:00
Nathan Sobo b04f9f9488 Remove unused methods from PaneAxis 2014-01-11 11:11:04 -07:00
Nathan Sobo 452d86ac0c Upgrade ui themes for rename of .row to .pane-row 2014-01-11 11:04:37 -07:00
Nathan Sobo 6fe1bae40d Upgrade to image-view 0.15.0 for fix to parent pane query 2014-01-11 10:46:57 -07:00
Nathan Sobo e2170ea907 Remove unused requires and mixins 2014-01-11 10:45:33 -07:00
Nathan Sobo 545bf4bd98 Upgrade to theorist 0.12.0 to remove dependence on harmony proxies
They're turning out to cause instability in the current version of v8
or atom-shell. Perhaps we can revisit this after the upgrade to chromium
31. Once we have Object.observe, we could at least throw an exception
when someone assigns a sequence index directly via ::[] or assigns to
::length.
2014-01-11 10:38:47 -07:00
Nathan Sobo 1fdc78a157 Upgrade find-and-replace to 0.74.0 for fix to parent pane dom query 2014-01-11 10:24:18 -07:00
Nathan Sobo 738bfd7253 Fix layout of tabs with flexbox repaint hack
The .item-views div needs to be the first child of pane and contain
the absolutely positioned repaint hack div inside it, otherwise the tabs
don't get honored as flexbox items.
2014-01-10 19:02:19 -07:00
Nathan Sobo 8b0b997db6 Kill EditorView::isAlive and just tunnel to the model where it was used 2014-01-10 18:28:01 -07:00
Nathan Sobo 263ab3b4a6 Kill unused require 2014-01-10 18:27:11 -07:00
Nathan Sobo 3afbcbe25f Allow focusout events to bubble out of panes 2014-01-10 18:07:10 -07:00
Nathan Sobo 578ca8b197 Don't update highlighted gutter lines unless the editor is alive 2014-01-10 17:56:04 -07:00
Nathan Sobo 72fe586101 Remove the concept of focus from the model 2014-01-10 17:27:28 -07:00
Kevin Sawicki 82d5577bdc Upgrade to find-and-replace@0.73.0 2014-01-10 15:59:51 -08:00
Ben Ogle c703cf2050 Upgrade to find-and-replace@0.72.0 2014-01-10 15:38:04 -08:00
Ben Ogle 993f1ac2d6 Update status-bar@0.31.0 2014-01-10 15:31:35 -08:00
Nathan Sobo ddf7c04e66 Use -> arrows on methods moved to the model 2014-01-10 15:51:27 -07:00
Nathan Sobo c127237cc6 Upgrade tabs to 0.17.0 so they unsubscribe when the pane is removed 2014-01-10 15:49:46 -07:00
Nathan Sobo 9694d255f0 Simplify item removal
- Move emitting of item removal event into ::removeItemAtIndex. Pass a
destroying param instead of setting state.

- Destroy the pane if ::items is empty at the in the item removal
method, rather than with a condition. This gives the item removal event
a chance to fire first.
2014-01-10 15:48:08 -07:00
Kevin Sawicki 81b4803d56 Upgrade to tree-view@0.59.0 2014-01-10 14:44:22 -08:00
Kevin Sawicki 893e9873a1 Upgrade to exception-reporting@0.11.0 2014-01-10 14:34:51 -08:00
Nathan Sobo 23e805fe9e Remove assertion for impossible situation
We were testing the behavior of returning the active pane by removing
the active class from its view. But "active" is a model-level concept
now, so this assertion makes no sense.
2014-01-10 15:28:55 -07:00
Kevin Sawicki 43257de7cd Upgrade to metrics@0.21.0 2014-01-10 14:08:05 -08:00
Nathan Sobo c7fded0d7f Only emit 'pane:removed' events if the pane is actually destroyed
The pane may only be detached temporarily during splitting/unsplitting
2014-01-10 15:04:51 -07:00
Nathan Sobo 284d823ad5 Tighten up search for parent pane
The introduction of the .flexbox-redraw-hack required the query to be
loosened, but I went too far. We don't want to return a pane for mini
editors that happen to be nested on another view that's inside a pane.
2014-01-10 14:36:07 -07:00
Kevin Sawicki 164a121de9 Upgrade to snippets@0.18.0 2014-01-10 13:02:19 -08:00
Kevin Sawicki 50ab49aedb Upgrade to first-mate@0.17.0 2014-01-10 12:57:35 -08:00
Kevin Sawicki a127d3c4eb Upgrade to fuzzaldrin@0.6.0 2014-01-10 12:57:12 -08:00
Kevin Sawicki cac5c6e3a5 Merge pull request #1403 from atom/ks-faster-keymaps
Speed up keymap loading
2014-01-10 12:44:27 -08:00
Nathan Sobo 1ee783fdb9 Base PaneContainer::getActivePane on the model's active pane 2014-01-10 13:44:02 -07:00
Nathan Sobo 47870a1214 Remove views (rather than detaching) if Pane::destroyItem is called 2014-01-10 13:35:18 -07:00
Nathan Sobo 7801d8562f Upgrade archive-view to 0.19.0 for .flexbox-repaint-hack fix 2014-01-10 13:08:47 -07:00
Nathan Sobo 104271861c Upgrade markdown-preview to 0.24.0 for .flexbox-repaint-hack fix 2014-01-10 13:07:39 -07:00
Kevin Sawicki de25b8ea37 Cache specificities 2014-01-10 12:01:56 -08:00
Kevin Sawicki ba9f353c4a Use precompile pattern when available 2014-01-10 11:43:45 -08:00
Nathan Sobo 7665cd1a6a When a pane view is removed in anyway, make sure its model is destroyed 2014-01-10 12:35:12 -07:00
Kevin Sawicki c39d8d9aa7 Precompile pegjs parsers 2014-01-10 11:32:40 -08:00
Nathan Sobo 4b0d22917b Trust CSS to perform layout now that we've switched to flexbox
The behavior of flexbox is actually slightly different in that it
divides space evenly among the immediate children of a row or column
rather than accounting for all splits. But it's actually not that big
a deal.
2014-01-10 12:12:44 -07:00
Nathan Sobo 720b2ad47d Upgrade to serializable 0.3.0 to handle undefined states 2014-01-10 12:11:19 -07:00
Nathan Sobo d34327a667 Remove the EditorView when Editor is destroyed 2014-01-10 11:56:27 -07:00
Nathan Sobo d2146f9b2e Emit 'pane:removed' event in container when last pane is removed
Doing it in the pane view is awkward because the view may have already
been detached.
2014-01-10 11:45:08 -07:00
Nathan Sobo 732d36af28 Null guard container in Pane::makeActive
Panes can exist outside of containers, albeit only briefly. If
::makeActive is called when the pane is in this state, consider it a
no-op.
2014-01-10 11:37:42 -07:00
Nathan Sobo edfc86f153 Make PaneContainer::getActivePaneItem retrieve it from the model 2014-01-10 11:34:26 -07:00
Nathan Sobo 339e30d973 Account for pane axis class name changes in pane-container-spec 2014-01-10 11:25:02 -07:00
Nathan Sobo 5e1e092650 When the last pane is destroyed, null out the root and active pane 2014-01-10 11:22:19 -07:00
Nathan Sobo c69febd44d Preserve the active pane across serialization 2014-01-10 11:22:02 -07:00
Nathan Sobo a9d7564f3e Account for the .flexbox-repaint-hack in WorkspaceView::getEditorViews 2014-01-10 11:21:10 -07:00
Nathan Sobo a0b733b53d Skip the flexbox-repaint-hack when seeking editor pane with ::parents 2014-01-10 11:20:12 -07:00
Kevin Sawicki 8cb565ad2a Add parseKeystroke function 2014-01-10 10:10:08 -08:00
Kevin Sawicki 32158711ce Upgrade to pegjs@0.8.0 2014-01-10 10:09:47 -08:00
Kevin Sawicki e099f00739 💄 Use unless instead of if not 2014-01-10 09:57:11 -08:00
Kevin Sawicki e707ab5441 Remove unused require 2014-01-10 09:52:30 -08:00
Kevin Sawicki 3b7f1467e1 Upgrade to background-tips@0.4.0 2014-01-10 09:42:09 -08:00
Nathan Sobo 1c7eef89c3 Merge branch 'master' into ns-pane-splits-with-models 2014-01-10 10:40:52 -07:00
Kevin Sawicki 4fc1f5b248 Upgrade to find-and-replace@0.71.0 2014-01-10 09:34:23 -08:00
Nathan Sobo 6eacfa7077 Call Range::toString, not ::inspect in DisplayBufferMarker::inspect 2014-01-09 19:04:52 -07:00
Nathan Sobo 9aefafb831 Use PaneContainerModel::$activePaneItem for 'active-item-changed' events
Yay behaviors
2014-01-09 18:58:01 -07:00
Nathan Sobo 5a3353ec28 Add PaneContainer view to deserializers 2014-01-09 18:35:16 -07:00
Nathan Sobo e87b8dc463 Remove focusNext/PreviousPane methods from PaneContainer view 2014-01-09 18:35:01 -07:00
Nathan Sobo 60daa483e6 Include orientation when serializing PaneAxisModel 2014-01-09 18:34:09 -07:00
Nathan Sobo cd699d8b9b Transfer focus to the root view when the last focused pane is destroyed 2014-01-09 18:17:08 -07:00
Ben Ogle d33a962848 Upgrade to find-and-replace@0.70.0 2014-01-09 17:12:33 -08:00
Ben Ogle 0d2067e1a4 Merge pull request #1400 from atom/bo-fuck-rejection
Dont use reject in project::scan cancel
2014-01-09 17:09:58 -08:00
Nathan Sobo 8647137952 Remove active status management from Pane view; rely on model instead 2014-01-09 18:00:54 -07:00
Ben Ogle fbcfad28c3 Reject is broken. Ugh. Just resolve it 2014-01-09 17:00:34 -08:00
Nathan Sobo 5e1b2e2696 Manage the active pane at the model level 2014-01-09 18:00:19 -07:00
Kevin Sawicki a0346e95cf Upgrade to markdow-preview@0.23.0 2014-01-09 15:37:08 -08:00
Kevin Sawicki 20ee7b432c Wrap item in array since it is a trigger call 2014-01-09 15:18:44 -08:00
Nathan Sobo 4026e6ca5c Properly serialize pane focus state 2014-01-09 16:09:22 -07:00
Corey Johnson 378901e0d2 Merge pull request #1375 from atom/ns-fix-crash-exit
Properly exit when render process crashes if exitWhenDone option is true
2014-01-09 15:08:56 -08:00
Nathan Sobo 964abd3141 Suppress blur when replacing a pane axis with its last child
If the pane axis contains a child pane, its temporary removal from the
DOM causes a blur event that we don't want to screw up our focused
state.
2014-01-09 16:08:52 -07:00
Nathan Sobo 5ca7ad3bce Add spec for destroyed pane items getting removed at the model layer 2014-01-09 16:07:57 -07:00
Nathan Sobo 4dcba4bb27 Destroy remaining items when a pane is destroyed 2014-01-09 16:06:02 -07:00
Nathan Sobo 073ea84d69 Handle consequences of item removal in the model 2014-01-09 16:05:00 -07:00
Nathan Sobo 2965d2e974 Bind Pane view's focus to focus state on the model
It's a bit tricky… we don't want to blur the model when focusing the
pane's active view causes a focusout event on the pane, so we use
::suppressBlur on the model to prevent it from blurring as the focus
is transferred.
2014-01-09 16:01:52 -07:00
Nathan Sobo a67f0d4d57 Make PaneModel::items an observable sequence 2014-01-09 15:53:52 -07:00
Nathan Sobo 5309d5f24d Add ability to suppress blur on all focusable objects in a focus context
When a view receives a 'focusout' event, we relay that to the model by
calling ::blur. This is great for when users initiate the change in
focus, but 'focusout' events can *also* be caused by elements being
temporarily detached from the DOM.

The ::suppressBlur method gives the ability to ignore blur calls during
a certain operation. This is helpful, for example, when we want to
detach a model and reattach it somewhere else without changing its focus
state.
2014-01-09 15:46:32 -07:00
Nathan Sobo af3ca57094 Make focus state distinct until changed on Focusable objects 2014-01-09 15:43:05 -07:00
Corey Johnson db375cd190 Merge pull request #1398 from atom/cj-show-free-disk-space
Show low disk space errors when running CI
2014-01-09 14:40:01 -08:00
Kevin Sawicki d96b63d791 Move enable/disable to parent Package class
This was previously unimplemented in TextMatePackage causing exceptions
when trying to enable/disable a package of that type.
2014-01-09 14:13:49 -08:00
probablycorey e435b48750 Display warning if disk space is kind of full 2014-01-09 13:58:24 -08:00
probablycorey a1f8a21c7c Output warning/error if diskspace on CI server is getting low. 2014-01-09 13:56:49 -08:00
Kevin Sawicki 69f9f10c6b Upgrade to find-and-replace@0.69.0 2014-01-09 13:56:15 -08:00
probablycorey d3c6bd2f98 Use close instead of exit
stdio might still be open when exit is called (http://nodejs.org/api/child_process.html#child_process_event_exit). With close you are
guaranteed that there will be no more output.
2014-01-09 13:47:51 -08:00
Nathan Sobo 466868e639 Fix access to undefined root property
The ::filterDefined transform unfortunately doesn't prevent an undefined
initial value when applied to behaviors.
2014-01-09 12:19:01 -07:00
Nathan Sobo 2317c6835e At the model layer: Focus next pane when a focused pane is destroyed
This incorporates the Focusable mixin into PaneModel and ensures that
all panes in the same pane container share a single focus context.
2014-01-09 12:19:01 -07:00
Nathan Sobo 4e99d003ee Add Focusable mixin and FocusContext
Focusable objects have ::focus and ::blur methods and a ::focused
property. Focusable objects can be assigned a ::focusContext, and the
::focused property will only be true for at most one object with the
same context.
2014-01-09 12:19:01 -07:00
Nathan Sobo 1a5e10c1d2 Focus the new pane when splitting 2014-01-09 12:19:01 -07:00
Nathan Sobo 8efcb1abfa Remove pane splitting/unsplitting logic from view
There's still some failing specs around focus management, but it's
getting closer.
2014-01-09 12:19:01 -07:00
Nathan Sobo f031a9706d Support unsplitting in the model layer 2014-01-09 12:19:01 -07:00
Nathan Sobo eb7f3ff5af Support splitting at the model layer
Splitting in the view will need to be removed and mapped to splits in
the model.
2014-01-09 12:19:00 -07:00
Nathan Sobo bb595ab08a Start adding PaneAxisModel 2014-01-09 12:19:00 -07:00
Nathan Sobo 101326a130 Upgrade theorist to 0.9.0 for sequences 2014-01-09 12:18:56 -07:00
Nathan Sobo ad60594c13 Add mixto module 2014-01-09 12:12:22 -07:00
probablycorey ca6da5f9c1 Update expcetion-reporting 2014-01-09 10:01:25 -08:00
Kevin Sawicki c397b3cc60 Upgrade to first-mate@0.14.0 2014-01-09 08:53:29 -08:00
Kevin Sawicki 6cb0f1ff78 Upgrade to fuzzy-finder@0.30.0 2014-01-08 18:12:36 -08:00
Kevin Sawicki 371e31c786 🐎 Test for prefix without calling path.join
Directory::relativize is called many times by the fuzzy finder
and using path.join possibly multiple times per call was consuming
much of the time take to show the fuzzy finder view.
2014-01-08 17:55:08 -08:00
Kevin Sawicki dce70b35b5 Upgrade to go-to-line@0.14.0 2014-01-08 17:37:09 -08:00
probablycorey 99a67ca1ab Remove focused spec 2014-01-08 16:37:57 -08:00
Corey Johnson 9dc1758d76 Merge pull request #1378 from atom/cj-flexbox-panes
This replaces custom pane resizing with flexbox
2014-01-08 16:36:41 -08:00
probablycorey 196942d126 Rename .row and .column in pane specs 2014-01-08 16:31:56 -08:00
Kevin Sawicki d95aa0aac1 Expand buffer range in Selection::selectLine 2014-01-08 16:27:09 -08:00
Kevin Sawicki 27f0d11039 Map cmd-l to editor:select-line 2014-01-08 15:48:52 -08:00
Kevin Sawicki a69e6136ea Upgrade to go-to-line@0.13.0 2014-01-08 15:47:29 -08:00
Kevin Sawicki 0fd8b6be8d Pluralize selection in event name 2014-01-08 15:45:09 -08:00
Kevin Sawicki 8e51a7f6d6 Bind cmd-shift-l to split selectin into lines 2014-01-08 15:44:34 -08:00
Kevin Sawicki bdb4cd5247 Upgrade to grammar-selector@0.16.0 2014-01-08 15:41:32 -08:00
Kevin Sawicki 3afe750a66 Merge pull request #1374 from atom/ks-split-selection-into-lines
Split selection into lines
2014-01-08 15:36:43 -08:00
Kevin Sawicki c8f3e056e9 Pluralize selections in method name 2014-01-08 15:17:06 -08:00
Kevin Sawicki 32fdf0b681 📝 Drop line about single line selections 2014-01-08 15:17:06 -08:00
Kevin Sawicki 82c73c9911 📝 Tweak comment for clarity 2014-01-08 15:17:06 -08:00
Kevin Sawicki fe0184d067 Add Split into Lines menu item 2014-01-08 15:17:06 -08:00
Kevin Sawicki 0ef6757e65 Add Editor::splitSelectionIntoLines 2014-01-08 15:17:06 -08:00
Kevin Sawicki deb4365d65 Upgrade to fuzzy-finder@0.29.0 2014-01-08 15:16:37 -08:00
Kevin Sawicki 750f4ee410 Upgrade to to-the-hubs@0.17.0 2014-01-08 15:14:34 -08:00
Kevin Sawicki 1382bd3b3b Upgrade to settings-view@0.55.0 2014-01-08 14:37:41 -08:00
probablycorey d908c8b026 Use absolute divs to limit repaints on keypresses 2014-01-08 14:31:46 -08:00
probablycorey 6f766acac8 Rename .row and .column to .pane-row and .pane-column
Bootstrap's .row and .column css was influencing our pane rows and
columns.
2014-01-08 14:30:33 -08:00
probablycorey 7eba9d3a23 Use flexbox to arrange panes 2014-01-08 14:29:32 -08:00
Kevin Sawicki cde5861cb8 Upgrade to fuzzaldrin@0.5.0 2014-01-08 14:17:40 -08:00
Kevin Sawicki 765c15829d Upgrade to fuzzaldrin@0.4.0 2014-01-08 14:01:15 -08:00
probablycorey 0471619269 Merge remote-tracking branch 'origin/master' into cj-ns-pane-models 2014-01-08 11:44:31 -08:00
probablycorey d8ba8f13d8 Update dev-live-reload 2014-01-08 11:28:03 -08:00
Corey Johnson c089429c14 Merge pull request #1367 from atom/cj-error-event
Add error event to atom global
2014-01-08 11:17:04 -08:00
probablycorey b22f850e03 Update status bar 2014-01-08 11:16:08 -08:00
Kevin Sawicki cf47ee5063 Only call _.isEqual when needed
Invert the logic to return if all are equal so we can fall through
on the first false call so only the minimum isEqual calls are made.

Also perform the boolean check first instead of last since it
cheaper than a Point comparison.

This showed up in the profile when profiling moving the cursor.
2014-01-08 10:59:39 -08:00
Kevin Sawicki 9d6a01d11c Use slice to clone array 2014-01-08 10:59:39 -08:00
Nathan Sobo bcf9dfd236 Merge pull request #1371 from atom/ns-text-buffer-cleanup
Clean up TextBuffer
2014-01-08 10:38:09 -08:00
Nathan Sobo c281eb9596 Move serialization of focus into PaneModel 2014-01-08 11:23:06 -07:00
Nathan Sobo 2acde6a727 Call super in constructor to assign PaneModel properties
The theorist model superclass constructor will automatically assign
all declared properties, or substitute the specified default value if
no param key is present for that property.
2014-01-08 11:21:00 -07:00
Nathan Sobo ee9b78afb6 Move copyActiveItem to PaneModel 2014-01-08 11:14:02 -07:00
Nathan Sobo a379d47230 Move methods related to item destruction and saving to PaneModel 2014-01-08 11:12:27 -07:00
Nathan Sobo 57c23e1b5f Merge remote-tracking branch 'origin/master' into ns-text-buffer-cleanup 2014-01-08 10:53:19 -07:00
Nathan Sobo f8d959ae16 Upgrade to text-buffer 0.12.0
* Drop deprecation of insert/append/delete. The method names will remain
  short.

* Replace ::getLastPosition with ::getEndPosition
2014-01-08 10:53:07 -07:00
Kevin Sawicki 13abb28486 Upgrade to bracket-matcher@0.16.0 2014-01-07 19:54:39 -08:00
Kevin Sawicki 717704c8ed Upgrade to tree-view@0.58.0 2014-01-07 19:54:12 -08:00
Nathan Sobo eab26fb3a6 Properly exit when render process crashes if exitWhenDone option is true
Previously, we were referring to an undefined `atom` global to exit when
the render process crashed in specs. Now we only exit when exitWhenDone
is true, which will only exit in headless specs. Also, we now call .exit
on an object that's actually defined.
2014-01-07 19:22:42 -07:00
Nathan Sobo 17947d0f99 Enable harmony proxies
I want to use these in the pane-models branch, so it will be helpful
if they are enabled in atom stable since it's an atom-shell level
setting.
2014-01-07 19:22:22 -07:00
Nathan Sobo 626e22e4ae Avoid exceptions when a live editor is compared with a destroyed one 2014-01-07 18:45:18 -07:00
Corey Johnson & Nathan Sobo 5837b7cfda Move methods related to item movement to PaneModel 2014-01-07 18:39:39 -07:00
Corey Johnson & Nathan Sobo 1a487db29f Move item removal events to PaneModel 2014-01-07 17:55:56 -07:00
Corey Johnson & Nathan Sobo 2938a8e650 Move item-oriented methods to PaneModel 2014-01-07 17:47:42 -07:00
Corey Johnson & Nathan Sobo cd97de76fc 💄 2014-01-07 17:28:53 -07:00
Corey Johnson & Nathan Sobo 25c099f3a2 Serialize the items and activeItem via PaneModel
This necessitates setting the ::activeView based on the model's
::activeItem instead of doing it in ::showItem.
2014-01-07 17:23:29 -07:00
Kevin Sawicki eb39b8505e Upgrade to timecop@0.12.0 2014-01-07 15:49:19 -08:00
Kevin Sawicki 7a90cc46ad Merge pull request #1373 from atom/ks-space-pen-3
Upgrade to space pen 3
2014-01-07 15:09:52 -08:00
Kevin Sawicki c6c1cb233d Upgrade to space-pen@3.0.3 2014-01-07 14:56:07 -08:00
Kevin Sawicki f9e37c9b47 Upgrade to space-pen@3.0.2 2014-01-07 14:56:07 -08:00
Kevin Sawicki dfb6835449 Upgrade to space-pen@3.0.1 2014-01-07 14:56:07 -08:00
Kevin Sawicki bf13b426c5 Upgrade to space-pen@3.0.0 2014-01-07 14:56:07 -08:00
Corey Johnson & Nathan Sobo 14175d80ef Move Pane::activeItem to PaneModel 2014-01-07 15:46:17 -07:00
Corey Johnson & Nathan Sobo c99e211144 Store Pane items in PaneModel 2014-01-07 15:42:23 -07:00
Nathan Sobo 1d04cbf584 Enable harmony proxies
I want to use these in the pane-models branch, so it will be helpful
if they are enabled in atom stable since it's an atom-shell level
setting.
2014-01-07 15:19:51 -07:00
Kevin Sawicki 92650e079f Upgrade to feedback@0.22.0 for 🐎 2014-01-07 13:49:54 -08:00
Kevin Sawicki f29ce127db Default windowState to empty hash JSON string 2014-01-07 11:19:38 -08:00
Nathan Sobo b29f1965f0 Move more methods into text-buffer npm 2014-01-07 10:19:43 -07:00
Nathan Sobo 48a2a1934b Start moving text related methods to text-buffer npm 2014-01-07 09:18:59 -07:00
Kevin Sawicki 8fe60b5838 Merge pull request #1366 from atom/ks-async-directory
Make Directory::getEntries asynchronous
2014-01-06 18:06:29 -08:00
Kevin Sawicki 484a7c95ee Upgrade to tree-view@0.57.0 2014-01-06 17:25:26 -08:00
Kevin Sawicki 44a3365787 Rename getRealPath to getRealPathSync 2014-01-06 17:25:26 -08:00
Kevin Sawicki f3e88b56f3 🐎 Reduce stat calls when building entries
Previously every entry was stated twice to determine if it was a
file/directory and a symbolic link.

Now the second stat call is only made if lstat returns stat details
for a symbolic link.
2014-01-06 17:25:26 -08:00
Kevin Sawicki d618472f95 Specify error as first argument 2014-01-06 17:25:26 -08:00
Kevin Sawicki a45ffb3aaa Add async Directory::getEntries 2014-01-06 17:25:26 -08:00
Kevin Sawicki 1d2b2eec4c Add Sync suffix to Directory::getEntries 2014-01-06 17:25:26 -08:00
Nathan Sobo 5c1f750f94 Upgrade text-buffer to 0.9.0 for completed docs and fixed memory leak 2014-01-06 18:07:53 -07:00
probablycorey 85a6db253b Spat the event arguments 2014-01-06 16:48:47 -08:00
Matt Colyer 72caf279a6 Merge pull request #1335 from atom/fix-windows-specs
Return windows specs to green
2014-01-06 16:34:19 -08:00
Nathan Sobo 05ff058ca5 Upgrade to text-buffer 0.8.0 to restore all removed Point/Range methods 2014-01-06 17:31:05 -07:00
probablycorey 022ead9228 Rename error event to uncaught-error 2014-01-06 16:22:04 -08:00
Nathan Sobo 14fd9aac7e Upgrade to text-buffer 0.7.0 to reintroduce Marker.fromPointWithDelta 2014-01-06 17:16:03 -07:00
probablycorey 5975884a0e Add error event to atom global 2014-01-06 16:11:39 -08:00
Matt Colyer e8ce559034 Merge branch 'master' into fix-windows-specs
Conflicts:
	package.json
2014-01-06 16:02:45 -08:00
Matt Colyer 9add438ea4 Revert "Windows build status reflects package status now"
This reverts commit cec731b697.
2014-01-06 15:55:21 -08:00
Nathan Sobo d65a6c3fc4 Merge pull request #1348 from atom/ns-remove-telepath-from-core
The experiment is over. To be continued in a hopefully less painful way. Sorry guys.
2014-01-06 15:45:11 -08:00
Nathan Sobo a493359b58 Upgrade text-buffer to 0.6.0 2014-01-06 16:31:53 -07:00
Nathan Sobo d6de973500 Remove shims that call super
They were previously there for documentation purposes, but we've decided
to document them in the text-buffer npm directly and link it into the
documentation. This drops some of the docs on delegated methods, because
our docs generator doesn't understand `delegatesMethods` declarations,
but TextBuffer was marked private anyway so we can get back to it later.
2014-01-06 15:16:34 -07:00
Nathan Sobo 25cc37bc86 Replace {StringMarker} references with {Marker} in API docs 2014-01-06 15:13:12 -07:00
Matt Colyer 0e6bc275b7 Merge branch 'master' into fix-windows-specs
Conflicts:
	package.json
2014-01-06 11:19:37 -08:00
Matt Colyer cec731b697 Windows build status reflects package status now 2014-01-06 11:17:34 -08:00
Nathan Sobo 8d4ae33134 Don't export Model superclass in top-level atom module
Previously, the semantics of telepath's Model class were coupled to the
wrapped documents, so it made sense to export the Model. But now that
Model is much simpler, it makes more sense to allow individual packages
to rely on their own version of Model by requiring theorist if they want
to so we can make changes to the version of model used by core without
breaking packages.
2014-01-05 10:47:22 -07:00
Nathan Sobo cbec03c158 Rename reactionary to theorist 2014-01-05 10:25:59 -07:00
Nathan Sobo 1fe0a1ad7b Upgrade to text-buffer 0.5.0 2014-01-04 15:42:53 -07:00
Nathan Sobo 8b9ede8414 Upgrade text-buffer to 0.4.0 to allow 'invalidation' marker option 2014-01-04 14:16:07 -07:00
Nathan Sobo 194094043e Upgrade tree-view to 0.54.0 to remove telepath dependency 2014-01-04 14:09:10 -07:00
Nathan Sobo 9068f28e83 Fix variable name 2014-01-04 14:08:00 -07:00
Nathan Sobo ebb5d38e1a Upgrade packages to remove telepath dependencies 2014-01-04 10:49:30 -07:00
Nathan Sobo aa1ed1dfcc Upgrade to reactionary 0.3.0 to avoid double destruction 2014-01-04 10:23:08 -07:00
Nathan Sobo 0292c66f93 Don't drop editor subscriptions in its destroyed hook
Unsubscribing should be the responsibility of the subscribers and doing
this was removing 'destroyed' subscriptions before the 'destroyed' event
was emitted now that 'destroyed' is emitted by the default
Model::destroy method.
2014-01-04 10:08:04 -07:00
Nathan Sobo 4ce68fe5d8 Merge remote-tracking branch 'origin/master' into ns-remove-telepath-from-core 2014-01-04 09:39:57 -07:00
Nathan Sobo 289e7d56c3 Upgrade to reactionary 0.2.0 for built-in property accessors mixin 2014-01-04 09:39:30 -07:00
Nathan Sobo cb7471945c Remove redundant 'destroyed' event 2014-01-03 19:35:07 -07:00
Nathan Sobo 8da9e8ddc1 Rename nostalgia to serializable
This name was surprisingly available and better matches this module's
utilitarian nature.
2014-01-03 18:32:44 -07:00
Nathan Sobo a68694e6e2 Upgrade to nostalgia 0.3.0 for ability to override mixin properties 2014-01-03 17:54:59 -07:00
probablycorey 98b5a400e6 Update packages that use new tool panel appending api 2014-01-03 16:52:38 -08:00
Nathan Sobo 0bbd9630f5 Fix pane spec 2014-01-03 17:50:46 -07:00
Nathan Sobo c6770aa83e Merge remote-tracking branch 'origin/master' into ns-remove-telepath-from-core
Conflicts:
	package.json
	src/pane.coffee
2014-01-03 17:46:45 -07:00
Nathan Sobo e26d97d5ac Remove telepath as a core dependency 2014-01-03 17:42:11 -07:00
Corey Johnson b2177cbc09 Merge pull request #1360 from atom/cj-add-prepend-append-methods-to-workspace
Add prepend/append methods to WorkspaceView
2014-01-03 16:34:16 -08:00
Ben Ogle c8663541f0 Upgrade to fnr@0.65.0 2014-01-03 15:55:40 -08:00
probablycorey 9f32a24e7e Add all Tool Panel append and prepend methods 2014-01-03 15:43:00 -08:00
Nathan Sobo 914a87290b Remove unnecessary telepath requires 2014-01-03 16:36:26 -07:00
Nathan Sobo 112b8bfa29 Generate docs from text-buffer instead of telepath 2014-01-03 16:36:08 -07:00
probablycorey 5d99acd8c5 Update docs 2014-01-03 15:26:56 -08:00
probablycorey 066d8dc944 Add prependToBottom and appendToBottom 2014-01-03 15:26:27 -08:00
Matt Colyer 9af6e99682 Merge branch 'master' into fix-windows-specs 2014-01-03 15:24:52 -08:00
Nathan Sobo bc65137911 Remove telepath from Project, WorkspaceView, and Pane* 2014-01-03 16:23:23 -07:00
Kevin Sawicki 02dfe074e6 Spawn grunt path directly 2014-01-03 15:17:55 -08:00
Matt Colyer 2b4c2f1758 Merge branch 'master' into fix-windows-specs 2014-01-03 14:34:02 -08:00
Kevin Sawicki a7494cf649 Upgrade to first-mate@0.11.0 for clojure grammar fix
Closes #1349
2014-01-03 14:27:24 -08:00
Nathan Sobo 3d494ed9fa Merge pull request #1337 from atom/ns-fix-mini-editor-leak
Fix mini editor leak
2014-01-03 11:58:02 -08:00
Kevin Sawicki 47a14bb2e6 Add callback param to publishRelease 2014-01-03 11:08:01 -08:00
Kevin Sawicki 7a71f26345 Add missing comma 2014-01-03 10:57:40 -08:00
Kevin Sawicki 870c4d4214 Link to commit list for release 2014-01-03 10:53:46 -08:00
Kevin Sawicki ac5d10fae2 Store grunt object to variable
This allows it to be used from logError
2014-01-03 10:49:03 -08:00
Kevin Sawicki 2963fe177f Pass through error from deleting asset 2014-01-03 10:48:32 -08:00
Kevin Sawicki 0947947a9d Merge pull request #1145 from atom/ks-grunt-node-modules
Store build modules in build/node_modules
2014-01-03 10:20:55 -08:00
Kevin Sawicki 0112e8887f biscotto is in build folder not tasks folder 2014-01-03 10:12:55 -08:00
Kevin Sawicki 3a7ecccec7 📝 Clarify justification for moving 2014-01-03 10:01:40 -08:00
Kevin Sawicki f9a9712f54 Upgrade to grunt-download-atom-shell@0.5.0 2014-01-03 09:48:28 -08:00
Kevin Sawicki 5e5ba63c59 Move fstream from build to dev dependency 2014-01-03 09:38:57 -08:00
Matt Colyer 2c58d1a2b7 Upgrade scandal@0.11.0 2014-01-03 09:31:44 -08:00
Kevin Sawicki 5e2e5a4b58 Use same grunt path in script/build and script/cibuild 2014-01-03 09:29:45 -08:00
Kevin Sawicki 344d237a42 Remove ~/.atom outside of tasks 2014-01-03 09:26:04 -08:00
Kevin Sawicki 04eef20c84 Use fs-plus instead of rimraf directly 2014-01-03 09:15:31 -08:00
Nathan Sobo 77dba8d19b Merge branch 'master' into ns-fix-mini-editor-leak 2014-01-03 10:03:25 -07:00
Kevin Sawicki 704294a2d5 Add build/README.md 2014-01-03 08:37:24 -08:00
Kevin Sawicki 847a8165e0 Add fields to prevent warnings 2014-01-03 08:37:16 -08:00
Kevin Sawicki 18f2f5f821 Add script/grunt 2014-01-03 08:32:24 -08:00
Kevin Sawicki 7f2e0e2317 Add back window .cmd suffix 2014-01-03 08:32:24 -08:00
Kevin Sawicki 963513e840 Wrap status code in an Error 2014-01-03 08:32:24 -08:00
Kevin Sawicki b1470fc1b5 Indent done callback 2014-01-03 08:32:24 -08:00
Kevin Sawicki 43482ea78e Add grunt param 2014-01-03 08:32:24 -08:00
Kevin Sawicki 167e6dc1bf Convert upload-release script to a grunt task 2014-01-03 08:32:24 -08:00
Kevin Sawicki 088a627468 💄 Sort build dependencies 2014-01-03 08:32:24 -08:00
Kevin Sawicki 4f6c655294 Remove grunt-download-atom-shell as package dependency 2014-01-03 08:32:23 -08:00
Kevin Sawicki e2db58c6ee Add grunt-download-atom-shell as dependency 2014-01-03 08:32:23 -08:00
Kevin Sawicki 64aba6ec24 Add first-mate dependency 2014-01-03 08:32:23 -08:00
Kevin Sawicki 2910170eeb Add name field 2014-01-03 08:32:23 -08:00
Kevin Sawicki 9bc24b8736 Add missing comma 2014-01-03 08:32:23 -08:00
Kevin Sawicki 401ef87bb2 Clean build/node_modules folder 2014-01-03 08:32:23 -08:00
Kevin Sawicki 0c5ed1eee4 Run grunt from build folder 2014-01-03 08:32:23 -08:00
Kevin Sawicki 790c227924 Add back comment 2014-01-03 08:32:23 -08:00
Kevin Sawicki 822f13d6e3 Remove unneeded lint exclude 2014-01-03 08:32:23 -08:00
Kevin Sawicki 70c14eb4f5 Move tasks to build directory 2014-01-03 08:32:23 -08:00
Kevin Sawicki 673d2330f0 Add jasmine-node/jasmine-focused to dependencies 2014-01-03 08:32:23 -08:00
Kevin Sawicki e187604942 Run grunt from tasks folder 2014-01-03 08:32:22 -08:00
Kevin Sawicki c2cd1cd13d Remove devDependencies from package.json
They are now stored as dependencies in tasks/package.json
2014-01-03 08:32:22 -08:00
Kevin Sawicki c720a6a029 Don't lint tasks/node_modules 2014-01-03 08:32:22 -08:00
Kevin Sawicki 601466782f Install build dependencies in tasks/node_modules 2014-01-03 08:32:22 -08:00
Matt Colyer 92ef8f22e4 Upgrade scandal@0.10.1 2014-01-02 15:34:36 -08:00
Corey Johnson 690ffab9c0 Merge pull request #1355 from atom/cj-update-user-keymap
Watch user's keymap file for updates
2014-01-02 13:56:53 -08:00
probablycorey 512f373ca6 Merge remote-tracking branch 'origin/master' into cj-update-user-keymap 2014-01-02 11:54:06 -08:00
Matt Colyer e8f4da54a6 Upgrade find-and-replace@0.64.0 2014-01-02 11:33:20 -08:00
probablycorey d56137e3c0 Always try to unwatch current user keymap 2014-01-02 09:56:41 -08:00
Matt Colyer 9629afb145 Merge branch 'master' into fix-windows-specs 2014-01-02 08:38:59 -08:00
Nathan Sobo 821debcb85 Make Editor, DisplayBuffer, TokenizedBuffer to not use telepath
This commit introduces dependency on a new npm called
[reactionary](https://github.com/atom/reactionary). It will serve as a
*much* lighter weight model framework to provide the reactive features
of telepath without the replication logic.

Specs are still failing for panes and workspace. I plan to just roll
forward and remove the telepath dependency from them as well.
2013-12-31 18:19:53 -07:00
Kevin Sawicki b9395d2946 Add harmony collections when unavailable
grunt could be invoked without harmony collections enabled which
would previously cause exceptions to be logged when modules requiring
them (emissary) were loaded.
2013-12-31 17:02:16 -08:00
Kevin Sawicki 44e6e7f45d Merge pull request #1354 from atom/ks-extract-textmate-parser
Use grammar registry provided by first-mate
2013-12-31 16:20:09 -08:00
probablycorey 88ee021b4d Watch user's keycap for changes and apply them 2013-12-31 15:21:42 -08:00
Kevin Sawicki b5c8e3e1fe Upgrade to first-mate@0.10.0 2013-12-31 15:15:40 -08:00
Kevin Sawicki 9962ce9859 Implement createToken in Syntax 2013-12-31 15:15:40 -08:00
Kevin Sawicki 882d766689 Activate/deactivate grammars directly 2013-12-31 15:15:40 -08:00
Kevin Sawicki 959401f5a7 Drop TextMate prefix from class names 2013-12-31 15:15:40 -08:00
Kevin Sawicki fa9aa3691b Extend GrammarRegistry in Syntax 2013-12-31 15:15:40 -08:00
Kevin Sawicki a95fdce85f 📝 Mark Syntax class as public 2013-12-31 15:15:40 -08:00
Kevin Sawicki e8edc83e39 💄 Sort requires 2013-12-31 15:15:40 -08:00
Kevin Sawicki 3ff702581a Group shim lines 2013-12-31 15:15:40 -08:00
Kevin Sawicki 88c9275bff Activate grammar when already active 2013-12-31 15:15:39 -08:00
Kevin Sawicki 826d536c09 Add atom.syntax.grammars shim 2013-12-31 15:15:39 -08:00
Kevin Sawicki c99c2af6ae Remove NullGrammar class now in first-mate 2013-12-31 15:15:39 -08:00
Kevin Sawicki ccc6eed3da Remove unused method 2013-12-31 15:15:39 -08:00
Kevin Sawicki e1aec57ffe Create tokens in TokenizedBuffer 2013-12-31 15:15:39 -08:00
Kevin Sawicki c1fc09e510 Use grammars from registry 2013-12-31 15:15:39 -08:00
Kevin Sawicki 19212f99ee Remove TextMateGrammar use in specs 2013-12-31 15:15:39 -08:00
Kevin Sawicki 2681dcc63c Remove TextMateGrammar class now in first-mate 2013-12-31 15:15:39 -08:00
Kevin Sawicki 6f5d85edb9 Use grammar registry from first-mate 2013-12-31 15:15:39 -08:00
Kevin Sawicki a59c01c6be Move editor-specific grammar specs to editor-spec 2013-12-31 15:15:39 -08:00
Kevin Sawicki a78613b7e5 Upgrade to first-mate@0.6.0 2013-12-31 15:15:39 -08:00
Kevin Sawicki 33c1353500 Only generate evil files when needed 2013-12-31 15:11:29 -08:00
Kevin Sawicki 22a7c25104 💄 Remove unneeded requires, variables, commas, and parens 2013-12-31 15:05:34 -08:00
Kevin Sawicki 902406c572 Enable harmony collections in all scripts 2013-12-31 14:40:45 -08:00
probablycorey b0077986b4 Use temp user directory for keymap config specs 2013-12-31 14:31:06 -08:00
Kevin Sawicki 686ebf8759 Upgrade to spell-check@0.18.0 for spec description tweaks 2013-12-31 11:58:23 -08:00
Nathan Sobo 66831ce8b9 Subclass the text-buffer npm TextBuffer 2013-12-31 12:46:47 -07:00
Nathan Sobo dd2c6d2f24 Eliminate TextBuffer's dependence on telepath
Atom's TextBuffer now relies on the text-buffer npm for its core
functionality.
2013-12-31 12:13:15 -07:00
probablycorey 30a175230a Update feedback package 2013-12-31 11:11:21 -08:00
Corey Johnson fe3e71cbd7 Merge pull request #1350 from atom/cj-keybinding-fixes
keybinding fixes
2013-12-31 08:50:22 -08:00
probablycorey 8d2e1b7e43 Selection::selectToEndOfLine acts on screen lines. 2013-12-31 08:38:27 -08:00
probablycorey c37b884007 Add moveCursorToEnd/BeginningOfBufferLine
Fixes #1123
2013-12-31 08:21:35 -08:00
probablycorey 97aed1f680 ctrl-a moves the cursor to the beginning of the line on OS X
Keybinding now matches default OS behavior
2013-12-30 14:00:38 -08:00
probablycorey bac76784e0 cmd-left moves the cursor to column 0 on lines only containing whitespace
Fixes #1344
2013-12-30 13:57:34 -08:00
probablycorey 8e970b64b8 Change window:reload keybinding to ctrl-alt-cmd-l
Fixes #1157
2013-12-30 10:45:01 -08:00
Corey Johnson dfe9f5684e Merge pull request #1343 from atom/use-default-osx-keymap-for-hiding-other-apps
Use default OS X keyboard shortcut to hide other apps
2013-12-30 10:27:44 -08:00
Jason Rudolph 470ce7bd22 Use default OS X keyboard shortcut to hide other apps 2013-12-27 08:24:46 -05:00
Kevin Sawicki f59080ec74 Upgrade to language-gfm@0.11.0 2013-12-24 09:14:16 -08:00
Ben Ogle f5ca836e49 Add background-tips package
Fixes #1217
2013-12-21 09:00:08 -08:00
Ben Ogle 319f9a22d8 Merge pull request #1340 from atom/bo-cancel-search
Add the ability to cancel project.scan
2013-12-20 16:09:34 -08:00
Ben Ogle 458d3b3d3c Remove fat arrow 2013-12-20 15:04:17 -08:00
Ben Ogle 11ec939924 Add a cancel() function to the promise 2013-12-20 15:03:39 -08:00
Matt Colyer e14019e2dd Upgrade settings-view@0.53.0 2013-12-20 12:25:40 -06:00
Matt Colyer 180912db61 Merge branch 'master' into fix-windows-specs 2013-12-20 12:14:31 -06:00
Matt Colyer aba1900d13 Upgrade link@0.12.0 2013-12-20 11:58:38 -06:00
Ben Ogle 5fdb3196a3 Add cancelScan() 2013-12-19 17:08:18 -08:00
Ben Ogle 8763a49dc6 Remove log line 2013-12-19 16:39:01 -08:00
Ben Ogle ffbd15eb98 Upgrade scandal@0.9.0 2013-12-19 16:12:29 -08:00
Ben Ogle 871b7406cd Terminate the old search if another is run. 2013-12-19 15:41:29 -08:00
Ben Ogle 66fa9d6a42 Upgrade to find-and-replace@0.63.0 2013-12-19 13:32:42 -08:00
Ben Ogle 8c7649dd57 Update the styleguide and themes for background-message 2013-12-19 12:27:11 -08:00
Ben Ogle 38c4fb3884 Add .background-message to the default theme 2013-12-19 12:14:46 -08:00
Matt Colyer 2d17ffc792 Revert "Restore package concurrency"
This reverts commit 2ad9fb52ae.
2013-12-19 12:02:18 -08:00
Matt Colyer 1d70e12594 Revert "Check for existence"
This reverts commit 8fb729d000.
2013-12-19 12:02:12 -08:00
Matt Colyer 8fb729d000 Check for existence 2013-12-19 11:43:28 -08:00
Ben Ogle b9fd05ba1e Upgrade to feedback@0.20.0 2013-12-19 11:39:27 -08:00
Matt Colyer 2ad9fb52ae Restore package concurrency 2013-12-19 11:33:42 -08:00
Matt Colyer 91778cb566 Revert "Parallelize package specs"
This reverts commit fa18a5cb33.
2013-12-19 11:29:32 -08:00
Matt Colyer a76cda4564 Revert "Parallelize core specs as well"
This reverts commit 7cb1ea038c.
2013-12-19 11:28:42 -08:00
Matt Colyer 7cb1ea038c Parallelize core specs as well 2013-12-19 10:56:18 -08:00
Matt Colyer fa18a5cb33 Parallelize package specs 2013-12-19 10:36:19 -08:00
Kevin Sawicki a012248316 Upgrade to tree-view@0.51.0 for menu tweak 2013-12-19 08:40:30 -08:00
Kevin Sawicki 53ccf7cf87 Upgrade to command-palette@0.14.0 refs #1339 2013-12-19 08:38:56 -08:00
Kevin Sawicki fbda0028ca Upgrade to feedback@0.19.0 2013-12-19 08:24:18 -08:00
Matt Colyer 9e3648c22f Remove ci.log files 2013-12-18 18:45:41 -08:00
Matt Colyer d8374eb251 Revert "Don't run package specs"
This reverts commit fd6e5e7a13.
2013-12-18 18:45:17 -08:00
Matt Colyer fd6e5e7a13 Don't run package specs 2013-12-18 18:36:40 -08:00
Matt Colyer 1da6bca2ae Properly use writeSync 2013-12-18 18:35:20 -08:00
Matt Colyer 40630114e7 Another attempt at preventing clipping 2013-12-18 17:12:12 -08:00
Matt Colyer 6736b6af3e Don't remove ci.log files for debugging 2013-12-18 16:38:14 -08:00
Matt Colyer 9c7747efbf Don't close ci output, as it's hanging 2013-12-18 16:38:03 -08:00
Nathan Sobo 42b203d502 🚱 Fix mini editor leak
Previously, we were overriding Editor::destroy, which is now provided
by telepath. Since the real destroy wasn't being called, we were failing
to remove editors associated with mini editor views.
2013-12-18 17:05:34 -07:00
Nathan Sobo d7d4a990a5 Merge pull request #1326 from atom/ns-telepathic-pane-items
Manage serialization of pane items with Telepath
2013-12-18 16:04:53 -08:00
Matt Colyer 8597951f0c Make sure logStream exists 2013-12-18 15:24:18 -08:00
Nathan Sobo 7d47527b17 Merge remote-tracking branch 'origin/master' into ns-telepathic-pane-items 2013-12-18 16:14:44 -07:00
Nathan Sobo 197d185ea4 Upgrade settings view to 0.52.0 for forward compatibility with #1326 2013-12-18 16:12:54 -07:00
Matt Colyer 91d1c2914e Write to stderr instead, for quicker flushing 2013-12-18 15:12:30 -08:00
Nathan Sobo da2487ba84 Upgrade archive view to 0.17.0 for forward compatibility with #1326 2013-12-18 16:11:36 -07:00
Matt Colyer 171c3e018b Attempt to fix truncated log messages 2013-12-18 14:57:13 -08:00
Matt Colyer bda8397d3d Revert "Switch to git for cloning apm"
This reverts commit fd929364d1.
2013-12-18 14:23:28 -08:00
Matt Colyer c9aa082e63 Revert "Turn up debugging for atom-shell downloads"
This reverts commit 6c4eb7439a.
2013-12-18 14:22:17 -08:00
Matt Colyer 6c4eb7439a Turn up debugging for atom-shell downloads 2013-12-18 12:11:27 -08:00
Nathan Sobo 76922c2d46 Include stack of window state parse errors in CI build output 2013-12-18 13:10:25 -07:00
Nathan Sobo fd7c3f3980 Merge branch 'master' into ns-telepathic-pane-items
Conflicts:
	src/pane.coffee
2013-12-18 13:07:37 -07:00
Matt Colyer 6b750c82ca Merge pull request #1327 from atom/win32-specs
Run atom CI on windows
2013-12-18 12:07:05 -08:00
Matt Colyer 4d643242a1 Don't upload the release on windows 2013-12-18 11:43:34 -08:00
Matt Colyer e974e61012 Remove logging 2013-12-18 11:36:26 -08:00
Matt Colyer 1ce4f3c552 More debugging 2013-12-18 11:19:26 -08:00
Matt Colyer 3ac2cae355 More debugging 2013-12-18 11:17:00 -08:00
Matt Colyer 2ffa989ba4 Add a missing comma 2013-12-18 11:12:38 -08:00
Matt Colyer 341454cd81 Dont use console 2013-12-18 11:11:27 -08:00
Matt Colyer 4507981f2a Fix logging 2013-12-18 11:07:46 -08:00
Matt Colyer 14f2444883 Add debugging 2013-12-18 11:03:21 -08:00
Nathan Sobo 267b1bdce6 Upgrade to image-view 0.11.0 for forward-compatibility with #1326
It makes ImageView a telepath model subclass so panes don't have to
manually manage serialization.
2013-12-18 12:03:10 -07:00
Matt Colyer 53451e0bcd Flip concurrency models 2013-12-18 10:20:21 -08:00
Nathan Sobo 4223ea25ee Update telepath to 0.80.0 so we drop old serialized states
Now that we've added custom objects, any pane items that serialized as
raw telepath objects are invalid. This is a quick way to cut through
any of those kinds of issues.
2013-12-18 11:19:14 -07:00
Matt Colyer bb517467eb 💄 2013-12-18 09:48:03 -08:00
Matt Colyer dd16aefbb6 Restore concurrency just on OSX 2013-12-18 09:47:24 -08:00
Matt Colyer 471c323ca5 Always return true on windows, for now 2013-12-18 09:36:43 -08:00
Matt Colyer bf021ab7f7 Merge branch 'master' into win32-specs
Conflicts:
	tasks/spec-task.coffee
2013-12-18 09:34:28 -08:00
Nathan Sobo 9198f3b809 Merge pull request #1334 from atom/ns-omit-destroyed-pane-items
Omit destroyed pane items
2013-12-18 08:40:20 -08:00
Kevin Sawicki b7c227dbfc Upgrade to autocomplete@0.19.0 for tab completion 2013-12-18 08:14:29 -08:00
Nathan Sobo 0dc031140c Omit destroyed pane items
This is an interim solution which enables atom/image-view#4 to correctly
deserialize when the path has been deleted both on atom master and in
atom/atom#1326.
2013-12-17 21:39:12 -07:00
Kevin Sawicki e853bbfcb6 Use standalone apm for running test 2013-12-17 19:51:34 -08:00
Kevin Sawicki cef7577826 Install apm into node_modules
settings-views launches apm via a NodeBufferedProcess so it still needs to
be available built against Atom's headers.

The version in apm/ is just for running via the CLI directly and is compiled
against node's headers.
2013-12-17 19:25:44 -08:00
Matt Colyer 8366887df6 Don't use a logfile unless one is defined 2013-12-17 18:28:17 -08:00
Matt Colyer e7f63b7c62 Merge branch 'master' into win32-specs 2013-12-17 18:22:08 -08:00
Matt Colyer 81a04769fb Run specs serially 2013-12-17 18:21:07 -08:00
Matt Colyer d4fcfbd034 Remove ci.log from package directories 2013-12-17 18:20:44 -08:00
Matt Colyer bab92c6d0a Use atom directly to run package specs 2013-12-17 18:10:55 -08:00
Matt Colyer 72523de046 Remove fixture that got checked in 2013-12-17 17:58:01 -08:00
Kevin Sawicki 82fbba4547 Upgrade apm for keytar usage 2013-12-17 17:56:04 -08:00
Matt Colyer 8b112cfd65 Get core specs running 2013-12-17 17:55:46 -08:00
Kevin Sawicki ec83c1061b Merge pull request #1324 from atom/ks-standalone-apm
Install apm outside of node_modules
2013-12-17 17:03:49 -08:00
Kevin Sawicki 75c573fe61 Run apm commands from new apm directory 2013-12-17 16:53:31 -08:00
Kevin Sawicki ed8800d182 Install apm to apm/ from vendor/apm 2013-12-17 16:53:31 -08:00
Kevin Sawicki 0aabfddfcb 🐎 Stat without exceptions in Directory::getEntries 2013-12-17 16:51:11 -08:00
Matt Colyer 1bf1785885 Upgrade fs-plus@0.13.0 2013-12-17 16:41:10 -08:00
Matt Colyer 20df9f4666 Add --log-file option for redirecting output 2013-12-17 16:31:13 -08:00
Nathan Sobo e40b7b1412 Update to telepath 0.79.0 so representation creation can be delayed
Instead of creating representations for a class as soon as the class is
registered, we wait until all representation classes are registered and
call `::createRepresentations` on the Atom global to build everything in
a single bottom up traversal.
2013-12-17 17:05:54 -07:00
Nathan Sobo 611559ecd6 Fix pane spec. Fully test serialization lifecycle via ::testPersistence. 2013-12-17 17:05:54 -07:00
Nathan Sobo c74783ebbf Allow telepath to manage serialization of non-telepathic pane items
This is the first step in converting Pane into a telepath model. We skip
interaction with the deserializer for items and allow telepath to handle
everything. There's actually a preexisting replication error in moveItem
that I'm going to leave until we drop out a Pane model.
2013-12-17 17:05:54 -07:00
Nathan Sobo 9df69f801b Register deserializers on telepath as representation classes 2013-12-17 17:05:54 -07:00
Nathan Sobo 105f74e15e Merge pull request #1305 from atom/ns-telepathic-atom-global
Make atom global a Telepath model subclass
2013-12-17 15:56:34 -08:00
Matt Colyer d7e56c447b Remove logging, disable package specs 2013-12-17 15:53:08 -08:00
Matt Colyer cecee6a430 Merge branch 'master' into win32-specs 2013-12-17 15:47:57 -08:00
Matt Colyer e3e83918e5 Update to underscore-plus@0.6.1 2013-12-17 15:47:48 -08:00
Nathan Sobo 0438565c43 Fix site.createDocument shim 2013-12-17 16:46:16 -07:00
Matt Colyer cbfa87a3b4 Merge branch 'master' into win32-specs 2013-12-17 15:36:24 -08:00
Matt Colyer 3187013eac Upgrade underscore-plus@0.6.0 2013-12-17 15:35:27 -08:00
Nathan Sobo e7b632eb18 Merge branch 'master' into ns-telepathic-atom-global 2013-12-17 16:30:24 -07:00
Kevin Sawicki cdce91157f Reverse load path order
Packages may be linked into ~/.atom/packages or ~/.atom/dev/packages
so the resource should be loaded from there when available.
2013-12-17 15:04:17 -08:00
Kevin Sawicki a566bd469d Use fs-plus.isFileSync to check path
Previously fs::statSyncNoException not being null was used but it always
returns an object or false so the first path checked was always being used.
2013-12-17 15:01:53 -08:00
Kevin Sawicki 389586bb41 Add ~/.atom/dev/packages to load paths 2013-12-17 15:00:27 -08:00
Kevin Sawicki 51b39500fe Prepare 0.45.0 release 2013-12-17 14:24:14 -08:00
probablycorey b5a6f0db0f Update welcome package 2013-12-17 12:42:25 -08:00
Kevin Sawicki 259faa5b5a Upgrade to grunt-download-atom-shell@0.4.0 for progress fix 2013-12-17 12:41:02 -08:00
Corey Johnson c8477c2f01 Merge pull request #1329 from atom/cj-word-movment
Word movement uses `end-of-word` and `beginning-of-word`
2013-12-17 12:38:34 -08:00
Ben Ogle f6b00fc90f Upgrade to feedback@0.18.0 2013-12-17 12:10:53 -08:00
Ben Ogle b3246d63fb Upgrade to find-and-replace@0.62.0 2013-12-17 11:33:35 -08:00
probablycorey 07eb2d014a Word movement uses end-of-word and beginning-of-word
Closes #1253
2013-12-17 11:24:35 -08:00
Matt Colyer bf0015f6cc Run with cmd.exe 2013-12-17 10:49:15 -08:00
Matt Colyer ca3d1e869c Use start command to launch atom.exe 2013-12-17 10:33:39 -08:00
Nathan Sobo a57083a48b Mark Atom global class methods with instance equivalents as 'Private:' 2013-12-17 11:18:59 -07:00
Matt Colyer 2ae46734db Debug output 2013-12-17 10:07:55 -08:00
Matt Colyer 3918435c7f Correct the path to the executable on windows 2013-12-17 09:51:45 -08:00
Kevin Sawicki 180e5d4164 Delete node_modules from vendor/apm 2013-12-17 09:50:04 -08:00
Matt Colyer d8f5ef71cd Add a contentsDir for windows 2013-12-17 09:39:49 -08:00
Matt Colyer 2e2bab7778 Upgrade grunt-download-atom-shell@0.3.0 2013-12-17 09:28:21 -08:00
Kevin Sawicki b10ef9454b Disable colors in script/constructicon/build not script/build 2013-12-17 09:27:11 -08:00
Kevin Sawicki 31fc4fcde8 Disable colors in constructicon output 2013-12-17 09:22:14 -08:00
Kevin Sawicki f48514114d Disable colors when BUILT_PRODUCTS_DIR env var is set 2013-12-17 09:15:04 -08:00
Matt Colyer fd929364d1 Switch to git for cloning apm 2013-12-17 08:53:54 -08:00
Kevin Sawicki 4f758f1fe2 Upgrade apm to workaround npm shasum error 2013-12-17 08:43:19 -08:00
Corey Johnson 35e1940984 Merge pull request #1325 from atom/cj-remove-movement-menu
Remove movement menu
2013-12-17 08:30:45 -08:00
Kevin Sawicki bdadf43341 Upgrade apm for unused dependency removal 2013-12-17 08:13:24 -08:00
Nathan Sobo 92b829c89b Upgrade to telepath 0.76.0 for deprecated shim methods 2013-12-16 19:25:30 -07:00
Nathan Sobo 3db9e16637 Upgrade to telepath 0.75.0 for custom object support 2013-12-16 19:03:10 -07:00
Kevin Sawicki 29d7735848 Upgrade to language-coffee-script@0.4.0 for catch indent fix 2013-12-16 17:59:48 -08:00
Kevin Sawicki 5b4b57f10f Merge pull request #1309 from shama/cleanscript
Add clean script
2013-12-16 17:59:22 -08:00
Kyle Robinson Young ed4b50e3b4 Rename removeCommand and set tmpdir to /tmp on osx/linux. 2013-12-16 17:51:20 -08:00
Kyle Robinson Young d526cfcba0 Change .node-type to .node-gyp in clean script 2013-12-16 17:51:20 -08:00
Kyle Robinson Young 0cf2cdceea Ability to delete without node_modules 2013-12-16 17:51:20 -08:00
Kyle Robinson Young 8239bb7e05 Add clean script 2013-12-16 17:51:20 -08:00
Ben Ogle 6d3e137db8 Upgrade to find-and-replace@0.61.0 2013-12-16 17:43:26 -08:00
Matt Colyer fa34eea27a Allow script/cibuild to run on windows 2013-12-16 17:33:45 -08:00
Kevin Sawicki 3e41b0967f Upgrade apm for sorted available output 2013-12-16 17:30:07 -08:00
Nathan Sobo bd3cfda2bb Merge branch 'master' into ns-telepathic-atom-global
Conflicts:
	src/atom.coffee
2013-12-16 18:18:06 -07:00
probablycorey 386b8a9e46 Remove movement menu 2013-12-16 17:11:59 -08:00
Kevin Sawicki 099b5186ab Upgrade apm for template activation change 2013-12-16 17:10:47 -08:00
Kevin Sawicki deab6027fb Upgrade to settings-view@0.51.0 2013-12-16 17:08:24 -08:00
Kevin Sawicki 590582782b Upgrade apm for template fixes 2013-12-16 16:43:20 -08:00
probablycorey abb0a3c792 Update metrics package 2013-12-16 16:10:07 -08:00
Ben Ogle 43baee5abd Merge pull request #1322 from atom/bo-fix-tabs-and-soft-wrap
Dont re-atomicize atomic tokens
2013-12-16 15:56:22 -08:00
Ben Ogle 75153388cc Use tab char 2013-12-16 15:50:26 -08:00
Ben Ogle b959fc0a6a use @ 2013-12-16 15:46:07 -08:00
Ben Ogle 77b5fd47ca Dont re-atomicize atomic tokens.
Fixes #1318
2013-12-16 15:34:27 -08:00
Kevin Sawicki f3a9500e61 Upgrade apm for unpublish command 2013-12-16 15:12:14 -08:00
probablycorey dadb0d5427 Update feedback package 2013-12-16 14:32:58 -08:00
Kevin Sawicki 9cdc15b161 Guard against no other focusable elements
This previously occurred in areas we all the elements had a -1 tabindex
 or were disabled.
2013-12-16 13:54:59 -08:00
Kevin Sawicki 7c27cbd9f5 Merge pull request #1320 from atom/ks-native-commands
Handle native commands in render process
2013-12-16 13:46:18 -08:00
Kevin Sawicki 010931391e Use event.target 2013-12-16 12:14:41 -08:00
Kevin Sawicki eaf6aba943 Return true from event handler 2013-12-16 12:12:14 -08:00
Kevin Sawicki d60d710325 Inline sendActionToFirstResponder 2013-12-16 12:11:19 -08:00
Kevin Sawicki bb1bcc233a Handle native commands in render process
This fixes copy, paste, undo, redo for elements with a native-key-bindings
class by forwarding to the menu's first responder from the render process.
2013-12-16 12:06:43 -08:00
Ben Ogle f0813dbca8 Upgrade to find-and-replace@0.60.0 2013-12-16 11:35:20 -08:00
Matt Colyer 9bded1cd19 Upgrade metrics@0.19.0 2013-12-16 11:32:08 -08:00
Ben Ogle c6e96a6188 Merge pull request #1308 from atom/bo-common-functions-up-a-level
Common core commands to workspaceView
2013-12-16 11:12:44 -08:00
probablycorey 09ff90bfc4 Update tabs package 2013-12-16 08:54:54 -08:00
Kevin Sawicki 2bf9036578 Upgrade to to-the-hubs@0.16.0 for menu tweak 2013-12-13 15:36:39 -08:00
Kevin Sawicki 6a7e4c30fb 🐎 Memoize version to prevent future IPC calls 2013-12-13 14:49:23 -08:00
Nathan Sobo ed41cc3cad Restore comment 2013-12-13 14:07:30 -08:00
Kevin Sawicki 9aee5adeb6 Upgrade to metrics@0.18.0 to report shell load time 2013-12-13 12:26:37 -08:00
Kevin Sawicki 70f3527123 Expose shell load time render process for metrics 2013-12-13 12:15:45 -08:00
Nathan Sobo e67e8ff0f5 Restore Atom::getLoadSettings and spy on it in window spec
I initially ripped out Atom::getLoadSettings in favor of a mutable
property because window spec was making an assumption that such a
property existed anyway. Since load settings need to be available from
class methods, the instance method just delegates to the class method.
But that means there's no ::loadSettings property to mutate in that
spec. I replaced the former approach with a spy which has the added
advantage of not polluting windowSettings for subsequent specs.
2013-12-13 12:02:48 -08:00
Kevin Sawicki 4448a7419c Upgrade to tree-view@0.50.0 2013-12-13 11:16:25 -08:00
Nathan Sobo e18a0f045a Upgrade to telepath 0.74.0 to avoid shredding of orphaned object graphs
We call atom.destroyOrphans after each spec now to clean up any orphaned
objects. Previously, we we destroying any object not reachable from the
root document. This was causing children of orphaned objects to be
removed from their parent, which caused null pointer exceptions when
running the destroy handlers for the orphans. Now we only destroy the
roots of orphaned object graphs.
2013-12-13 11:02:03 -08:00
Ben Ogle e8e84cbd2f Upgrade to tree-view@0.49.0 2013-12-13 10:38:39 -08:00
Ben Ogle e8c5027026 💄 Update specs to use ::function() format 2013-12-13 10:28:38 -08:00
Nathan Sobo da964a8f15 Fix comment 2013-12-13 09:55:45 -08:00
Nathan Sobo 2c4aee1181 Restore cloning of ::loadSettings in ::getLoadSettings
It's a deprecated method, but if you call it you'll get a clone.
2013-12-13 09:55:13 -08:00
Nathan Sobo 24d3f1daeb Reduce diff size by restoring old method order where possible 2013-12-13 09:50:57 -08:00
Nathan Sobo beb2fb08ea Merge branch 'master' into ns-telepathic-atom-global
Conflicts:
	package.json
2013-12-13 09:32:13 -08:00
Kevin Sawicki 7b86891642 Upgrade to tree-view@0.48.0 for scroll left fixes 2013-12-12 18:24:54 -08:00
Kevin Sawicki 87e325dce1 Set body's visibility to hidden when unloading
Previously the display was changed to none via $.hide() which accidentally
affected the ability of package's to serialize DOM properties such as
scrollTop since the value would always be zero when the display was none.

The goal here is to just prevent a flicker when refreshing the
editor window and setting visibility to hidden still accomplishes this.
2013-12-12 18:05:36 -08:00
Kevin Sawicki ee87c757ed Upgrade to tree-view@0.47.0 for arrow fix 2013-12-12 18:04:25 -08:00
Ben Ogle a25812dca7 Move cmd-s and cmd-S to workspaceView 2013-12-12 17:50:15 -08:00
Ben Ogle 1f9a7599b7 cmd-w works anywhere in the editor 2013-12-12 17:50:15 -08:00
Kevin Sawicki 07dee8838c Upgrade to tree-view@0.46.0 2013-12-12 17:46:09 -08:00
Kevin Sawicki 8367b020ec Upgrade to editor-stats@0.9.0 for bug fix 2013-12-12 17:41:50 -08:00
Nathan Sobo 9fce6a2f1c Merge branch 'ns-guard-dead-editors' 2013-12-12 17:11:20 -08:00
Nathan Sobo 165a417a9d Upgrade to telepath 0.73.0 for Document::create default values 2013-12-12 16:59:41 -08:00
Nathan Sobo 39fe0c418b Add back deprecated Atom::getLoadSettings method for packages 2013-12-12 16:49:00 -08:00
Nathan Sobo 75cee638bc Protect from exceptions when attaching editor views w/ dead editors
Addresses #1306

We still need to know why this is happening, so I left an exception in
non-release builds. Since the pane system is about to change a lot I
think this is good enough for now.
2013-12-12 16:41:35 -08:00
Matt Colyer ae72d4ad56 Upgrade exception-reporting@0.9.0 2013-12-12 16:41:09 -08:00
Nathan Sobo bfcb24f517 Fix pesky workspace view serialization spec
This isn't beautiful, but this whole approach is slated to be replaced
in the recent future.
2013-12-12 16:36:34 -08:00
Nathan Sobo 208ed09109 Use atom.state instead of defunct windowState in spec 2013-12-12 16:35:56 -08:00
Nathan Sobo 0b7f291e17 Remove reference to workspaceView in Atom::unloadEditorWindow 2013-12-12 16:35:26 -08:00
Nathan Sobo a61b057aea Eliminate exceptions in Editor::inspect 2013-12-12 16:34:48 -08:00
Nathan Sobo 4c817baf4c Don't destroy project when WorkspaceView is removed
Whenever we're removing the workspaceView, we're usually destroying
the project anyway.
2013-12-12 16:34:10 -08:00
Nathan Sobo a564cc66f6 Replace Atom::getLoadSettings with a ::loadSettings property
We assign a value into ::loadSettings anyway in a spec, so there's not
much point leaving it a method. Eventually I'd like to pass all these
settings in when constructing the Atom object and eliminate awareness
of the loadSettings altogether from the Atom global.
2013-12-12 16:33:30 -08:00
Nathan Sobo 14c58c4517 Set up window event handler for all windows 2013-12-12 15:45:25 -08:00
Nathan Sobo ebe77065cc Destroy orphans after each spec 2013-12-12 15:45:16 -08:00
Ben Ogle e1d35ed90f Upgrade dev-live-reload@0.20.0
Fix issue with reloading on changes to variable files
2013-12-12 15:45:00 -08:00
Corey Johnson 5d23a8fceb Merge pull request #1271 from atom/cj-deleted-files-not-modified
Handle deleted files correctly
2013-12-12 15:15:47 -08:00
Nathan Sobo 30b0fed60f Remove packageStates from atom state after specs just in case 2013-12-12 15:11:59 -08:00
probablycorey 90f3726c5c Fix window specs 2013-12-12 15:10:01 -08:00
Nathan Sobo 5f10c48219 Kill double project assignment 2013-12-12 14:40:12 -08:00
Nathan Sobo 23957d7f66 WIP: Make atom global a telepath model
Specs seem to be green but hang on what I'm assuming to be a long GC
pause near the end. I need to investigate what's going on memory wise.
2013-12-12 14:33:50 -08:00
probablycorey 58bf19cc83 Fix syntax error 2013-12-12 14:00:21 -08:00
probablycorey f439b04978 Update tree-view and find-and-replace packages 2013-12-12 13:37:56 -08:00
Ben Ogle f6d1647021 Upgrade git diff and all the themes with new colors. 2013-12-12 11:56:54 -08:00
Ben Ogle 0ccaf9049f Upgrade to dev-live-reload@0.19.0
Reload all themes when syntax variables change
2013-12-12 11:24:46 -08:00
probablycorey 132194337e Merge remote-tracking branch 'origin/master' into cj-deleted-files-not-modified 2013-12-12 11:00:17 -08:00
Ben Ogle f0198944b5 Merge pull request #1297 from atom/bo-diff-reload
Apply text to buffer via diff on reload
2013-12-12 10:40:47 -08:00
probablycorey f414c0955b Specs don't prompt to save editors by default. 2013-12-12 10:35:11 -08:00
Ben Ogle 4ffa5bb90e Make this fn private. 2013-12-12 10:34:08 -08:00
Ben Ogle 4dbca94d32 spec 💄 2013-12-12 10:34:08 -08:00
Ben Ogle 7111961929 Move function into setTextViaDiff() 2013-12-12 10:34:08 -08:00
Ben Ogle 5d46d7a881 💄 2013-12-12 10:34:08 -08:00
Ben Ogle 8d1d64d9d3 bufferRow -> row 2013-12-12 10:34:08 -08:00
Ben Ogle 60498616b7 numberLines -> lineCount 2013-12-12 10:34:08 -08:00
Ben Ogle ed745d2072 Remove log lines 2013-12-12 10:34:08 -08:00
Ben Ogle 1f69963982 Apply text to buffer via diff on reload
Previously, it would blindly read from disk on reload, and set the text 
into the editor. This was problematic as it would mess with markers and 
folds. No longer. 

Fixes #1285 and fixes atom/bookmarks#3
2013-12-12 10:34:08 -08:00
probablycorey 787b6fb677 Revert "Don't pop-up save dialog in specs"
This reverts commit e0ad22d0bd.
2013-12-12 10:09:41 -08:00
probablycorey 2d5b04579f Merge branch 'master' into cj-deleted-files-not-modified
Conflicts:
	src/pane.coffee
2013-12-12 09:57:28 -08:00
Kevin Sawicki 9fbfeb970b Remove mixins already added by Model superclass 2013-12-12 09:04:16 -08:00
Kevin Sawicki 63cac904ae Export telepath Model 2013-12-12 08:51:02 -08:00
Kevin Sawicki 04ad048e1f :non-potable_water Upgrade to space-pen@2.0.0 2013-12-12 08:15:48 -08:00
Nathan Sobo b9b8c61c11 🚱 Properly remove items from pane's state document
Fixes #1299.

This updates Pane::removeItemAtIndex to call Array::splice with the
index to be removed instead of Array::remove, which was changed to take
the *object* to be remove rather than an index. Oops.
2013-12-11 21:39:38 -08:00
Kevin Sawicki 6a8697a357 Upgrade to status-bar@0.27.0 for tooltip update 2013-12-11 19:13:09 -08:00
Kevin Sawicki bb35655e67 Upgrade to status-bar@0.26.0 for icon tweak 2013-12-11 19:02:06 -08:00
Kevin Sawicki 865d94d758 Add dev mode icon to status bar
Skull colliding with tabs was too much to handle.

Red square in status bar is the new indicator.
2013-12-11 18:57:07 -08:00
Matt Colyer 965e146bf2 Merge pull request #1298 from atom/upgrade-download-atom-shell
Upgrade grunt-download-atom-shell@0.2.1
2013-12-11 18:53:31 -08:00
Matt Colyer d97b394000 Upgrade grunt-download-atom-shell@0.2.1 2013-12-11 18:23:50 -08:00
Kevin Sawicki 29b85a1bb9 Clear the goal column when the cursor moves
Previously it was only cleared when changing the position explicitly
and not as a result of the underlying marker changing such as during a
text insertion.

Closes #1295
2013-12-11 18:02:52 -08:00
Kevin Sawicki dda65d82c3 Remove unused guid require 2013-12-11 17:49:31 -08:00
Kevin Sawicki 56de32f433 📝 Mention packages instead of extension 2013-12-11 17:23:23 -08:00
Kevin Sawicki 3cb751723d Register editor with project when deserializing 2013-12-11 17:18:03 -08:00
Nathan Sobo 344e6d15ce Merge branch 'ns-latest-telepath' 2013-12-11 17:03:19 -08:00
Nathan Sobo 8e7de0dc89 Upgrade to telepath 0.70.0 for undefined marker timestamp fix
This upgrades the serialization version of telepath documents because
for a window of time we were storing undefined timestamps. It also
adds dev-mode assertions that raise when the index of a solo marker
exceeds the array length. I think that issue should actually be resolved
and if we don't see an assertion failure here for a while we can remove
the Math.min shim.

Closes atom/telepath#7
2013-12-11 16:49:05 -08:00
probablycorey 3b388f16fd Update metrics package… again. 2013-12-11 16:47:43 -08:00
probablycorey c64b1a7628 Update metrics package 2013-12-11 16:37:38 -08:00
Kevin Sawicki 5ce71f5ded Upgrade to atom-dark-ui@0.17.0 for status icon tweak 2013-12-11 16:30:32 -08:00
Kevin Sawicki 02415ca400 Upgrade ui themes for hover removal 2013-12-11 16:04:13 -08:00
Nathan Sobo 69f357b538 Merge branch 'ns-latest-telepath' 2013-12-11 15:30:49 -08:00
Nathan Sobo 780441bdb8 Upgrade to telepath 0.68.0 for solo marker multiple undo fix 2013-12-11 15:19:46 -08:00
probablycorey e0ad22d0bd Don't pop-up save dialog in specs 2013-12-11 14:51:44 -08:00
probablycorey 115203cbd2 Update spec description 2013-12-11 14:48:12 -08:00
Nathan Sobo 0b5155f496 Set telepath.devMode to true when not on an official release
This will enable assertions inside of telepath to help us diagnose
atom/telepath#7. Otherwise, the issue *should* be covered over for end
users.
2013-12-11 14:47:52 -08:00
Nathan Sobo 4f18baaed5 Upgrade telepath to 0.67.0 for devMode flag 2013-12-11 14:46:40 -08:00
Kevin Sawicki 095320680f 📝 Start CoffeeScript styleguide 2013-12-11 14:35:06 -08:00
Nathan Sobo 8a8df8d6cb Add Atom::isReleasedVersion, which determines if the version is a SHA 2013-12-11 12:28:20 -08:00
Nathan Sobo 6bb4eaee93 Merge branch 'ns-teleditor' 2013-12-11 11:17:45 -08:00
Nathan Sobo 7710845cdc Use property accessors instead of accessing state directly 2013-12-11 11:10:43 -08:00
Nathan Sobo 8471ffed29 Observe scroll* behaviors instead of the entire state document 2013-12-11 11:10:06 -08:00
Nathan Sobo ce6d793528 Merge branch 'ns-reopen-uris' 2013-12-11 11:03:59 -08:00
Nathan Sobo e5bf70544e Document methods 2013-12-11 11:02:56 -08:00
Kevin Sawicki c591911455 📝 There is no tomorrow 2013-12-11 10:37:26 -08:00
Kevin Sawicki 44955e536b Upgrade to tree-view@0.44.0 2013-12-11 10:20:29 -08:00
Kevin Sawicki 6f25945911 Upgrade to fs-plus@0.11.0 to remove npm warning 2013-12-11 10:09:06 -08:00
Kevin Sawicki e5bd341f05 Set npm log level to warn instead of silent 2013-12-11 10:03:32 -08:00
Kevin Sawicki e9d4563084 Disable apm colors in CI builds 2013-12-11 09:40:30 -08:00
Kevin Sawicki b67ce8f4f8 Only retain last 10 releases 2013-12-11 09:17:47 -08:00
Kevin Sawicki 6a90bc1b17 Create prereleases 2013-12-11 09:06:59 -08:00
Kevin Sawicki 6ba8855d51 Upgrade apm for logging failed downloads 2013-12-11 09:05:40 -08:00
Kevin Sawicki e6b55cd521 Merge pull request #1220 from shama/grunt-cli
Prefer npm created node_modules/.bin/grunt
2013-12-11 08:37:01 -08:00
Kyle Robinson Young 59f453bb06 Prefer npm created node_modules/.bin/grunt 2013-12-10 19:36:48 -08:00
Nathan Sobo e275b6c414 Merge remote-tracking branch 'origin/master' into ns-reopen-uris 2013-12-10 19:13:21 -08:00
Nathan Sobo f3cdb6e0a2 Merge remote-tracking branch 'origin/master' into ns-teleditor 2013-12-10 19:10:09 -08:00
Nathan Sobo c4fc75215b Reintroduce editor serialization specs
I added some features to telepath that make it easier to test model
objects.

- First, you can now call replicate on any telepath document/model
  object. The entire underlying database will be replicated and you will
  be handed the equivalent of that object in the replicated world. This
  is easier than forcing you to attach the model to the window state 
  and then call replicate there. However, remember that the entire
  window state is actually being replicated so any references the model
  has will also be replicated.

- Second, you can also replicate orphaned objects. Most objects in these
  specs we're converting are orphans because there's no reason to attach
  them to the root document just to test them in isolation.
2013-12-10 19:07:50 -08:00
Kevin Sawicki 68e7c209bd Update apm for ci changes 2013-12-10 18:22:52 -08:00
Kevin Sawicki 1737df6ff9 Use .zip extension 2013-12-10 18:03:28 -08:00
Kevin Sawicki 897bf2f8e0 💄 Add assetName variable 2013-12-10 17:49:53 -08:00
Kevin Sawicki 1851c81e60 Log when delete response is non-204 2013-12-10 17:47:43 -08:00
Kevin Sawicki 938c85e616 Use default headers in publish release API call 2013-12-10 17:46:34 -08:00
Kevin Sawicki 350602a740 Merge pull request #1282 from atom/ks-builds-repo
Upload releases to atom/atom-master-builds repo
2013-12-10 17:45:35 -08:00
Kevin Sawicki f1ed51a823 Only publish master builds 2013-12-10 17:37:32 -08:00
Kevin Sawicki 086f0a0684 📝 Mention build-package script and atom-master-builds 2013-12-10 17:37:32 -08:00
Kevin Sawicki fbd8f7a1a7 Use commitSha variable 2013-12-10 17:37:32 -08:00
Kevin Sawicki 3e359e3c4e Upload releases to atom/atom-master-builds repo 2013-12-10 17:37:32 -08:00
Nathan Sobo 425c076221 Make Editor a telepath.Model subclass 2013-12-10 17:32:34 -08:00
Matt Colyer 351c1f1ab8 Merge pull request #1284 from atom/fix-atom-download-windows
Fix `grunt download-atom-shell` on Windows
2013-12-10 17:32:15 -08:00
Matt Colyer 1efde26230 Merge remote-tracking branch 'origin/master' into fix-atom-download-windows 2013-12-10 17:24:46 -08:00
Kevin Sawicki 527aa61fa1 Remove line-jumper until atom.io issue is resolved 2013-12-10 17:23:59 -08:00
Nathan Sobo 18a712a1f7 Reopen closed pane items in workspace – by uri instead of deserializing
Serializing and deserializing closed pane items was turning into a pain
with the new telepath changes that are phasing out this kind of on the
fly serialization. Reopening by uri saves memory and simplifies panes
enormously. If we want non-uri reopening we can revisit it later when
telepath models are better integrated.
2013-12-10 17:19:44 -08:00
Matt Colyer 6c8db8ee49 Upgrade grunt-download-atom-shell@0.2.0 2013-12-10 17:18:52 -08:00
probablycorey 4bfcdf4d5b Remove unmodified editors from pane when the buffer is deleted 2013-12-10 17:08:07 -08:00
Kevin Sawicki c1f3499359 Upgrade to metrics@0.15.0 for window load time reporting 2013-12-10 17:06:48 -08:00
probablycorey 201717a9aa Remove duplicate destroy
Telepath now emits the 'destroy' event
2013-12-10 17:04:46 -08:00
Ben Ogle 3e83364e38 Update line-jumper 2013-12-10 16:52:49 -08:00
Kevin Sawicki ba681023da Upgrade to language-javascript@0.4.0 for log snippet 2013-12-10 16:46:31 -08:00
Ben Ogle 2ae7775caf Upgrade to underscore-plus@0.5.0 2013-12-10 16:27:29 -08:00
Ben Ogle b2ab9d3246 Upgrade the themes to fix text hover colors 2013-12-10 16:10:56 -08:00
Kevin Sawicki 7cc61c5252 📝 Add locally 2013-12-10 15:22:21 -08:00
Kevin Sawicki b3b2be2430 📝 Add setting up travis doc 2013-12-10 15:21:58 -08:00
Ben Ogle 1674f16a0e Add line-jumper package to default install 2013-12-10 15:10:27 -08:00
probablycorey 24c84fe09c Merge remote-tracking branch 'origin/master' into cj-deleted-files-not-modified 2013-12-10 14:46:26 -08:00
Kevin Sawicki 2136fdaa60 Set cwd to vendor/apm instead of cd'ing 2013-12-10 14:11:10 -08:00
Kevin Sawicki 347eb9ce83 Merge pull request #1281 from atom/ks-upload-release
Upload master builds to releases
2013-12-10 14:01:54 -08:00
probablycorey a3eb76d630 💄 2013-12-10 13:52:42 -08:00
Kevin Sawicki 163994340d Log Atom release tag name 2013-12-10 13:51:09 -08:00
probablycorey 8ffa8fed12 Always use Pane::addItem when adding items. 2013-12-10 13:50:51 -08:00
Kevin Sawicki 2141d06f61 Upload master builds only 2013-12-10 13:33:31 -08:00
Kevin Sawicki e1a1a7efc9 Log what release is being uploaded to 2013-12-10 13:24:02 -08:00
Kevin Sawicki f3f94a2af0 Drop prerelease from asset name 2013-12-10 12:59:32 -08:00
Kevin Sawicki 3d8e304b1c Allow script/upload-release to be called directly 2013-12-10 12:48:34 -08:00
Kevin Sawicki 2d0ba3e1f9 Uncomment branch check 2013-12-10 12:48:34 -08:00
Kevin Sawicki be0ebab841 Delete existing before uploading new one 2013-12-10 12:48:34 -08:00
Kevin Sawicki 8c1d49c703 Exit with 1 when upload fails 2013-12-10 12:48:34 -08:00
Kevin Sawicki 4af71391a6 Use basename of assetPath in zip command 2013-12-10 12:48:34 -08:00
Kevin Sawicki 90802e3725 Check for error being null and default body to empty string 2013-12-10 12:48:34 -08:00
Kevin Sawicki a9d1afdf65 Rename upload variable to assetRequest 2013-12-10 12:48:34 -08:00
Kevin Sawicki 2a51eb7614 Remove unneeded key name 2013-12-10 12:48:34 -08:00
Kevin Sawicki 96d38d7252 💄 Use return unless 2013-12-10 12:48:34 -08:00
Kevin Sawicki 4705e382bf Convert script/upload-release to CoffeeScript 2013-12-10 12:48:33 -08:00
Kevin Sawicki 11f8eba2c3 Add initial upload-release script 2013-12-10 12:48:33 -08:00
Ben Ogle d638fe9ca0 Upgrade to command-palette@0.13.0 2013-12-10 12:40:25 -08:00
Ben Ogle 3f69197a08 Update command palette to better handle keybindings.
Fixes #1233
2013-12-10 12:31:25 -08:00
Ben Ogle 43bf47fa26 Upgrade to underscore-plus@0.4.0 2013-12-10 11:47:53 -08:00
Kevin Sawicki 092ed37ed9 Remove unused core.hideGitIgnoredFiles config setting 2013-12-10 11:07:05 -08:00
probablycorey 19da22d440 Revert "Project doesn't serialize non-modified buffers that don't exist on disk"
This reverts commit ec3e139632.
2013-12-10 10:15:03 -08:00
probablycorey 51ff3ec46a Revert "Rename destroyNonExistentNonModified"
This reverts commit 22ec8c3a75.
2013-12-10 10:14:56 -08:00
Kevin Sawicki 36b5518add Upgrade to solarized-dark-syntax@0.5.0 for git commit colors 2013-12-10 10:10:22 -08:00
Kevin Sawicki dbdb51db2f 📝 Update wrapGuide to wrap-guide 2013-12-10 09:52:20 -08:00
Kevin Sawicki 7db11ea3c6 Upgrade to gists@0.13.0 for untitled editor fix 2013-12-10 09:51:43 -08:00
Kevin Sawicki f6ce92e52d Upgrade to wrap-guide@0.10.0 for spec fixes 2013-12-10 09:31:45 -08:00
Kevin Sawicki 6c1999ab60 Upgrade to wrap-guide@0.9.0 for config prefix change 2013-12-10 09:28:57 -08:00
Kevin Sawicki 3dde91dd3d Upgrade apm for template fixes 2013-12-10 08:06:01 -08:00
Nathan Sobo 9deec49f81 Bump editor serialization version 2013-12-10 01:44:10 -08:00
Nathan Sobo 7c3106d9d9 Merge branch 'ns-teleditor' 2013-12-10 01:40:14 -08:00
Nathan Sobo 7138d5b888 Merge branch 'master' into ns-teleditor
Conflicts:
	package.json
2013-12-10 01:33:23 -08:00
Nathan Sobo 43495f05ba Restore package specs in suite. Didn't mean to commit these comments. 2013-12-10 01:31:04 -08:00
Nathan Sobo 518a929880 Merge branch 'ns-latest-telepath' 2013-12-10 01:16:03 -08:00
Nathan Sobo dd00f0d4ea Upgrade to telepath 0.65.0 for markers + undo fix
Fixes #1197
2013-12-10 01:08:33 -08:00
Kevin Sawicki 20d8458009 Upgrade apm for package template fix 2013-12-09 19:43:00 -08:00
Kevin Sawicki 13f45c615a Upgrade to language-gfm@0.10.0 for HTML entities 2013-12-09 19:35:42 -08:00
Ben Ogle 998d542825 Upgrade to find-and-replace@0.58.0 2013-12-09 18:10:13 -08:00
Kevin Sawicki fccc47023c Upgrade to pathwatcher@0.11.0 for flaky tree-view spec fix 2013-12-09 18:08:19 -08:00
Kevin Sawicki a2f2efe8b3 Upgrade to base16-tomorrow-dark-theme@0.7.0 for git commit colors 2013-12-09 17:56:55 -08:00
Kevin Sawicki c6bdc59fef Upgrade to fuzzy-finder@0.28 for reload fix 2013-12-09 17:38:01 -08:00
Kevin Sawicki 047e5e696f Prepare 0.44.0 release 2013-12-09 15:33:28 -08:00
Kevin Sawicki 72191f3d3d Add atom.getWindowLoadTime() API to be used by metrics 2013-12-09 15:20:22 -08:00
Kevin Sawicki 5ced583a7c Prepare 0.43.0 release 2013-12-09 14:40:54 -08:00
Nathan Sobo c326988a7d Merge branch 'master' into ns-teleditor 2013-12-09 12:40:38 -08:00
Nathan Sobo 5ff47f3aa1 Call atom.create with TokenizedBuffer before testing it 2013-12-09 12:28:13 -08:00
Ben Ogle 308bb95ea2 upgrade to feedback@0.16.0 2013-12-09 12:09:37 -08:00
probablycorey 22ec8c3a75 Rename destroyNonExistentNonModified 2013-12-09 12:06:44 -08:00
Ben Ogle 3490022180 Upgrade to find-and-replace@0.57.0 2013-12-09 11:53:49 -08:00
probablycorey ec3e139632 Project doesn't serialize non-modified buffers that don't exist on disk 2013-12-09 11:41:57 -08:00
probablycorey 63e3be8630 Only mark a deleted file as modified if it was previously modified.
Fixes #693
2013-12-09 11:06:29 -08:00
Ben Ogle e61d482384 Ugrade to find-and-replace@o0.56.0 2013-12-09 10:43:41 -08:00
Kevin Sawicki b108b5030a Upgrade to language-ruby@0.6.0 2013-12-09 08:18:30 -08:00
Kevin Sawicki 943fe29ca3 Upgrade to metrics@0.14.0 for spec fixes 2013-12-09 08:17:39 -08:00
Kevin Sawicki 2bbf7fd0d7 Upgrade to metrics@0.13.0 2013-12-09 08:09:59 -08:00
Cheng Zhao 42e9c612b2 Merge pull request #1219 from atom/atom-shell-v0.7.5
Update to atom-shell v0.7.6.
2013-12-09 01:00:24 -08:00
Cheng Zhao 33778cefdd Merge branch 'master' into atom-shell-v0.7.5 2013-12-09 16:52:05 +08:00
Cheng Zhao 39fb5dc134 Update to atom-shell v0.7.6. 2013-12-09 16:46:27 +08:00
Kevin Sawicki ffedaa1bc1 Upgrade to git-diff@0.20.0 for new move commands 2013-12-08 20:02:12 -08:00
Nathan Sobo 3402504779 Merge branch 'ns-latest-telepath' 2013-12-07 14:09:39 -08:00
Nathan Sobo c8253be1ae Use the softWrap property directly 2013-12-07 14:08:00 -08:00
Nathan Sobo 9ede5f85e3 Use the ::editorWidthInChars property directly 2013-12-07 14:07:46 -08:00
Nathan Sobo 640fd0051b Clarify comment 2013-12-07 14:03:14 -08:00
Nathan Sobo 779c918179 Reorder requires 2013-12-07 14:03:07 -08:00
Nathan Sobo ee1f21439d Merge branch 'ns-latest-telepath' into ns-teleditor 2013-12-07 13:59:35 -08:00
Nathan Sobo f25d8d83c5 Merge branch 'master' into ns-latest-telepath 2013-12-07 13:58:53 -08:00
Nathan Sobo b4270b1e9e Merge branch 'ns-mock-cson-in-config-specs' 2013-12-07 13:52:00 -08:00
Kevin Sawicki 98701283e8 Merge pull request #1247 from atom/ks-observe-tab-length
Observe editor.tabLength config in TokenizedBuffer
2013-12-07 11:52:18 -08:00
Kevin Sawicki 34f71a2623 Observe editor.tabLength config in TokenizedBuffer
Closes #1224
2013-12-07 11:43:48 -08:00
Kevin Sawicki af06bf8984 Merge pull request #1258 from atom/ks-refresh-less-cache
Refresh less cache before activating themes
2013-12-07 11:38:32 -08:00
Kevin Sawicki 796632c36c Refresh less cache before activating themes
This ensures the import paths for themes contain the stylesheet directories

Closes #1225
2013-12-07 11:31:06 -08:00
Kevin Sawicki 65fa5bf880 Upgrade to settings-view@0.50.0, closes #1264 2013-12-07 11:28:02 -08:00
Nathan Sobo 1ccc93c50b Make DisplayBuffer a telepath model subclass 2013-12-07 03:07:15 -08:00
Nathan Sobo f4d19810b8 💄 2013-12-07 03:07:02 -08:00
Nathan Sobo 1c74925637 Upgrade to telepath 0.62.0 2013-12-07 02:36:07 -08:00
Nathan Sobo a4d2b4d21a Make TokenizedBuffer a telepath.Model subclass
There's a bunch of improvised code to make this work right now because
of the circularity of this refactoring. It will stabilize over time.
2013-12-07 02:25:47 -08:00
Nathan Sobo 88eb803d91 Mock season.writeFileSyne instead of fs.writeFileSync in config specs
The spec suite has been overwriting my config directory in weird cases.
While investigating it I noticed that we mock writeFileSync directly in
these specs, but we actually use season to write the config cson. This
makes this spec a bit simpler because it doesn't have to parse the CSON
in the spec. Lower level assertions belong on the season package itself.
2013-12-06 22:10:26 -08:00
Nathan Sobo b61654b52f Upgrade to telepath 0.61.0
This version adds a bunch of reactive primitives and ensures we destroy
documents when they are no longer referenced.
2013-12-06 21:55:57 -08:00
Nathan Sobo db1768a9c7 Upgrade feedback to 0.15.0 for spec fix 2013-12-06 21:55:43 -08:00
Nathan Sobo 6156dac3de Update status-bar to 0.24.0 so specs pass with new telepath 2013-12-06 19:57:05 -08:00
Daniel Hengeveld d5a7f7396e Merge pull request #1259 from atom/fix-doc-url
fix doc url
2013-12-06 14:16:06 -08:00
Daniel Hengeveld ca65ff6c55 fix doc url 2013-12-06 14:15:19 -08:00
Ben Ogle 49782d3335 Upgrade to feedback!0.14.0 2013-12-06 13:55:15 -08:00
Kevin Sawicki e45aeecb0a Update specs now that syntax themes have stylesheets folders 2013-12-06 13:24:34 -08:00
Kevin Sawicki d3edf33dc4 Upgrade syntax themes with new syntax-variables.less 2013-12-06 13:08:20 -08:00
Kevin Sawicki c54c925793 Merge pull request #1246 from atom/ks-color-commit-messages
Add a splash of color to commit messages
2013-12-06 13:06:52 -08:00
Kevin Sawicki e3b89aca93 Use defaults similar to ui-variables colors 2013-12-06 12:56:15 -08:00
Kevin Sawicki 9183d4968f Only include used colors for now 2013-12-06 12:56:14 -08:00
Kevin Sawicki 1aa96fc37a Drop text segment from color 2013-12-06 12:56:14 -08:00
Kevin Sawicki d75d3b6d09 Import syntax-variables in atom.less 2013-12-06 12:56:14 -08:00
Kevin Sawicki f60856eca7 Add more syntax variables 2013-12-06 12:56:14 -08:00
Kevin Sawicki 3a7049a1d9 Import syntax in atom.less 2013-12-06 12:56:14 -08:00
Kevin Sawicki 29d1b42d04 Move git markup styles to syntax.less 2013-12-06 12:56:14 -08:00
Kevin Sawicki 80552675d0 Add initial syntax-variables.less 2013-12-06 12:56:14 -08:00
Kevin Sawicki ff696355ee Use color variables for commit message files 2013-12-06 12:56:14 -08:00
Kevin Sawicki 3a2c4ca74d Upgrade to github-sign-in@0.15.0 2013-12-06 12:53:53 -08:00
Kevin Sawicki 777cc4b561 Merge pull request #1236 from atom/package-install-docs
Add manual package install directions to Atom docs
2013-12-06 12:27:54 -08:00
Kevin Sawicki c0fe3c01de 📝 Remove extra space 2013-12-06 12:26:52 -08:00
Kevin Sawicki 97dbe0d3b2 📝 Wording tweaks and link to apm and emmet 2013-12-06 12:26:24 -08:00
Cameron McEfee 250938869e Use @gjtorikian's suggested copy 2013-12-06 12:26:24 -08:00
Cameron McEfee 6092de9af8 Add manual package install directions to Atom docs 2013-12-06 12:26:23 -08:00
Ben Ogle 01855901e7 Upgrade release-notes and github-sign-in 2013-12-06 12:07:16 -08:00
Ben Ogle 161542a4af Merge pull request #1240 from atom/bo-token-stuff
Add token dealings to atom core
2013-12-06 12:04:52 -08:00
Ben Ogle 6d2bd7756e Add the getGitHubAuthTokenName fn back in 2013-12-06 11:57:31 -08:00
Ben Ogle f0fece2cf0 Add getters and setters for the keychain 2013-12-06 11:45:18 -08:00
Ben Ogle c36ee1dbe6 Add getGitHubTokenName 2013-12-06 11:39:40 -08:00
Ben Ogle 76ec5a98c4 Upgrade to atom-dark-ui@0.13.0 2013-12-06 10:59:16 -08:00
Ben Ogle ec022b5c77 Upgrade to feedback@0.13.0 2013-12-06 10:44:40 -08:00
Kevin Sawicki 912636a599 Upgrade to autosave@0.10.0 refs #1183 2013-12-06 10:05:44 -08:00
Kevin Sawicki 011c3cc223 Merge pull request #1237 from atom/ks-hard-tab-cache
Fix caching of hard tabs
2013-12-06 08:55:08 -08:00
Kevin Sawicki 433b64d581 Update spec for new hard tab span text length 2013-12-06 08:27:00 -08:00
Kevin Sawicki 365d69a19c Add missing s to invisible 2013-12-06 08:26:59 -08:00
Kevin Sawicki 5d1e507988 Remove extra newline 2013-12-06 08:26:59 -08:00
Kevin Sawicki 776b267396 💄 Correct indent 2013-12-06 08:26:59 -08:00
Kevin Sawicki 77e4b7f90f Use value ivar when invisible.tab is falsy 2013-12-06 08:26:59 -08:00
Kevin Sawicki 2501b98e8f Fix typo constructor 2013-12-06 08:26:59 -08:00
Kevin Sawicki 32d301ef34 typo: invisibles not invisible 2013-12-06 08:26:59 -08:00
Kevin Sawicki & Nathan Sobo f4861b7919 💄 Use @constructor instead of EditorView 2013-12-06 08:26:59 -08:00
Kevin Sawicki & Nathan Sobo 94e4fef108 Use DisplayBuffer::lineForRow in EditorView::positionLeftForLineAndColumn
Previously the tokenized lines were obtained from the tokenized buffer
which skipped the translation to screen coordinates.

Closes #1231
2013-12-06 08:26:59 -08:00
Kevin Sawicki & Nathan Sobo 7ae432fad5 Place entire hard tab value inside span
Previously only the first character was included in the span.
2013-12-06 08:26:59 -08:00
Ben Ogle 18057e303b Remove getUserAgent. just use navigator.userAgent 2013-12-05 18:55:20 -08:00
Matt Colyer 71064adae2 Upgrade grunt-download-atom-shell@0.1.3 2013-12-05 16:44:55 -08:00
Matt Colyer 43d964c357 Upgrade grunt-download-atom-shell@0.1.2 2013-12-05 11:39:59 -08:00
Ben Ogle 5f4115cb81 Add more native keybindings 2013-12-05 11:08:14 -08:00
Kevin Sawicki 8cf2cdb2a9 Add script/install-cli to install atom and apm 2013-12-05 11:02:37 -08:00
Kevin Sawicki a460530770 Show warning message opening opening dev window without repo cloned 2013-12-05 10:43:45 -08:00
Kevin Sawicki 162bab506d Mention package repositories 2013-12-05 08:50:58 -08:00
Cheng Zhao 6c5669b53d Add "productName" in package.json.
Atom-Shell would use it as application's name.
2013-12-05 18:15:26 +08:00
Cheng Zhao a7db8229d5 Also change the version field of package.json in set-development-version task. 2013-12-05 18:13:42 +08:00
Cheng Zhao b7848d760f Update to atom-shell v0.7.5. 2013-12-05 17:48:55 +08:00
Ben Ogle e6d8f3b9bf Merge pull request #1218 from shama/doc-typos
A couple typo fixes in the docs.
2013-12-04 21:12:09 -08:00
Kyle Robinson Young 0e270f85ba A couple typo fixes in the docs. 2013-12-04 20:40:27 -08:00
Kevin Sawicki 9e3f4dc033 Prepare 0.42.0 release 2013-12-04 19:04:36 -08:00
Kevin Sawicki c1a744b29c Make ATOM_ACCESS_TOKEN available in all grunt commands 2013-12-04 19:02:39 -08:00
Kevin Sawicki a283161c1e Upgrade to tree-view@0.43.0 refs #1213 2013-12-04 18:24:28 -08:00
Ben Ogle 9ede9571bc Upgrade to release-notes@0.14.0 2013-12-04 16:32:52 -08:00
Ben Ogle dbc21befec Upgrade to welcome@0.3.0 2013-12-04 16:28:31 -08:00
Ben Ogle ca0f0357d7 Upgrade to feedback@0.12.0 2013-12-04 16:25:15 -08:00
probablycorey be1c1f8719 Use permanent image link for atom logo 2013-12-04 16:19:33 -08:00
Cheng Zhao e95c60b4ec 💄 Fix typo in dialog. 2013-12-05 08:17:33 +08:00
probablycorey 847dd6d93b Update welcome package 2013-12-04 16:03:29 -08:00
Kevin Sawicki 7f62720350 Merge pull request #1208 from atom/ks-erb-infinite-parse-loop
Prevent infinite loop in erb grammar
2013-12-04 15:34:10 -08:00
Kevin Sawicki 8af0a59c52 Pop stack when rule is pushed without position advancement
Previously only the scope name was checked which allowed cases
were rules without scope names to grow the stack infinitely without
advancing the position.

Closes atom/language-ruby-on-rails#1
2013-12-04 15:18:33 -08:00
Kevin Sawicki 31a909828d Don't override ATOM_ACCESS_TOKEN if already set 2013-12-04 14:40:37 -08:00
Ben Ogle 78562dcf15 Upgrade to github-sign-in@0.14.0 2013-12-04 14:31:23 -08:00
Ben Ogle 4869fad7f6 Add styling for headings in overlays. 2013-12-04 14:29:32 -08:00
probablycorey 77da136d17 Update cmd-shift-P references and getting started doc 2013-12-04 14:07:43 -08:00
probablycorey 67b1d0d22a Update atom shell to 0.7.4 2013-12-04 14:03:58 -08:00
Kevin Sawicki 23fcb59c5d Upgrade to language-ruby@0.5.0 2013-12-04 14:00:50 -08:00
probablycorey 16ef30dc82 Update feedback package 2013-12-04 12:09:11 -08:00
Ben Ogle e3a4f450ad Update themes to have better tree-view focusing 2013-12-04 12:06:04 -08:00
Kevin Sawicki 847578398d Prepare 0.41.0 release 2013-12-04 12:02:08 -08:00
Kevin Sawicki 63dc8863e3 Use atom-bot's token as ATOM_ACCESS_TOKEN 2013-12-04 11:38:25 -08:00
Kevin Sawicki 58d09ec5a0 Update to fs-plus@0.10.0 2013-12-04 11:36:38 -08:00
Ben Ogle bb5d70fa2e Merge pull request #1182 from atom/removing-core-treeview-settings
Removing core treeview settings
2013-12-04 11:26:06 -08:00
Kevin Sawicki 4a904673e5 Upgrade apm for keychain token name fix 2013-12-04 11:22:50 -08:00
Kevin Sawicki 4c1d47779b 💄 Sort themes better 2013-12-04 09:36:14 -08:00
Kevin Sawicki a0adc32e04 💄 Sort themes 2013-12-04 09:35:50 -08:00
Kevin Sawicki 2434db4dc2 Merge pull request #1174 from atom/cj-update-docs
Update docs
2013-12-04 09:17:16 -08:00
Kevin Sawicki e2ee99556d Merge branch 'master' into cj-update-docs 2013-12-04 09:01:27 -08:00
Kevin Sawicki cececc2297 Update to new logo url 2013-12-04 08:58:04 -08:00
Kevin Sawicki f0825ca526 Add simple explanation 2013-12-04 08:55:19 -08:00
Kevin Sawicki 57c0261f96 Add Git commit messages section 2013-12-04 08:53:24 -08:00
Kevin Sawicki 6891922e07 Use friendlier emoji 2013-12-04 08:50:43 -08:00
Kevin Sawicki e03a7c336d Add example to require ordering section 2013-12-04 08:50:07 -08:00
Kevin Sawicki 49a32dd2dc Remove cmake dependency 2013-12-04 08:48:45 -08:00
Kevin Sawicki 94d4ad618c Add require(atom) for home directory example 2013-12-04 08:48:22 -08:00
Cheng Zhao 9b0f8ccee0 Merge pull request #1192 from atom/grunt-download-atom-shell
Use grunt-download-atom-shell to download and update atom-shell.
2013-12-03 22:07:34 -08:00
Nathan Sobo fa963f0583 Upgrade telepath to 0.45.1 in hopes of addressing #1153
Basically, it just hacks ArrayMarker::getRawStart/EndIndex in
non-replicated mode to check that the index isn't out of range. I'd
rather get to the root cause but I'm hoping this can save us some pain
in the short term while a lot of balls are in the air.
2013-12-03 20:17:01 -06:00
Ben Ogle d36c4f0ec9 getUserAgent() 2013-12-03 17:45:40 -08:00
probablycorey e6e72d99f3 Add welcome package 2013-12-03 15:37:48 -08:00
Kevin Sawicki 9ce22fd6d3 Add back internally used isPathModified 2013-12-03 13:37:21 -08:00
Garen Torikian 5166ca274c 📝 Typo fix 2013-12-03 13:02:35 -08:00
Kevin Sawicki 6f1dd702b0 Add back internally used Project::findBufferForPath 2013-12-03 12:12:28 -08:00
Kevin Sawicki 1d4f447975 📝 Fill in SelectList docs 2013-12-03 12:02:41 -08:00
Kevin Sawicki 4998fdda85 Remove unused methods in Project 2013-12-03 11:40:28 -08:00
Ben Ogle aa52428c26 Merge pull request #1193 from atom/dev-icon
Adjusting padding for new tabs
2013-12-03 11:30:43 -08:00
Matt Graham 9c1127dd1b adjusting padding for new tabs 2013-12-03 11:30:19 -08:00
Kevin Sawicki 91d4ef2653 📝 Mark more EditorView methods private 2013-12-03 11:25:17 -08:00
Kevin Sawicki 80cc881912 📝 Remove FIXME in Editor::transpose 2013-12-03 11:21:12 -08:00
Kevin Sawicki 867aaa8f95 📝 Move transact to public section with delegates tag 2013-12-03 11:21:12 -08:00
Kevin Sawicki 28a1dc58e7 Merge pull request #1190 from atom/ks-soft-wrap-cache
Use buffer positions for char width cache
2013-12-03 11:06:31 -08:00
Kevin Sawicki ee7ef0f893 Add spec that previously failed 2013-12-03 10:54:27 -08:00
Kevin Sawicki eaf60a00b3 Use TokenizedLine::tokenAtBufferColumn to obtain scopes 2013-12-03 10:54:27 -08:00
Kevin Sawicki e01c19e6b7 Use buffer positions when calculating char widths
Previously the editor width cache was being accessed using
screen columns which could cause incorrect position left values
for wrapped lines.

Closes #1096
2013-12-03 10:54:27 -08:00
Kevin Sawicki 930e479cdb Upgrade apm for template updates 2013-12-03 10:50:47 -08:00
Matt Graham 46c6d63dcd removing focus from core 2013-12-03 10:37:31 -08:00
Kevin Sawicki 1b502c6349 Prepare 0.40.0 release 2013-12-03 10:04:54 -08:00
Kevin Sawicki 07eb01016d Upgrade to tree-view@0.42.0 for spec cleanup 2013-12-03 09:28:32 -08:00
Cheng Zhao 99d6955644 Ignore grunt-download-atom-shell when loading packages. 2013-12-03 22:04:21 +08:00
Cheng Zhao 3f05ff9b14 Download grunt-download-atom-shell from apm registry.
I published grunt-download-atom-shell to apm registry so we do not need
to specify a git URL here, and as I tested the CI cannot fetch private
node module repositories due to lack of credient.

When it could be public we should publish it to npm registry instead.
2013-12-03 21:10:16 +08:00
Cheng Zhao 9caf3ca349 💄 Fix atom-shell's download dir. 2013-12-03 20:13:17 +08:00
Cheng Zhao 25a1b77048 Use grunt-download-atom-shell to download and update atom-shell. 2013-12-03 19:54:42 +08:00
Cheng Zhao 866c0c0668 Merge pull request #1191 from atom/atom-shell-v0.7.3
Update atom-shell to v0.7.3.
2013-12-02 20:55:09 -08:00
Cheng Zhao 6094efde76 Update atom-shell to v0.7.3. 2013-12-03 12:45:55 +08:00
Cheng Zhao b4099ba66f Use the new breakpad crash reporter in both browser and renderer. 2013-12-03 12:45:44 +08:00
probablycorey 10b560b5a7 Update feedback package 2013-12-02 16:21:38 -08:00
probablycorey 305c331777 Update feedback package 2013-12-02 16:10:27 -08:00
probablycorey 0b5cad27d2 Add ' body' to make .native-binding selector more specific 2013-12-02 16:09:43 -08:00
Kevin Sawicki 7d967e71f4 Upgrade apm for new templates 2013-12-02 15:02:14 -08:00
Kevin Sawicki d36a0aa437 Update file.icns to match atom.icns 2013-12-02 11:52:05 -08:00
Kevin Sawicki 8316da3338 Use long opts strings for clarity 2013-12-02 11:26:51 -08:00
Kevin Sawicki a0b200565c Specify callback to dialog.showOpenDialog 2013-12-02 11:21:29 -08:00
Kevin Sawicki 8f4de0b568 Merge pull request #1184 from atom/ks-no-more-ids
Use classes instead of ids
2013-12-02 09:49:40 -08:00
Kevin Sawicki 45cd3e9335 Upgrade themes for id to class renames 2013-12-02 09:35:51 -08:00
Kevin Sawicki c58b30bba9 Use class instead of id for pane container 2013-12-02 08:41:34 -08:00
Kevin Sawicki 0093f39102 Add classes to workspace view elements 2013-12-02 08:32:23 -08:00
Kevin Sawicki b1f041fa6e Use a class instead of id for panes element 2013-12-02 08:27:32 -08:00
Kevin Sawicki ca11661f6d Use a class instead of id for vertical element 2013-12-02 08:26:07 -08:00
Kevin Sawicki bc4ceb189c Use a class instead of id for horizontal element 2013-12-02 08:25:48 -08:00
Kevin Sawicki 98694e5407 Use a class instead of id for workspace view 2013-12-02 08:23:29 -08:00
Kevin Sawicki 86ae743e9d Use correct workspace view id 2013-12-02 08:17:31 -08:00
Kevin Sawicki dddd515c35 Upgrade packages for EditSession/Editor renames 2013-11-28 09:27:01 -08:00
Kevin Sawicki 85d46004fd Merge pull request #1155 from atom/ks-license
Add license
2013-11-28 09:26:23 -08:00
Kevin Sawicki 5cb6aa0538 Add initial LICENSE.md 2013-11-28 09:20:05 -08:00
Ben Ogle d228cfe1ee Upgrade to find-and-replace@0.55.0 2013-11-27 16:13:19 -08:00
probablycorey a8f7c5201b Add more keystrokes to .native-key-bindings 2013-11-27 14:20:45 -08:00
probablycorey e15b96691e Sort node modules to the top of require list 2013-11-27 13:29:49 -08:00
Corey Johnson 3053c4a585 Merge pull request #1168 from atom/cj-feedback-package
Add feedback package
2013-11-27 11:32:59 -08:00
probablycorey 776d58bf21 Merge remote-tracking branch 'origin/master' into cj-feedback-package
Conflicts:
	package.json
	src/editor-view.coffee
2013-11-27 11:26:34 -08:00
probablycorey 1b5762274c Update contribution guidelines 2013-11-27 11:20:22 -08:00
probablycorey 1f20dbf16d Remove philosophy portion from contributions.
I feel like these suggestions are too subjective. I think we could
expand upon these ideas in a separate document, but they are a bit 
overwhelming for new contributors.
2013-11-27 11:19:37 -08:00
probablycorey 9fe507d675 Update readme and build instructions 2013-11-27 10:59:11 -08:00
Cheng Zhao a190a069c1 Ship the "resources" dir in Atom.app, and do not copy icon separately, fixes #1165. 2013-11-27 14:58:25 +08:00
Kevin Sawicki c697e58a71 Upgrade to styleguide@0.17.0 for EditorView rename fixes 2013-11-26 19:53:24 -08:00
Kevin Sawicki 1f36d0ca02 Upgrade to space-pen@2.0.1
Closes #1164
2013-11-26 19:44:27 -08:00
Kevin Sawicki 235a1e46ab Merge pull request #1169 from atom/ks-remove-editor-shims
Rename EditSession/Editor to Editor/EditorView
2013-11-26 19:43:53 -08:00
Kevin Sawicki 1197dc1979 Upgrade to find-and-replace@0.54.0 2013-11-26 19:36:01 -08:00
Kevin Sawicki 94e94506b5 Upgrade to tree-view@0.41.0 2013-11-26 19:36:01 -08:00
Kevin Sawicki 163c800d55 Upgrade to bracket-matcher@0.14.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 3f5a6184b6 Upgrade to bookmarks@0.15.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 77819616a8 Upgrade to autoflow@0.11.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 3749726742 Upgrade to autocomplete@0.18.0 2013-11-26 19:35:44 -08:00
Ben Ogle d22d6e9af2 Upgrade to git-diff@0.19.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 7ad6f0b18b Upgrade to fuzzy-finder@0.27.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki cdfd27be3e Delegate EditorView::save to Editor::save 2013-11-26 19:35:44 -08:00
Kevin Sawicki 4e554a4941 Upgrade to markdown-preview@0.21.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 3db5cad927 Upgrade to github-sign-in@0.13.0 2013-11-26 19:35:44 -08:00
Kevin Sawicki 1a21600bde Upgrade to symbols-view@0.26.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 3c3811c527 Upgrade to spell-check@0.17.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 16c0ef935f Upgrade to snippets@0.17.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 6cc897ac67 Upgrade to settings-view@0.49.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 80782feb24 Upgrade to package-generator@0.23.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 3cfe50585a Move eachBuffer spec to project-spec 2013-11-26 19:35:43 -08:00
Kevin Sawicki 4c336ed0ee Upgrade to grammar-selector@0.13.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki c1cf8936eb Don't through exception from setGrammar delegate 2013-11-26 19:35:43 -08:00
Kevin Sawicki d131b3e39c Upgrade to go-to-line@0.12.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki 043ce8f972 Upgrade to git-diff@0.18.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki e4cac4de70 Upgrade to wrap-guid@0.8.0 2013-11-26 19:35:43 -08:00
Kevin Sawicki c5cc0706e0 Upgrade to to-the-hubs@0.15.0 2013-11-26 19:35:42 -08:00
Kevin Sawicki 45ddece673 Update getEditors references to getEditorViews 2013-11-26 19:35:42 -08:00
Kevin Sawicki 2901a04843 Rename WorkspaceView::getEditors to getEditorViews 2013-11-26 19:35:42 -08:00
Kevin Sawicki 0259536c5d Rename WorkspaceView::eachEditor to eachEditorView 2013-11-26 19:35:42 -08:00
Kevin Sawicki 48692e5127 Update EditSession to Editor in method references 2013-11-26 19:35:16 -08:00
Kevin Sawicki 19dc6b3523 Remove each helpers that delegate to Project 2013-11-26 19:35:16 -08:00
Kevin Sawicki d1496a0634 Rename EditSession to Editor 2013-11-26 19:35:16 -08:00
Kevin Sawicki d8c4fa902d Remove editSession options support 2013-11-26 19:35:16 -08:00
Kevin Sawicki f1e768767e Rename EditorView::activeEditSession to editor 2013-11-26 19:35:16 -08:00
Kevin Sawicki c03e9ad815 Rename Editor export to EditorView 2013-11-26 19:35:16 -08:00
Ben Ogle ebe3d0d885 Upgrade visual-bell@0.6.0 2013-11-26 18:06:45 -08:00
Ben Ogle 46f73d037f Fix replace on open buffers. only replace paths specified.
Closes find-and-replace#85
2013-11-26 17:08:21 -08:00
probablycorey e7e0f081f4 Update feedback package 2013-11-26 17:00:45 -08:00
probablycorey dde46ca931 Merge remote-tracking branch 'origin/master' into cj-feedback-package
Conflicts:
	package.json
2013-11-26 16:59:57 -08:00
Ben Ogle 65746521a6 Increase timeout to show default tips 2013-11-26 15:53:54 -08:00
Ben Ogle 5352f7322c upgrade to tabs@0.14.1 2013-11-26 15:52:37 -08:00
Ben Ogle f395905d4e Add destroyTooltip() 2013-11-26 15:46:01 -08:00
Ben Ogle f84635766c Upgrade to fnr@0.53.0 2013-11-26 15:36:05 -08:00
Ben Ogle 413078a493 Add hideTooltip function to hide the tip right now. 2013-11-26 15:35:47 -08:00
Kevin Sawicki d3c9b6e547 Rename root-view-spec.coffee to workspace-view-spec.coffee 2013-11-26 13:26:38 -08:00
Kevin Sawicki 078fffa7c1 Merge pull request #1166 from atom/ks-rename-root-view
Rename RootView to WorkspaceView
2013-11-26 12:28:10 -08:00
probablycorey 8472ac4fc8 Bump feedback version 2013-11-26 11:29:36 -08:00
probablycorey 1bdfb004ef Add feedback package 2013-11-26 11:23:36 -08:00
probablycorey e42079c762 Update Atom Shell 2013-11-26 11:15:55 -08:00
probablycorey a0ceb78627 Move snapshot code to package 2013-11-26 11:15:55 -08:00
probablycorey eb985a9880 Remove report issue menu 2013-11-26 11:15:55 -08:00
Kevin Sawicki d0eb26c35f 📝 RootView -> WorkspaceView 2013-11-26 11:07:46 -08:00
Kevin Sawicki 1489488159 Update rootView references in benchmarks 2013-11-26 11:02:54 -08:00
Kevin Sawicki a0a90ca26a Upgrade themes for root-view id rename 2013-11-26 11:02:53 -08:00
Kevin Sawicki 21f6676094 📝 activate() is only passed state 2013-11-26 11:02:53 -08:00
Kevin Sawicki ad9721a893 Rename workspace-view element to workspace 2013-11-26 11:02:53 -08:00
Kevin Sawicki 12ae7abc38 📝 Rename rootView to workspaceView 2013-11-26 11:02:53 -08:00
Kevin Sawicki ee0814313f Rename root-view.less to workspace-view.less 2013-11-26 11:02:53 -08:00
Kevin Sawicki a3c9e01595 Rename root-view element id to workspace-view 2013-11-26 11:02:53 -08:00
Kevin Sawicki 2e801fbf87 Rename root-view to workspace-view 2013-11-26 11:02:53 -08:00
Kevin Sawicki 40d7fb3c45 Upgrade to find-and-replace@0.52.0 2013-11-26 11:02:53 -08:00
Kevin Sawicki 14ad277012 Remove atom.workspaceView shim 2013-11-26 11:02:53 -08:00
Kevin Sawicki 6a9f29024a Remove RootView export 2013-11-26 11:02:53 -08:00
Kevin Sawicki 3ce6176313 Rename rootView to workspaceView 2013-11-26 11:02:53 -08:00
Kevin Sawicki 7d7ed79fde Upgrade packages for rootView rename 2013-11-26 11:02:52 -08:00
Ben Ogle 8aa32fc8d1 Merge pull request #1161 from atom/bo-editor-placeholder-text
Add ability for placeholder text in mini editor
2013-11-26 11:01:42 -08:00
Kevin Sawicki f8ed6eadc8 Add WorkspaceView and atom.workspaceView shims 2013-11-26 09:13:06 -08:00
Ben Ogle 0c2c739741 Add ability for placeholder text in mini editor 2013-11-25 14:46:54 -08:00
Kevin Sawicki 79c6badce8 Upgrade to gists@0.11.0 for spec fixes 2013-11-25 11:40:05 -08:00
Kevin Sawicki a48ef934eb Upgrade to gists@0.10.0 2013-11-25 11:31:53 -08:00
Kevin Sawicki 85d5968318 Remove consecutive comment blocks 2013-11-22 15:45:01 -08:00
Kevin Sawicki 9b4dd602be 📝 Tweak markdown in Atom comments 2013-11-22 15:40:50 -08:00
Kevin Sawicki 62d84e5d4b 📝 Doc Project::registerOpener 2013-11-22 15:40:50 -08:00
Ben Ogle 61ed5da1dc Upgrade themes for tooltips 2013-11-22 15:40:12 -08:00
Ben Ogle 32e25d4bb2 Don't override the default options! 2013-11-22 15:39:47 -08:00
Ben Ogle aae9614839 Upgrade to tabs@0.12.0 2013-11-22 15:33:03 -08:00
Kevin Sawicki 7fa4121227 📝 Mark PackageManager constructor as private 2013-11-22 15:19:23 -08:00
Kevin Sawicki 1d783826a2 📝 Doc Selection::compare 2013-11-22 15:19:23 -08:00
Ben Ogle bdb6e193de Upgrade find-and-replace@0.49.0 2013-11-22 15:18:43 -08:00
Ben Ogle 3f75512de2 Tooltips can now override the default options 2013-11-22 15:15:05 -08:00
Ben Ogle 5910b05344 Use my fork of bootstrap for now
I added some things to tooltips that we need. Namely, fitting them within the viewport.
2013-11-22 15:15:05 -08:00
Kevin Sawicki 7f039b3383 Update confirmSync references in specs 2013-11-22 15:09:47 -08:00
Kevin Sawicki ca35ced587 📝 Use markdown for example 2013-11-22 15:08:18 -08:00
Kevin Sawicki 734ef19f48 Upgrade to tree-view@0.39.0 2013-11-22 15:02:08 -08:00
Kevin Sawicki ef9ce1bf70 Consolidate Atom::confirm/confirmSync
Support both an array and hash of buttons to allow callbacks
optionally.
2013-11-22 15:00:32 -08:00
Kevin Sawicki c754b73b71 📝 Doc what paths are returned 2013-11-22 14:39:27 -08:00
Kevin Sawicki 21565332a4 Use fs-plus to get home directory path 2013-11-22 14:39:27 -08:00
Kevin Sawicki 8871d9cd2d Remove unused Atom::getTempDirPath 2013-11-22 14:39:26 -08:00
Kevin Sawicki 64f0fcc839 📝 Add docs to Atom class 2013-11-22 14:39:26 -08:00
Nathan Sobo 581d12b04f Upgrade to Telepath 0.45.0 for references and to debug #1153
I downgraded back to 0.38.0 after a brief period on 0.44.0 in which I
saw issues. 0.44.0 is a pretty big jump that introduces reference
semantics. I've since only seen issue #1153, which @mcolyer saw at
version 0.38.0 as well. 0.45.0 throws an exception at the moment I think
markers are getting into a bad state, so hopefully it should help us
debug the problem.
2013-11-22 16:52:10 -05:00
Kevin Sawicki 05a9ace3e6 📝 Add period to comment 2013-11-22 13:43:43 -08:00
Kevin Sawicki 03eac362f6 📝 Add missing colon to Private 2013-11-22 13:39:24 -08:00
Kevin Sawicki 8a05b0f51d 📝 Mark setDigest as private 2013-11-22 13:31:27 -08:00
Matt Colyer 4069d23d86 📝 Indicate how to access DeserializerManager 2013-11-22 14:53:08 -05:00
Kevin Sawicki 78b48345ac Update reference to renamed param 2013-11-22 11:52:21 -08:00
Matt Colyer 139e2f6de0 :note: Mark ContextMenu as private 2013-11-22 14:49:10 -05:00
Kevin Sawicki ed86b4a478 📝 Mark EditorView public 2013-11-22 11:48:00 -08:00
Kevin Sawicki f2352131cc 📝 Mark SiteShim private 2013-11-22 11:45:36 -08:00
Kevin Sawicki 56df435fb8 📝 Mark ::get as private and tweak comments 2013-11-22 11:43:52 -08:00
Kevin Sawicki 595ff19b5b 📝 Mark LessCompileCache class private 2013-11-22 11:40:52 -08:00
Kevin Sawicki 33eb0bae8f 📝 Add docs to all public methods 2013-11-22 11:37:29 -08:00
Kevin Sawicki fde1560377 📝 doc PackageManager as public 2013-11-22 10:59:43 -08:00
Kevin Sawicki a640d07599 Merge pull request #1151 from atom/ks-remove-global-functions
Remove global functions
2013-11-22 10:26:35 -08:00
Kevin Sawicki 45b65cd3aa Organize imports 2013-11-22 10:13:59 -08:00
Kevin Sawicki f217278001 Move editor window helpers to Atom class 2013-11-22 10:13:59 -08:00
Kevin Sawicki 3320176a0a Move atom/apm install helpers to CommandInstaller 2013-11-22 10:13:59 -08:00
Kevin Sawicki 754b5a6004 Remove unused requires 2013-11-22 10:13:59 -08:00
Kevin Sawicki 79b84b2433 Move window.deserializeEditorWindow to Atom class 2013-11-22 10:13:59 -08:00
Kevin Sawicki 17be036ff8 Move window.setUpEnvironment to Atom class 2013-11-22 10:13:59 -08:00
Ben Ogle 23deec833f Upgrade to bootstrap 3.0.2 2013-11-22 10:11:24 -08:00
Ben Ogle 6a8d0bef4a Merge branch 'master' of github.com:atom/atom 2013-11-22 10:03:06 -08:00
Ben Ogle d5ce1a0312 Add more chars to the shortcut parser 2013-11-22 10:02:52 -08:00
Kevin Sawicki 74decbd18a Upgrade to terminal@0.22.0 refs #1150 2013-11-22 09:33:17 -08:00
Matt Colyer 085806f97f Upgrade terminal@0.21.0 2013-11-22 10:12:19 -05:00
Matt Colyer ca8be83903 Upgrade terminal@0.20.0 2013-11-22 09:46:59 -05:00
Matt Colyer da713da311 Merge pull request #1147 from atom/pass-original-event
Pass originalEvent property on command events
2013-11-22 06:19:36 -08:00
Kevin Sawicki 7a6c75a83e Refresh cache when core.themes changes
Previously this wasn't needed because a new cache was created for each
stylesheet loaded.
2013-11-21 17:46:29 -08:00
Kevin Sawicki 3e7a517c25 Add missing @ before lessCache lazy initialization 2013-11-21 17:03:10 -08:00
Kevin Sawicki e623ef4232 Upgrade to exception-reporting@0.8.0 2013-11-21 16:56:24 -08:00
Ben Ogle 18399aa264 Replace keystrokes in tooltips 2013-11-21 16:53:38 -08:00
Kevin Sawicki 2a5f393712 Use resource path from atom.getLoadSettings() 2013-11-21 16:32:12 -08:00
Kevin Sawicki 27f779ec03 Merge pull request #1149 from atom/ks-user-dot-js
~/.atom/user.js
2013-11-21 16:26:18 -08:00
Kevin Sawicki 5d717eb7bd Load ~/.atom/user.js when available 2013-11-21 16:21:37 -08:00
Kevin Sawicki 0b457fd80a Merge pull request #1148 from atom/ks-remove-resource-path
🔥 window.resourcePath
2013-11-21 16:19:42 -08:00
Kevin Sawicki dd9aa2d02f 💄 Remove extra space 2013-11-21 16:08:27 -08:00
Kevin Sawicki 87b530140b Remove window.resourcePath 2013-11-21 16:08:27 -08:00
Kevin Sawicki 2f46fee1ca Use resource path from load settings 2013-11-21 16:08:27 -08:00
Kevin Sawicki fbb48e7807 Merge pull request #1146 from atom/ks-menu-selectors
Check selectors using webkitMatchesSelector
2013-11-21 16:07:04 -08:00
Ben Ogle 01c141eec6 Upgrade styleguide 2013-11-21 16:05:07 -08:00
Kevin Sawicki 7d9d0c715c 📝 Mention what testEditor simulates 2013-11-21 16:01:55 -08:00
Kevin Sawicki a9887b5007 Remove logging 2013-11-21 16:01:55 -08:00
Kevin Sawicki c4dec72dcd Return early when document.body matches selector 2013-11-21 16:01:55 -08:00
Kevin Sawicki d093d5cc06 Check selectors using webkitMatchesSelector 2013-11-21 16:01:55 -08:00
Ben Ogle 27c9e54538 Upgrade styleguide 2013-11-21 15:44:40 -08:00
Ben Ogle 3bbe6ee98c Merge branch 'master' of github.com:atom/atom 2013-11-21 15:30:13 -08:00
Matt Colyer 524d8e8e21 Merge remote-tracking branch 'origin/master' into pass-original-event 2013-11-21 17:54:54 -05:00
Kevin Sawicki c31211dc21 Full screen window after it is shown and focused
This prevents a blank menu bar from appearing when opening a window
that was previously closed when in full screen mode.

Closes #1144
2013-11-21 14:51:49 -08:00
Matt Colyer 6c1b63d352 Pass originalEvent property on command events
vim-mode needs access to the original keystroke that triggered the
event.
2013-11-21 17:49:07 -05:00
Ben Ogle 6fa7da79eb Provide a defualt 2013-11-21 14:34:49 -08:00
Ben Ogle c2371f3054 Allow passing an htmlElement into requireStylesheet 2013-11-21 14:32:48 -08:00
Kevin Sawicki 2349627e3c Tweak modifier order in spec 2013-11-21 13:56:12 -08:00
Kevin Sawicki 90d92a4c92 Upgrade to go-to-line@0.10.0 for atom prefix fixes 2013-11-21 13:46:54 -08:00
Matt Colyer 66171e0301 Modifiers need to be added in alphabetical order 2013-11-21 16:17:37 -05:00
Kevin Sawicki cdc7f70b22 Pass buffer from event to TextBuffer::removeBuffer
Previously only the last buffer would be destroyed since the buffer
from the loop variable was being used.
2013-11-21 13:04:47 -08:00
Matt Colyer e225dbe93d Merge pull request #1130 from atom/meta-to-command
Use `cmd` instead of `meta`
2013-11-21 12:41:31 -08:00
Kevin Sawicki 7dc18765ad Call serializeForPersistence instead of serialize 2013-11-21 11:29:05 -08:00
Matt Colyer c1d379fd6c Update packages for updated keymaps 2013-11-21 14:07:38 -05:00
Matt Colyer a754ac4da0 Revert "Alias meta to cmd in keymaps"
This reverts commit f0aa408b70.
2013-11-21 13:08:12 -05:00
Kevin Sawicki 21560df2f0 Add platform class to selectors array 2013-11-21 09:19:33 -08:00
Matt Colyer f0aa408b70 Alias meta to cmd in keymaps 2013-11-21 10:38:13 -05:00
Matt Colyer 161c9a62b5 Merge branch 'master' into meta-to-command
Conflicts:
	spec/keymap-spec.coffee
2013-11-21 09:59:49 -05:00
Nathan Sobo 2c5bbcbc22 Merge branch 'ns-fix-telepath' 2013-11-20 22:08:00 -07:00
Nathan Sobo eee72f7664 Drop back to telepath 0.38.0 until I figure out what's going on 2013-11-20 21:59:52 -07:00
Nathan Sobo 073d398e6f Upgrade telepath to 0.43.0 so we don't serialize orphans 2013-11-20 21:18:08 -07:00
Kevin Sawicki 2310e263a7 Upgrade to tabs@0.11.0 refs #1143 2013-11-20 19:30:50 -08:00
Kevin Sawicki de7b212d99 Change cancel to off for consistency with emissary 2013-11-20 19:07:56 -08:00
Kevin Sawicki 75873ef6b3 Upgrade apm for develop command running install 2013-11-20 18:58:44 -08:00
Kevin Sawicki 73855a49fc Merge pull request #1142 from atom/ks-remove-fs-shims
Remove fs-plus shims
2013-11-20 18:26:09 -08:00
Kevin Sawicki cae055fd3f Upgrade to tree-view@0.37.0 2013-11-20 18:21:09 -08:00
Kevin Sawicki 2aad31c4dc Upgrade to find-and-replace@0.47.0 2013-11-20 18:08:46 -08:00
Kevin Sawicki 93052ad611 Upgrade to fuzzy-finder@0.24.0 2013-11-20 18:06:31 -08:00
Kevin Sawicki 67733b8b05 Upgrade to git-diff@0.16.0 2013-11-20 18:04:07 -08:00
Kevin Sawicki 21543569ef Upgrade to package-generator@0.21.0 2013-11-20 18:01:42 -08:00
Kevin Sawicki 7371ebbf20 Upgrade to status-bar@0.22.0 2013-11-20 18:00:05 -08:00
Kevin Sawicki 73470cc294 Upgrade to symbols-view@0.23.0 2013-11-20 17:58:00 -08:00
Kevin Sawicki 1e60b5fa3b Upgrade to archive-view@0.14.0 2013-11-20 17:56:45 -08:00
Kevin Sawicki 172ecbd897 Upgrade to tree-view@0.36.0 2013-11-20 17:54:35 -08:00
Kevin Sawicki 289cc24b56 Remove fs shims 2013-11-20 17:48:10 -08:00
Kevin Sawicki a20483ccdb Merge pull request #1140 from atom/ks-remove-project-root-view-globals
Remove project/rootView globals
2013-11-20 17:34:44 -08:00
Kevin Sawicki b2ceaf3b8b Upgrade packages for missing atom prefix fixes 2013-11-20 17:29:01 -08:00
Kevin Sawicki 1c3c508985 Upgrade apm for new package templates 2013-11-20 17:23:48 -08:00
Kevin Sawicki 645f4ad907 📝 Add atom prefix package example 2013-11-20 17:23:48 -08:00
Kevin Sawicki 05dd6f8f17 Upgrade to fuzzy-finder@0.23.0 2013-11-20 17:23:48 -08:00
Kevin Sawicki b19390b519 Add missing atom prefix to rootView and project 2013-11-20 17:23:48 -08:00
Kevin Sawicki a3f339e0c3 Correct order of refresh steps 2013-11-20 17:23:48 -08:00
Kevin Sawicki 42040e14b3 Add atom prefix to rootView and project 2013-11-20 17:23:48 -08:00
Kevin Sawicki 91640f0886 Add atom prefix to project references 2013-11-20 17:23:47 -08:00
Kevin Sawicki 0377d64788 Assign to atom.project instead of window.project 2013-11-20 17:23:47 -08:00
Kevin Sawicki cd37caae96 Add atom prefix to rootView 2013-11-20 17:23:47 -08:00
Kevin Sawicki aab63c26e7 Add atom prefix to project 2013-11-20 17:23:47 -08:00
Kevin Sawicki 6da6101a52 Upgrade packages for project/rootView global fixes 2013-11-20 17:23:47 -08:00
Kevin Sawicki 87b33648dc Use project passed in via options hash 2013-11-20 17:23:47 -08:00
Kevin Sawicki d0b380e535 Add atom prefix to rootView and project references 2013-11-20 17:23:47 -08:00
Kevin Sawicki 99480901e2 Add missing atom prefix 2013-11-20 17:23:47 -08:00
Kevin Sawicki 6852720408 Add atom prefix to project references 2013-11-20 17:23:47 -08:00
Kevin Sawicki f9498732a5 Add atom prefix to rootView 2013-11-20 17:23:47 -08:00
Kevin Sawicki e4aa82fda1 Remove window.rootView shims 2013-11-20 17:23:47 -08:00
Kevin Sawicki bc1a743b2f Remove project and rootView from window 2013-11-20 17:23:47 -08:00
Ben Ogle 3fe22aa5c8 Set font sizes 2013-11-20 17:11:50 -08:00
Ben Ogle fe035d4d7c Merge pull request #1141 from atom/bo-jquery-extensions
Add setTooltip jquery function
2013-11-20 17:11:21 -08:00
Ben Ogle e8bfb7ca09 Fix up things for kevin 2013-11-20 17:10:57 -08:00
Ben Ogle 4bfd48b983 Add setTooltip jquery function 2013-11-20 16:55:50 -08:00
Nathan Sobo 5a1fadf7ce Merge branch 'ns-telepath-references' 2013-11-20 17:12:06 -07:00
Ben Ogle 819ac9ea68 Add keyBindingsForCommandMatchingElement to keymap 2013-11-20 15:43:02 -08:00
Nathan Sobo 6384841134 Upgrade to telepath 0.42.0 for references 2013-11-20 16:23:04 -07:00
Paul Betts a0fbec29c3 Merge pull request #1137 from atom/windows-fonts
Set up Windows font fallbacks
2013-11-20 15:14:21 -08:00
Ben Ogle 238fca2004 upgrade status-bar and grammar-selector
Use the status bar api in grammar-selector
2013-11-20 14:52:19 -08:00
Kevin Sawicki 014beda455 Merge pull request #1138 from atom/ks-remove-deserializer-shims
Remove deserializer shims
2013-11-20 14:51:03 -08:00
Kevin Sawicki 777df644ce Upgrade to markdown-preview@0.18.0 2013-11-20 14:40:04 -08:00
Kevin Sawicki f3ea3a3395 Add missing atom.deserializers prefix 2013-11-20 14:33:55 -08:00
Kevin Sawicki b82fdace61 Add missing atom.deserializers prefix 2013-11-20 14:26:56 -08:00
Kevin Sawicki 7195102a04 Upgrade to find-and-replace@0.45.0 2013-11-20 14:19:47 -08:00
Kevin Sawicki 5ec6a4a189 Use atom.deserializers directly 2013-11-20 14:18:38 -08:00
Kevin Sawicki e330b1a2e8 Use atom.deserializers directly 2013-11-20 14:16:38 -08:00
Kevin Sawicki 5334433bc2 Upgrade to tabs@0.10.0 2013-11-20 14:13:54 -08:00
Kevin Sawicki 366a12903a Deserialize using atom.deserializers 2013-11-20 14:13:13 -08:00
Kevin Sawicki 063cb04fb5 Upgrade to styleguide@0.11.0 2013-11-20 14:10:00 -08:00
Kevin Sawicki d9c2f07fbe Use atom.deserializers directly 2013-11-20 14:09:44 -08:00
Kevin Sawicki 5c1fa8e53d Upgrade to terminal@0.18.0 2013-11-20 14:07:08 -08:00
Kevin Sawicki a1f3540cb4 Call deserialize on deserializers ivar 2013-11-20 14:00:51 -08:00
Kevin Sawicki 2eeb399cf1 Remove deserializer shims on window 2013-11-20 13:51:12 -08:00
Kevin Sawicki 71e8e865f2 Merge pull request #1131 from atom/ks-remove-shims
Remove shims
2013-11-20 13:42:11 -08:00
Paul Betts 9f080be6e1 Add Courier New as a last-chance fallback 2013-11-20 13:21:30 -08:00
Kevin Sawicki 56f66f8578 Upgrade to release-notes@0.12.0 2013-11-20 12:49:16 -08:00
Kevin Sawicki 0b1dc704ea Upgrade to tabs@0.9.0 2013-11-20 12:49:16 -08:00
Kevin Sawicki 578d823118 Upgrade to find-and-replace@0.44.0 2013-11-20 12:49:16 -08:00
Kevin Sawicki 0196f2a2eb Upgrade to dev-live-reload@0.16.0 2013-11-20 12:49:16 -08:00
Kevin Sawicki 1e68a7266f Add atom prefix to keymap global 2013-11-20 12:49:16 -08:00
Kevin Sawicki 093143f7a9 Upgrade to symbols-view@0.21.0 2013-11-20 12:49:16 -08:00
Kevin Sawicki 4eeef9cfbd Upgrade packages for shim removal fixes 2013-11-20 12:49:15 -08:00
Kevin Sawicki ce3ec75c55 Remove remaining package manager shims 2013-11-20 12:49:15 -08:00
Kevin Sawicki bb09de9703 Upgrade to wrap-guide@0.6.0 for spec fixes 2013-11-20 12:48:50 -08:00
Kevin Sawicki e64ba18fe3 Upgrade to visual-bell@0.4.0 for atom global fixes 2013-11-20 12:48:50 -08:00
Kevin Sawicki 3908f81fc6 Upgrade to spell-check@0.14.0 for spec fixes 2013-11-20 12:48:06 -08:00
Kevin Sawicki fac46a295c Add shim for rootView on either atom or window 2013-11-20 12:48:06 -08:00
Kevin Sawicki b01470a738 Upgrade to settings-view@0.44.0 for config fixes 2013-11-20 12:48:06 -08:00
Kevin Sawicki f3be613662 Add atom prefix to config global 2013-11-20 12:48:06 -08:00
Kevin Sawicki ede29d99c1 Access package manager via atom.packages 2013-11-20 12:48:05 -08:00
Kevin Sawicki d2369e94c8 Add atom prefix to config reference 2013-11-20 12:48:05 -08:00
Kevin Sawicki dbe3399016 Upgrade to autoflow@0.6.0 for global fixes 2013-11-20 12:48:05 -08:00
Kevin Sawicki 3952423d99 Access package manager methods on atom.packages 2013-11-20 12:48:05 -08:00
Kevin Sawicki ffdcecc0f2 Remove unused package manager shims on atom 2013-11-20 12:48:05 -08:00
Kevin Sawicki 0069eb4d0d Remove atom.isPackageActive shim 2013-11-20 12:48:05 -08:00
Kevin Sawicki 5fa55026d5 Call loadPackage on atom.packages 2013-11-20 12:48:05 -08:00
Kevin Sawicki 6d04d57e74 Remove atom.loadPackage shim 2013-11-20 12:48:05 -08:00
Kevin Sawicki 3f0dca5a40 Remove unused package managers shims 2013-11-20 12:48:05 -08:00
Kevin Sawicki 8b14a66e2c Upgrade to settings-view@0.43.0 2013-11-20 12:48:05 -08:00
Kevin Sawicki 1607411df1 Upgrade to timecop@0.10.0 2013-11-20 12:48:05 -08:00
Kevin Sawicki dade9f6309 Upgrade to metrics@0.12.0 2013-11-20 12:48:05 -08:00
Kevin Sawicki 568aa1d396 Remove some package manager shims on atom global 2013-11-20 12:48:05 -08:00
Kevin Sawicki 9febe179fa Remove unused deserializer shims 2013-11-20 12:48:04 -08:00
Kevin Sawicki c9e68ab044 Remove window.config shim from spec helper 2013-11-20 12:48:04 -08:00
Kevin Sawicki 285186567a Upgrade to status-bar@0.18.0 for syntax global fixes 2013-11-20 12:48:04 -08:00
Kevin Sawicki 1c136f16e3 Upgrade to keybind-resolve@0.4.0 for rootView fix 2013-11-20 12:48:04 -08:00
Kevin Sawicki 534a2d4565 Upgrade to markdown-preview@0.17.0 for atom prefix on globals 2013-11-20 12:48:04 -08:00
Kevin Sawicki 9e814de969 Remove window.config shim 2013-11-20 12:48:04 -08:00
Kevin Sawicki 7202ba274a Upgrade to status-bar@0.17.0 for atom.syntax usage 2013-11-20 12:48:04 -08:00
Kevin Sawicki 46e85fac87 Remove window.syntax shim 2013-11-20 12:48:04 -08:00
Kevin Sawicki d1f1b494cf Remove window.keymap shim 2013-11-20 12:48:04 -08:00
Kevin Sawicki f11803df60 Remove window.site shim 2013-11-20 12:48:04 -08:00
Paul Betts f094a86ae7 Initial hack of proper Windows fonts 2013-11-20 12:47:32 -08:00
Ben Ogle a6c791ce39 Upgrade to tree-view@0.34.0 2013-11-20 11:40:08 -08:00
Matt Colyer dfa870f514 Merge branch 'master' into meta-to-command
Conflicts:
	keymaps/win32.cson
2013-11-20 10:19:12 -08:00
Corey Johnson a98377b899 Merge pull request #1132 from atom/cj-editor-rename
Editor & EditSession rename
2013-11-20 10:11:09 -08:00
probablycorey c3de3d8eea Update documentation 2013-11-20 10:04:28 -08:00
probablycorey 2d15f5e49a Remove pathForRepositoryUrl from atom exports 2013-11-20 10:03:06 -08:00
Matt Colyer 56386cb06a Upgrade atom-shell@0.6.11 2013-11-20 08:48:03 -08:00
Ben Ogle 986a7ad5c3 Merge pull request #1135 from atom/workspace-class
Use `.workspace` rather than `body` for keybindings
2013-11-19 18:50:43 -08:00
Kevin Sawicki 9a01b5a6bf Use Date.now() 2013-11-19 17:15:25 -08:00
Matt Colyer ccafda6f7f Keep .platform-<platform> rather than .workspace-<platform> 2013-11-19 17:03:16 -08:00
Matt Colyer 33538a5ed7 Use .workspace rather than body for keybindings 2013-11-19 16:57:10 -08:00
Ben Ogle aae85cd7c1 Upgrade to find-and-replace@0.43.0 2013-11-19 16:56:32 -08:00
Matt Colyer ce098e587f Reduce specificity of platform keybindings 2013-11-19 16:46:46 -08:00
Kevin Sawicki 233d819e04 Add atom prefix to syntax global 2013-11-19 16:37:50 -08:00
Kevin Sawicki fbbf3d177a Upgrade to whitespace@0.9.0 2013-11-19 16:33:46 -08:00
probablycorey c33bd34996 Add reverse compatability for Editor creation 2013-11-19 16:22:29 -08:00
probablycorey 34cdb23d71 Remove file
I didn't mean to check this file in.
2013-11-19 15:57:41 -08:00
probablycorey fcedcd117d Merge remote-tracking branch 'origin/master' into cj-editor-rename 2013-11-19 15:55:20 -08:00
Matt Colyer 3d7de21d6c Replicate command keybindings on windows 2013-11-19 15:53:43 -08:00
Matt Colyer 2278ee742a Merge remote-tracking branch 'origin/master' into meta-to-command 2013-11-19 15:35:31 -08:00
Matt Colyer 55e90f8ae1 Use cmd instead of command 2013-11-19 15:29:37 -08:00
probablycorey 2ca738453b Update benchmarks 2013-11-19 15:24:50 -08:00
probablycorey 31a9bb83cf Replace editSession variables with editor 2013-11-19 15:22:47 -08:00
Matt Colyer 1e4504e7f3 Use command instead of meta 2013-11-19 15:16:55 -08:00
probablycorey bf05ddb958 🔫
I screwed up a rebase, this nasty commit is the result.
2013-11-19 15:15:12 -08:00
probablycorey 756c2be64a Replace editor instance variables with editorView 2013-11-19 14:57:35 -08:00
probablycorey 6fdd4f775b Rename TextEditor and TextEditorView to Editor and EditorView 2013-11-19 14:57:35 -08:00
probablycorey 625fcaffc8 Update TextEditor specs 2013-11-19 14:57:31 -08:00
probablycorey 955d379e0e Rename EditSession to TextEditor 2013-11-19 14:56:09 -08:00
Kevin Sawicki 0d71f20073 Upgrade to gists@0.8.0 for pasteboard fix 2013-11-19 14:43:28 -08:00
Kevin Sawicki 42c40e8c7a Upgrade to to-the-hubs@0.11.0 for pasteboard fix 2013-11-19 14:39:44 -08:00
probablycorey 89212e599f Update requires 2013-11-19 14:34:26 -08:00
probablycorey 95e4ac903c Use Range literals 2013-11-19 14:34:26 -08:00
probablycorey 311155ac0d Rename editor-spec to text-editor-view-spec 2013-11-19 14:34:26 -08:00
probablycorey aaa82e23da Rename Editor to TextEditorView 2013-11-19 14:34:20 -08:00
Kevin Sawicki 8e46bc5241 Add shim for atom.rootView vs. window.rootView 2013-11-19 14:15:47 -08:00
Matt Colyer 37a5a6f501 Merge pull request #1117 from atom/platform-keybindings
Platform keybindings
2013-11-19 14:10:53 -08:00
Kevin Sawicki 83f14c137c Remove window.pasteboard shim 2013-11-19 14:03:44 -08:00
Matt Colyer b0b458b1f6 Review remaining global bindings 2013-11-19 13:53:10 -08:00
Kevin Sawicki f4de124aa6 Add atom prefix to rootView reference 2013-11-19 13:34:01 -08:00
Kevin Sawicki 4b0eaf05a5 Remove Emitter::trigger shim 2013-11-19 13:24:29 -08:00
Kevin Sawicki 03e8bc6f19 Remove Emitter::one shim 2013-11-19 12:58:56 -08:00
Kevin Sawicki 13186fcf7a Remove Emitter::subscriptionCount shim 2013-11-19 12:55:18 -08:00
Kevin Sawicki fea0f1f90a 📝 atom.project instead of global.project 2013-11-19 12:30:05 -08:00
Matt Colyer b449bb4444 Fix update-atom-shell task when using the keychain 2013-11-19 12:21:12 -08:00
Matt Colyer fe6b40fc5d Merge branch 'master' into platform-keybindings 2013-11-19 11:58:48 -08:00
Matt Colyer 82e3935ae3 Guard against undefined labels 2013-11-19 11:57:59 -08:00
Matt Colyer 32a3b6302c Use document.body to be concise 2013-11-19 11:21:50 -08:00
Matt Colyer 6157fcaf73 Merge branch 'master' into platform-keybindings 2013-11-19 11:11:32 -08:00
Matt Colyer ab74d8be38 Merge pull request #1115 from atom/refine-paste-normalization
Don't normalize indents on paste if there are preceding characters, fixes #1112
2013-11-19 10:54:44 -08:00
Kevin Sawicki 886a2aa867 Remove pathForRepositoryUrl from exports 2013-11-19 10:26:33 -08:00
Kevin Sawicki aeaa76a9e1 Remove Site from exports 2013-11-19 10:25:42 -08:00
Kevin Sawicki 6a7bcb6f52 Prepare next release 2013-11-19 09:31:13 -08:00
Kevin Sawicki ee1ec4670d Listen for destroyed events on deserialized buffers 2013-11-19 09:08:24 -08:00
Kevin Sawicki 7e0af4c575 Prepare next release 2013-11-18 18:49:23 -08:00
Kevin Sawicki f55a200591 Return emissary subscription directly 2013-11-18 18:41:43 -08:00
Kevin Sawicki 89d8eac091 Remove console.log statement 2013-11-18 16:09:25 -08:00
probablycorey 5011b6e78f Remove atom argument from activate 2013-11-18 15:50:36 -08:00
probablycorey d6e67c5b32 Update find-and-replace 2013-11-18 15:10:13 -08:00
Ben Ogle de547e20c2 Oops 2013-11-18 15:07:49 -08:00
Ben Ogle 2b79b19330 Upgrade ui themes and style guide to style progress bars 2013-11-18 15:05:52 -08:00
Matt Colyer 2b234545b5 Merge pull request #1116 from atom/windows-menus
Make Windows menus more Native(tm), fixes #1085
2013-11-18 11:08:04 -08:00
Kevin Sawicki a66543048b Include buffer in emitted events 2013-11-18 10:06:14 -08:00
Kevin Sawicki ca96aa2804 📝 doc what DisplayBuffer::getGrammar returns 2013-11-18 09:30:56 -08:00
Kevin Sawicki 316571308a Remove unused ws dependency 2013-11-15 15:34:52 -08:00
Matt Colyer b323d9ce18 Rename hasNoPrecedingCharacters => hasPrecedingCharactersOnLine 2013-11-15 15:32:24 -08:00
Corey Johnson 0e1c757cd0 Merge pull request #1119 from atom/cj-keymap-cleanup
Keymap cleanup
2013-11-15 14:42:20 -08:00
probablycorey 084bbb1578 Use skinny arrow 2013-11-15 14:35:02 -08:00
probablycorey 7c348ee478 Update packages 2013-11-15 14:25:48 -08:00
probablycorey a0c6a94409 Added documentation for Keymap's public classes 2013-11-15 14:23:52 -08:00
probablycorey 80cdf61fa4 Update remove spec 2013-11-15 14:09:24 -08:00
probablycorey 29c3fadb6f Move public methods to top of file 2013-11-15 14:07:01 -08:00
probablycorey 1ae3806c69 Use source instead of name 2013-11-15 14:06:03 -08:00
probablycorey 98b509441c Move methods into KeyBinding class 2013-11-15 14:05:35 -08:00
probablycorey 02f40688e2 Merge remote-tracking branch 'origin/master' into cj-keymap-cleanup 2013-11-15 13:53:42 -08:00
probablycorey cb8e378af6 Use keyBinding in place of binding in method names 2013-11-15 13:49:17 -08:00
Kevin Sawicki babc4732b8 Merge pull request #1111 from atom/ks-extend-model
Extend telepath.Model
2013-11-15 13:43:23 -08:00
probablycorey dcccde8f3f Clone default keybindings in specs 2013-11-15 13:32:31 -08:00
probablycorey 8ed4923e58 Replace binding-set with key-binding 2013-11-15 13:32:09 -08:00
probablycorey 529c829438 💄 2013-11-15 11:54:18 -08:00
probablycorey 809a02ca10 Clone keyBindings by default 2013-11-15 11:54:09 -08:00
probablycorey b9902cb6f2 Add specs 2013-11-15 11:50:55 -08:00
Kevin Sawicki de4d3dbbe9 Create new project when state doesn't return a Project 2013-11-15 11:37:25 -08:00
Kevin Sawicki 3fe88c4df1 💄 Add period to comment 2013-11-15 11:17:35 -08:00
Kevin Sawicki 20811a9f52 📝 Mention which methods are telepath hooks 2013-11-15 11:17:35 -08:00
Kevin Sawicki b137f1a3e3 Upgrade to emissary@0.17.0 2013-11-15 11:17:35 -08:00
Kevin Sawicki 0b12f01206 Use Project::bufferForPathSync instead of buildBufferSync 2013-11-15 11:17:35 -08:00
Kevin Sawicki 1d7b4c5f9a Updating places still using Buffer instead of TextBuffer 2013-11-15 11:17:35 -08:00
Kevin Sawicki e2d4b58d5f Remove unused Range 2013-11-15 11:17:35 -08:00
Kevin Sawicki 1c8df2c0b5 💄 Organize imports in TextBuffer 2013-11-15 11:17:35 -08:00
Kevin Sawicki 9067c65a41 Use Atom::replicate to test serialization 2013-11-15 11:17:35 -08:00
Kevin Sawicki 1d4f2fba8b Use id provide by telepath.Model 2013-11-15 11:17:34 -08:00
Kevin Sawicki 12dd412439 Restore relative path as uri of TextBuffer 2013-11-15 11:17:34 -08:00
Kevin Sawicki 19d680544b Use Atom::replicate to obtain second project 2013-11-15 11:17:34 -08:00
Kevin Sawicki a45dd3fe37 Register deepest model classes first 2013-11-15 11:17:34 -08:00
Kevin Sawicki f6c8a435ae Upgrade to telepath@0.37.0 2013-11-15 11:17:34 -08:00
Kevin Sawicki 93bfe0edf6 Store path when set in project 2013-11-15 11:17:34 -08:00
Kevin Sawicki d3fed57cb3 Only serialize project state for persistence 2013-11-15 11:17:34 -08:00
Kevin Sawicki 8372adb38a Remove spec for removed TextBuffer::getRelativePath 2013-11-15 11:17:34 -08:00
Kevin Sawicki e4b3d3a83c Call getValues() when iterating over buffers 2013-11-15 11:17:34 -08:00
Kevin Sawicki 11f1ef9d8b Destroy unretained buffers in beforePersistence 2013-11-15 11:17:34 -08:00
Kevin Sawicki 7d87ae00ff Use Atom::replicate for second project 2013-11-15 11:17:34 -08:00
Kevin Sawicki 3ec2378242 Access project from atom global 2013-11-15 11:17:34 -08:00
Kevin Sawicki 28943a35da Use getWindowState instead of referencing window state directly 2013-11-15 11:17:34 -08:00
Kevin Sawicki 7b43c8a860 Use Atom::replicate in git spec to simulate project serialization 2013-11-15 11:17:33 -08:00
Kevin Sawicki 8b17b7eca9 Remove unused repoUrl property 2013-11-15 11:17:33 -08:00
Kevin Sawicki 6432cda691 Upgrade to telepath@0.35.0 2013-11-15 11:17:33 -08:00
Kevin Sawicki cf0bdb9c94 Remove unused property 2013-11-15 11:17:33 -08:00
Kevin Sawicki 34f1472653 Use getValues() when iterating over buffers 2013-11-15 11:17:33 -08:00
Kevin Sawicki a475e27cd4 Call createAsRoot for mini editor's buffer 2013-11-15 11:17:33 -08:00
Kevin Sawicki abc1f23516 Remove unused relative path from Editor/EditSession/TextBuffer 2013-11-15 11:17:33 -08:00
Kevin Sawicki dc7e7f9ed0 Listen for buffer destroyed in Project 2013-11-15 11:17:33 -08:00
Kevin Sawicki 5fdec4dc7b Move checkoutHead implementation to Editor 2013-11-15 11:17:33 -08:00
Kevin Sawicki 618d281d6c Restore buffer.release() call to previously location 2013-11-15 11:17:33 -08:00
Kevin Sawicki 055ec8cb9c Implement beforePersistence in TextBuffer 2013-11-15 11:17:33 -08:00
Kevin Sawicki df3fe90c89 Upgrade to telepath@0.33.0 2013-11-15 11:17:33 -08:00
Kevin Sawicki 21e0e95a7a Add model property for disk contents digest 2013-11-15 11:17:33 -08:00
Kevin Sawicki 6caed6e918 Add model property for relative path 2013-11-15 11:17:32 -08:00
Kevin Sawicki 7dd84636ba Use Project::addBuffer instead of window.deserialize 2013-11-15 11:17:32 -08:00
Kevin Sawicki b12954760d Use Project::addBuffer instead of ::openSync 2013-11-15 11:17:32 -08:00
Kevin Sawicki 4bb21fd9ec Use project.addBuffer instead of window.deserialize 2013-11-15 11:17:32 -08:00
Kevin Sawicki 11787e5a5d Return added buffer from Project::addBufferAtIndex 2013-11-15 11:17:32 -08:00
Kevin Sawicki 276e63611a Register buffer with project 2013-11-15 11:17:32 -08:00
Kevin Sawicki 957374eb40 Call telepath.Array::getValues() during clone 2013-11-15 11:17:32 -08:00
Kevin Sawicki fe9f1373c1 Cancel stopped changing timeout when destroyed 2013-11-15 11:17:32 -08:00
Kevin Sawicki 6290c19264 Set up spec Project as telepath model 2013-11-15 11:17:32 -08:00
Kevin Sawicki 913bb82d6e Remove debug logging 2013-11-15 11:17:32 -08:00
Kevin Sawicki ffc936ca4d Use telepath.Document::registerModelClasses 2013-11-15 11:17:32 -08:00
Kevin Sawicki 1808e5f991 Initial 🔪 at extending telepath.Model in Project/TextBuffer 2013-11-15 11:17:32 -08:00
Kevin Sawicki 62feefd28d Upgrade to emissary@0.15.0 2013-11-15 11:17:31 -08:00
Kevin Sawicki ada992be4d Upgrade to telepath@0.29.0 2013-11-15 11:17:31 -08:00
Kevin Sawicki f8933cfeab Upgrade to pathwatcher@0.10.0, refs atom/tree-view#17 2013-11-15 11:14:52 -08:00
probablycorey 0878d7ab6a Update specs 2013-11-15 10:45:21 -08:00
probablycorey bd8e19bce7 Update keymap in spec-helper 2013-11-15 10:43:20 -08:00
probablycorey 4852ba6d95 Don't store binding sets, instead store a keyBinding array 2013-11-15 10:21:38 -08:00
Kevin Sawicki caffcafe2e 🙉 Ignore stdout from installation of apm 2013-11-15 09:54:36 -08:00
probablycorey c7a1205ca6 Remove Editor:bindToKeyedEvent 2013-11-15 09:39:26 -08:00
probablycorey 2c4f94c319 Merge remote-tracking branch 'origin/master' into cj-keymap-cleanup 2013-11-15 09:24:45 -08:00
Corey Johnson 941fc97e79 Merge pull request #1118 from atom/cj-less-verbose-grunt
Less verbose grunt
2013-11-15 09:05:11 -08:00
probablycorey 8788b2a51c Add keybinding-resolver to default package list 2013-11-14 16:49:09 -08:00
probablycorey ca8ae9ad61 Remove bindingsForElement 2013-11-14 16:45:09 -08:00
probablycorey 2fb00af255 Rename keyMapping to keyBinding 2013-11-14 16:20:35 -08:00
Kevin Sawicki f6ce0f038f Prepare 36.0.0 release 2013-11-14 16:06:45 -08:00
probablycorey 94a8d16664 Update specs 2013-11-14 16:05:17 -08:00
probablycorey fc0a46d6b2 Add mappingsForKeystrokeMatchingElement 2013-11-14 16:05:10 -08:00
probablycorey fd443a8b68 Reorder args 2013-11-14 16:05:01 -08:00
probablycorey c43f277c5b Remove getAllKeyMappings 2013-11-14 14:46:21 -08:00
probablycorey dd0938dca6 Merge remote-tracking branch 'origin/master' into cj-keymap-cleanup 2013-11-14 14:43:37 -08:00
probablycorey e90f19da97 Rename keystrokeByCommmand to keystrokesByCommmand 2013-11-14 14:26:25 -08:00
probablycorey c3aea1d149 Remove keymap.keystrokeByCommmandForSelector 2013-11-14 14:18:54 -08:00
Paul Betts 569c3116a8 Add keyboard accelerators 2013-11-14 13:25:58 -08:00
probablycorey 8bdc1d2418 Better error messages 2013-11-14 13:10:31 -08:00
Kevin Sawicki fa1600c53d Use Atom::getConfigDirPath instead of accessing through config 2013-11-14 12:39:16 -08:00
Matt Colyer 6a1e83205f Merge branch 'master' into refine-paste-normalization 2013-11-14 11:23:45 -08:00
Matt Colyer 33891b51f2 Split keybindings by platform 2013-11-14 11:20:40 -08:00
Matt Colyer 1ef821f4e7 Add CSS class indicating platform on body 2013-11-14 11:20:34 -08:00
probablycorey ed030a54c3 Output which package failed 2013-11-14 10:54:49 -08:00
probablycorey 6bb3a69410 Only show stderr if the process fails 2013-11-14 10:54:25 -08:00
probablycorey 53f5e9fbc6 Quite some grunt.log.write 2013-11-14 10:53:19 -08:00
Matt Colyer 1dac1f375c Provide keyboard navigation for base windows menus 2013-11-14 10:39:31 -08:00
Matt Colyer cfab5c619d Use fat arrow when necessary 2013-11-14 10:39:09 -08:00
Matt Colyer b6afc415f8 Merge menu items without regard to platform decorations 2013-11-14 10:31:20 -08:00
Matt Colyer 5454e93168 Make base menus platform dependent
This fixes the most egrerious errors on Windows but there's still room
for improvement.

Refs #1085
2013-11-14 10:15:23 -08:00
probablycorey 389b2bd8d6 Remove spec suite measuring.
This may be a bit aggressive, so we can add it back if people think it
has benifits.
2013-11-14 09:03:58 -08:00
probablycorey 8ea011597c Don't log start time when running specs 2013-11-14 09:01:54 -08:00
probablycorey 21060ae85a Update public keymap interface 2013-11-14 08:33:23 -08:00
Cheng Zhao fe0cc7d273 Upgrade to node-rcedit@0.1.2 2013-11-14 10:37:29 +08:00
probablycorey f67e9b6e03 Treat all calls to grunt.log.writeln as grunt.verbose.writeln 2013-11-13 17:52:22 -08:00
Matt Colyer 64f2cdb795 💄 2013-11-13 17:35:21 -08:00
probablycorey a996597d49 Call grunt.verbose.writeln instead of grunt.log.writeln 2013-11-13 17:24:49 -08:00
Matt Colyer 52680bd63f Don't normalize indents on paste if there are preceding characters 2013-11-13 17:18:43 -08:00
Kevin Sawicki b8f0f1c683 Upgrade to symbols-view@0.19.0 2013-11-13 16:55:21 -08:00
probablycorey 0840de95dc Update settings-view 2013-11-13 16:51:13 -08:00
Kevin Sawicki fe1b2c6d9d Add rimraf used by script/cibuild as dev dependency 2013-11-13 16:25:17 -08:00
Kevin Sawicki 7b307a17ea Upgrade to metrics@0.11.0 for spec fixes 2013-11-13 16:22:45 -08:00
Kevin Sawicki 097571a83d Upgrade to bracket-matcher@0.11.0 for bug fixes 2013-11-13 16:15:20 -08:00
probablycorey 0673ce8e71 Update metrics and exception-reporting packages 2013-11-13 15:48:08 -08:00
probablycorey 967b022fa6 Add atom.getVersion 2013-11-13 15:48:08 -08:00
Matt Colyer e330b8940a Upgrade terminal@0.16.0 2013-11-13 14:44:55 -08:00
probablycorey 526e5311b9 Update exception-reporting package
Uses actor_login as an key (which octolytics requires)
2013-11-13 11:07:02 -08:00
Matt Colyer 3720f0fb8f Merge pull request #1099 from atom/win-package-specs
Get bundled package specs passing on windows, fixes #1097
2013-11-12 16:07:34 -08:00
Matt Colyer 46b108f1cc Upgrade find-and-replace@0.40.0 2013-11-12 16:01:47 -08:00
Matt Colyer aa59002922 Upgrade scandal@0.8.0 2013-11-12 15:42:31 -08:00
Matt Colyer 6af125bd33 Upgrade underscore-plus@0.3.0 2013-11-12 09:37:23 -08:00
Kevin Sawicki d5d2ae63fe Upgrade to bracket-matcher@0.10.0, refs #1110 2013-11-11 22:24:36 -08:00
Cheng Zhao 08f774e57a Merge pull request #1106 from atom/atom-shell-v0.6.10
Update to atom-shell v0.6.10
2013-11-11 19:43:40 -08:00
Matt Colyer 513a964732 Upgrade tree-view@0.30.0 2013-11-11 16:13:18 -08:00
probablycorey 8f9f5ed0ed Update specs 2013-11-11 15:46:17 -08:00
Matt Colyer 001fe5931e Merge branch 'master' into win-package-specs
Conflicts:
	package.json
2013-11-11 14:22:31 -08:00
Matt Colyer c7541f89da Upgrade tree-view@0.29.0 2013-11-11 14:20:41 -08:00
Matt Colyer cb0f3ce2ec Fix path affixing in git.coffee 2013-11-11 14:13:35 -08:00
probablycorey d71e58ec33 Use keystroke even when referring to multiKeystrokes
The use of keystroke and keystrokes was becoming confusing. When I 
started thinking of a keystroke as a set of keys that trigger a
command it became easier to think about.
2013-11-11 14:05:48 -08:00
Kevin Sawicki 5aacccb03b Uppercase that h 2013-11-11 13:18:53 -08:00
Kevin Sawicki 8f63e40ba0 Default packageDependencies outside of try block 2013-11-11 13:05:45 -08:00
Kevin Sawicki 6c09a42545 Call getPackageDependencies from getAvailablePackagePaths 2013-11-11 13:04:04 -08:00
Kevin Sawicki 1cb1387abd Merge pull request #1107 from atom/ks-editor-scroll
Fix editor occasionally going blank
2013-11-11 12:48:08 -08:00
Kevin Sawicki fe426000d0 Bring hidden input into view on focus
Closes #1104
2013-11-11 12:20:30 -08:00
Kevin Sawicki 3617a61ea2 Merge pull request #970 from atom/ks-extract-config
Remove paths from config
2013-11-11 12:18:28 -08:00
Kevin Sawicki c7b5753814 Upgrade to package-generator@0.19.0 2013-11-11 12:09:47 -08:00
Kevin Sawicki 4ce23e4b51 Upgrade to settings-view@0.38.0 2013-11-11 12:08:52 -08:00
Kevin Sawicki c8aeb8ec2d Add PackageManager::isBundledPackage 2013-11-11 12:01:44 -08:00
Kevin Sawicki 0d75bcae48 Add PackageManager::getPackageDirPaths 2013-11-11 11:53:25 -08:00
Kevin Sawicki 81c56ca4f1 Set configDirPath on ThemeManager in specs 2013-11-11 11:47:24 -08:00
Kevin Sawicki fb02917adf Set defaults after spying on save 2013-11-11 11:43:42 -08:00
probablycorey 8c8f1bc048 Make keymap changes backwards compatible 2013-11-11 11:42:11 -08:00
probablycorey 94bc4ce737 Update clear-cut 2013-11-11 11:42:10 -08:00
probablycorey 9914085ead Simplify keymap selector matching 2013-11-11 11:42:10 -08:00
Kevin Sawicki b801c3ce56 Set core/editor config defaults in spec helper 2013-11-11 11:04:24 -08:00
Kevin Sawicki e31dbfd7d6 Store resourcePath as ivar 2013-11-11 10:40:50 -08:00
Kevin Sawicki d4b5303983 Remove remaining package paths from Config class 2013-11-11 10:33:09 -08:00
Kevin Sawicki ad0d0473b3 Add missing paren 2013-11-11 10:33:09 -08:00
Kevin Sawicki 0db23c3e96 🔥 config.bundledMenusDirPath 2013-11-11 10:33:09 -08:00
Kevin Sawicki 0b78450917 🔥 config.bundledKeymapsDirPath 2013-11-11 10:33:09 -08:00
Kevin Sawicki 4b15b98bdd Set RootView/Editor config defaults from startEditorWindow 2013-11-11 10:32:52 -08:00
Kevin Sawicki 572157124e Move storage dir path to Atom 2013-11-11 10:32:17 -08:00
Kevin Sawicki d0e1d32ae9 Use resource path from load settings 2013-11-11 10:32:01 -08:00
Kevin Sawicki 33cb42a3f7 Merge pull request #997 from atom/ks-remove-some-shims
Don't use shims in core
2013-11-11 10:19:19 -08:00
Kevin Sawicki 055109a708 Remove incorrect atom. prefix from filename 2013-11-11 09:57:10 -08:00
Kevin Sawicki 3539288a1e Remove incorrect atom. prefix 2013-11-11 09:29:29 -08:00
Kevin Sawicki 88d80918a7 Use local resource path variable 2013-11-11 09:26:50 -08:00
Kevin Sawicki 0897007662 Remove unneeded @ 2013-11-11 09:26:43 -08:00
Kevin Sawicki 1c4e38c867 Set paths before creating cache 2013-11-11 09:24:14 -08:00
Kevin Sawicki 78617e31bc 💉 resource path into LessCompileCache 2013-11-11 09:20:48 -08:00
Kevin Sawicki a377a49004 Use atom.config instead of window.config 2013-11-11 09:16:44 -08:00
Kevin Sawicki 5756ec45ba Add Config::toggle 2013-11-11 09:06:33 -08:00
Kevin Sawicki 23c8db09b7 💉 paths into Keymap constructor 2013-11-11 09:05:39 -08:00
Kevin Sawicki 9f8a8139e0 Use atom.syntax instead of window.syntax 2013-11-11 08:53:52 -08:00
Kevin Sawicki d793d114d4 Use atom.site instead of window.site 2013-11-11 08:44:26 -08:00
Kevin Sawicki 9b3edc89a6 Use atom.keymap in specs 2013-11-11 08:43:14 -08:00
Kevin Sawicki 58b2a4f98e Use atom.keymap in Editor 2013-11-11 08:43:14 -08:00
Kevin Sawicki f356190b42 Use atom.pasteboard instead of window.pasteboard 2013-11-11 08:43:14 -08:00
Kevin Sawicki 08a81b61a3 Remove atom.packageStates shims 2013-11-11 08:43:14 -08:00
Kevin Sawicki bff47e10f4 Remove dimension shims on window 2013-11-11 08:43:14 -08:00
Cheng Zhao 6dbe86b063 💄 Use @constructor to refer to class name. 2013-11-12 00:42:23 +08:00
Cheng Zhao 21edc61384 Ship PNG format of icon for all platforms. 2013-11-11 21:29:47 +08:00
Cheng Zhao ef0022f4da Set window icon. 2013-11-11 21:27:31 +08:00
Cheng Zhao cbee5efee6 Ship PNG format of icon under windows. 2013-11-11 21:11:32 +08:00
Cheng Zhao 55da08c69e Update to atom-shell v0.6.10. 2013-11-11 20:58:56 +08:00
Kevin Sawicki df7c3d066a Remove unneeded node prefix 2013-11-09 17:48:45 -08:00
Ben Ogle ba627c005e Upgrade to base16-tomorrow-dark-theme@0.6.0 2013-11-08 19:10:31 -08:00
Ben Ogle b3efe00757 Upgrade to find-and-replace@0.39.0 2013-11-08 16:59:45 -08:00
Ben Ogle 5f8e757f57 Merge pull request #1102 from atom/bo-add-replace
Add replace() to project and buffer
2013-11-08 16:57:38 -08:00
Matt Colyer 5f6f09fc45 Upgrade to-the-hubs@0.9.0 2013-11-08 15:43:52 -08:00
Matt Colyer f9e7d64131 Upgrade fs-plus@0.9.0 2013-11-08 14:09:01 -08:00
Matt Colyer eefeb2ab2a Upgrade fs-plus@0.8.0 2013-11-08 13:49:50 -08:00
Ben Ogle ee896846bb Comments. Change up the api a tiny bit. 2013-11-08 12:25:59 -08:00
Ben Ogle ddd560b785 Add replace to project and buffer 2013-11-08 12:20:43 -08:00
Matt Colyer 59d8beb935 Upgrade spell-check@0.13.0 2013-11-08 11:52:09 -08:00
Matt Colyer c4de03d5c4 Upgrade status-bar@0.16.0 2013-11-08 11:46:56 -08:00
Matt Colyer 53f7592815 Merge branch 'win-package-specs' of github.com:github/atom into win-package-specs 2013-11-08 11:46:11 -08:00
Kevin Sawicki 86a1f43196 Upgrade to less-cache@0.10.0 for Windows fixes 2013-11-08 11:34:58 -08:00
Matt Colyer 177f3b9d53 Upgrade spell-check@0.12.0 2013-11-08 11:26:05 -08:00
Ben Ogle affcb5ff4a Use scandal 0.7.0 2013-11-08 11:08:55 -08:00
Matt Colyer a168692eea Don't relativize uris 2013-11-08 09:39:51 -08:00
Kevin Sawicki 80db09f47b Upgrade to oniguruma@0.24.0 for cross-platform consistency 2013-11-08 08:46:21 -08:00
Kevin Sawicki 1ef1f60556 Prepare 35.0.0 release 2013-11-08 08:39:35 -08:00
Kevin Sawicki 7934043646 Upgrade to autocomplete@0.12.0 for leak fix 2013-11-07 19:17:21 -08:00
Kevin Sawicki ae6b4547e1 Put building URL at bottom 2013-11-07 18:41:52 -08:00
Kevin Sawicki aaa654de39 Upgrade apm for removal of unused dependencies 2013-11-07 18:35:36 -08:00
Kevin Sawicki 1d3f33e740 Add missing vs2010 link 2013-11-07 18:23:11 -08:00
Matt Colyer 19e6c632ea Merge branch 'win-package-specs' of github.com:github/atom into win-package-specs 2013-11-07 17:07:20 -08:00
Matt Colyer 0d014c6257 Upgrade fuzzy-finder@0.20.0 2013-11-07 17:06:27 -08:00
Kevin Sawicki 445421f961 Add Windows link to building doc 2013-11-07 15:08:39 -08:00
Kevin Sawicki 778ed06272 📝 Add missing e 2013-11-07 15:04:48 -08:00
Kevin Sawicki e16481d6e0 Remove Objective-C styleguide 2013-11-07 15:00:46 -08:00
Kevin Sawicki f34af85ad3 💄 Beware 2013-11-07 14:58:30 -08:00
Matt Colyer 9118a70592 Merge pull request #1074 from atom/win-specs
Get Windows Specs running
2013-11-07 14:48:39 -08:00
Matt Colyer 43419fdef2 Normalize dom ids rather than remove 2013-11-07 14:41:58 -08:00
Matt Colyer 11f3686832 Upgrade dev-live-reload@0.15.0 2013-11-07 14:33:23 -08:00
Matt Colyer 455321c4a8 Merge branch 'win-specs' of github.com:github/atom into win-specs 2013-11-07 14:00:14 -08:00
Matt Colyer dfa5ac11a2 Merge branch 'origin/master' into win-specs 2013-11-07 13:59:43 -08:00
Kevin Sawicki 8754a0cbaf Upgrade to oniguruma@0.23.0 2013-11-07 13:42:12 -08:00
Daniel Hengeveld 6485e4f540 Merge pull request #1077 from atom/copy-docs-into-atom-io
Copy docs into atom io
2013-11-07 11:16:46 -08:00
Kevin Sawicki 4ca66a535c Merge pull request #1095 from atom/ks-solo
Use non-replicated telepath strings
2013-11-07 10:13:50 -08:00
Nathan Sobo 56c88820d6 Upgrade to telepath 0.23.0 to deal gracefully w/ outdated window state 2013-11-07 10:02:44 -08:00
Kevin Sawicki & Nathan Sobo 5d56365c26 Upgrade to telepath@0.22.0 2013-11-07 10:02:43 -08:00
Kevin Sawicki & Nathan Sobo 55c5ae926c Create telepath string with replicate: false option 2013-11-07 10:02:43 -08:00
Kevin Sawicki & Nathan Sobo ef68fd24d5 Log open exception stack to console 2013-11-07 10:02:43 -08:00
Kevin Sawicki 4497ec9733 Upgrade to language-coffee-script@0.3.0 for switch/when indent fix 2013-11-07 09:48:10 -08:00
Matt Colyer 38a3c0dbd3 Simplify regexp escaping in text-mate-grammar.coffee 2013-11-07 09:26:56 -08:00
Matt Colyer b69bc8ce71 Add a newline to the end of .gitattributes 2013-11-07 09:22:41 -08:00
Kevin Sawicki fe6cf8ec01 Merge pull request #1091 from atom/ks-autoscroll
Autoscroll on undo/redo
2013-11-07 09:17:10 -08:00
Kevin Sawicki b4f8387053 Remove unneded clearAutoscroll call 2013-11-07 09:04:41 -08:00
Kevin Sawicki 6b63f5db9e Always mark cursor needing autoscroll 2013-11-07 09:04:41 -08:00
Kevin Sawicki 291f4fbb90 Mark last cursor for autoscroll on undo/redo 2013-11-07 09:04:41 -08:00
Kevin Sawicki dba7687470 Autoscroll even when text does not change 2013-11-07 09:04:41 -08:00
Cheng Zhao e6a7678fd6 Update to atom-shell v0.6.9. 2013-11-07 18:52:12 +08:00
Ben Ogle 4b6867831a Upgrade to scandal@0.6.4 2013-11-06 17:34:42 -08:00
Matt Colyer 28d7160c3b Update specs concerning stylesheet ids 2013-11-06 17:12:47 -08:00
Cheng Zhao c4ab4364ba Merge pull request #1089 from atom/cz-win32-icon
Set version strings and icon for the exe on Windows
2013-11-06 17:07:46 -08:00
Matt Colyer 98db48eae6 Fix syntax path matching 2013-11-06 17:04:50 -08:00
Matt Colyer d6cb848503 Upgrade language-mode@0.3.0 2013-11-06 16:52:58 -08:00
Matt Colyer 3119ed9dfe Update project-spec.coffee for windows 2013-11-06 16:45:10 -08:00
Matt Colyer 3f0f3267c1 Upgrade scandal@0.6.3 2013-11-06 16:40:14 -08:00
Ben Ogle 2cc32e1faf Upgrade to atom-dark-ui@0.5.0
New tabs!!
2013-11-06 14:55:36 -08:00
Matt Colyer a8fe8ab982 Update keymap-spec.coffee paths for windows 2013-11-06 14:52:28 -08:00
Ben Ogle 4bee197e01 Upgrade to base16-tomorrow-dark-theme@0.5.0 2013-11-06 14:42:24 -08:00
Matt Colyer 01f41207d4 Update font specs for windows 2013-11-06 14:39:47 -08:00
Ben Ogle ce2e123cc8 Merge pull request #1088 from atom/bo-changes-for-themes-with-padding
Handle themes with padding on the scroll view
2013-11-06 14:38:34 -08:00
Ben Ogle 16b64b03f7 Nof 2013-11-06 14:38:01 -08:00
Ben Ogle 2adcc9709c 10 -> back to 2 2013-11-06 14:37:36 -08:00
Ben Ogle 0f1d701646 Upgrade to wrap-guide@0.5.0 2013-11-06 14:21:54 -08:00
Ben Ogle 6e049dd173 Fix tests in editor 2013-11-06 14:13:09 -08:00
Matt Colyer face4a3f76 Force Unix line endings in spec/fixtures 2013-11-06 14:11:36 -08:00
Matt Colyer 015f4f7542 Merge remote-tracking branch 'origin/master' into win-specs 2013-11-06 12:12:41 -08:00
Kevin Sawicki 9f5e913804 Update remaining selected class names to fold-selected 2013-11-06 09:55:53 -08:00
Kevin Sawicki 383a724144 Update class name to new fold-selected 2013-11-06 09:50:06 -08:00
Kevin Sawicki 90c21906a4 Add fold- prefix to selected class name
This prevents interference with the base selected class
which adds a noticeable blur to folded lines that are selected
when using dark syntax and light ui.
2013-11-06 09:49:18 -08:00
Cheng Zhao 0686efc429 Revert "Only run set-development-version on mac"
This reverts commit 9a4db9d95d.

It's supported on Windows now.
2013-11-06 22:48:50 +08:00
Cheng Zhao 2058d5a431 Add task to set exe icon. 2013-11-06 22:41:53 +08:00
Cheng Zhao 6c9f037cd9 Use node-rcedit to set development version. 2013-11-06 22:27:27 +08:00
Cheng Zhao 5033fac8eb Update to atom-shell v0.6.8. 2013-11-06 12:32:19 +08:00
Ben Ogle 0aa0dc01d5 Properly reset the size of layers on resize
Otherwise, when a theme has padding in the scroll-view, it will be 
scrollable all the time (width:100%).
2013-11-05 18:40:05 -08:00
Ben Ogle 994756f8c1 Use padding in the pixel left calculation
Now themes can specify padding in the scroll-view so the text isn't 
jammed up against the
2013-11-05 18:40:04 -08:00
Kevin Sawicki 47bab20363 Merge pull request #1087 from atom/ks-reenable-specs
Reenable edit session specs
2013-11-05 18:30:36 -08:00
Kevin Sawicki efb87237e2 Reenable undo, redo, and transaction specs 2013-11-05 18:25:37 -08:00
Kevin Sawicki 2be5790311 Set auto indent config setting in spec 2013-11-05 18:25:36 -08:00
Kevin Sawicki 60fa937ed7 Add asserts for undoing an insertNewlineAbove 2013-11-05 18:25:36 -08:00
Kevin Sawicki 867a6ecd95 Reenable insertNewlineBelow() specs 2013-11-05 18:25:36 -08:00
Kevin Sawicki 36c9d68009 Update to telepath@0.21.0 2013-11-05 18:25:36 -08:00
Ben Ogle 4dda2f93ae Upgrade to base16-tomorrow-dark-theme@0.4.0 2013-11-05 17:48:22 -08:00
Matt Colyer fcdc341981 Merge branch 'win-specs' of https://github.com/atom/atom into win-specs 2013-11-05 17:36:24 -08:00
Matt Colyer 5b187e7a8c Upgrade jasmine-tagged@0.2.0 2013-11-05 17:35:44 -08:00
Ben Ogle 740085e561 Upgrade base16-tomorrow-dark-theme@0.3.0 2013-11-05 17:34:00 -08:00
Ben Ogle 5a2730c8c0 Upgrade to solarized-dark-syntax@0.4.0 2013-11-05 17:23:45 -08:00
Ben Ogle 08ee9c08b7 Upgrade to atom-light-syntax@0.6.0 2013-11-05 17:08:17 -08:00
Ben Ogle 103f602c9c Upgrade dev-live-reload@0.14.0 2013-11-05 17:02:35 -08:00
Matt Colyer fb6b8029be Run bundled and user specs 2013-11-05 16:58:42 -08:00
Matt Colyer edc789173b Don't install commands on windows 2013-11-05 16:44:03 -08:00
Matt Colyer 7ba4782ceb Don't focus atom-spec.coffee 2013-11-05 16:37:54 -08:00
Matt Colyer 9863386644 Update Directory specs for platform specific issues 2013-11-05 16:36:51 -08:00
Matt Colyer 1fe6a2974d Merge branch 'win-specs' of https://github.com/atom/atom into win-specs 2013-11-05 15:46:34 -08:00
Matt Colyer 6bd7dd8841 Add jasmine-tagged, for filtering platform specs 2013-11-05 15:44:38 -08:00
Ben Ogle 3db786953c Upgrade to atom-dark-syntax@0.6.0 2013-11-05 15:17:45 -08:00
Ben Ogle b9b9b7df91 Upgradt to find-and-replace@0.38.0 2013-11-05 15:16:00 -08:00
Ben Ogle da2d37408f Upgrade to tree-view@0.28.0 2013-11-05 12:37:03 -08:00
Ben Ogle 8739dfe739 Update to find-and-replace@0.37.0 2013-11-05 12:01:02 -08:00
Matt Colyer cd2e78f04f Fix indentation of comments
Ref #1081
2013-11-05 11:46:44 -08:00
Ben Ogle 8851120db2 Add split: left handling to openSingletonSync() 2013-11-05 11:25:45 -08:00
Ben Ogle c59404b2b0 Upgrade to tree-view@0.27.0 2013-11-05 10:43:41 -08:00
Matt Colyer 151a4290d4 Update biscotto arguments to latest telepath 2013-11-05 09:39:10 -08:00
Kevin Sawicki 1ef5809b24 Merge pull request #1078 from atom/ks-soft-wrap-resize
Update soft wrap column on editor resize
2013-11-05 09:06:21 -08:00
Matt Colyer 8cca42a6b8 Remove references to atom-docs 2013-11-05 09:04:26 -08:00
Kevin Sawicki aad23d4760 💄 Remove extra empty line 2013-11-04 18:39:59 -08:00
Kevin Sawicki d20bff473b Increase overflowchanged timeout to 100ms 2013-11-04 18:38:08 -08:00
Kevin Sawicki 287f1984db Update width in chars when editor's size changes
Register an overflowchanged event listener on the editor's scroll view
and update the width in chars when this event fires.

Closes #928
Closes #961
Closes #993
2013-11-04 18:12:17 -08:00
Ben Ogle 1cb5d16a60 Style messages 2013-11-04 17:19:09 -08:00
Daniel Hengeveld 105f8d0baf check if atom.io directory exists in copy-docs 2013-11-04 17:03:29 -08:00
Daniel Hengeveld 7e9a1d8ffe copy docs into atom.io project, don't build guides as they are in the DB 2013-11-04 16:47:12 -08:00
Matt Colyer ee280d87f9 Ensure we're using proper dom ids in specs 2013-11-04 16:33:11 -08:00
Matt Colyer e312050163 Create valid DOM ids for stylesheets 2013-11-04 16:21:50 -08:00
Matt Colyer 717626fbaf Merge branch 'master' into win-specs 2013-11-04 14:53:49 -08:00
Matt Colyer ec761d00ef Remove modified check on fixture file 2013-11-04 14:53:43 -08:00
Ben Ogle 3d99e580b9 Upgrade to tabs@0.6.0 and atom-light-ui@0.6.0 2013-11-04 14:30:38 -08:00
Kevin Sawicki b0da17701b Run apm clean during bootstrap
Closes #905
2013-11-02 19:29:52 -07:00
Kevin Sawicki 8443db6630 Upgrade to language-coffee-script@0.2.0 2013-11-02 19:00:34 -07:00
Cheng Zhao 2333b53d05 Update to atom-shell v0.6.7. 2013-11-02 17:27:00 +08:00
Kevin Sawicki f05eb67125 Upgrade to package-generator@0.17.0 2013-11-01 17:34:52 -07:00
Kevin Sawicki 4c5fdbce93 Upgrade to package-generator@0.16.0 2013-11-01 17:29:36 -07:00
Kevin Sawicki 9482e9b397 Upgrade to package-generator@0.15.0 2013-11-01 17:22:47 -07:00
Kevin Sawicki 0eb4704f5e Remove empty CHANGELOG 2013-11-01 17:15:32 -07:00
Kevin Sawicki 13c374845f Upgrade to bracket-matcher@0.9.0 2013-11-01 16:54:15 -07:00
Nathan Sobo 0c87f0edf8 Make ctrl-Z/ctrl-y invoke 'core:redo' instead of 'corey:redo' 2013-11-01 17:49:29 -06:00
Kevin Sawicki c9db0f14ed Disable colored output in script/cibuild 2013-11-01 16:42:50 -07:00
Kevin Sawicki 875e9c886c Increase max buffer to 1MB 2013-11-01 16:34:20 -07:00
Kevin Sawicki 05867bc889 Default error code to 1
Apparently not all errors passed to the callback have a code so default
it to zero when missing. The 'stdout maxBuffer exceeded.' is once such
error that has no code.
2013-11-01 16:27:46 -07:00
Kevin Sawicki 621058aa9e Register copied edit sessions on the project
Without this any split edit sessions won't be passed to package
listeners that register using project.eachEditSession()

Closes #1065
2013-11-01 15:51:27 -07:00
Kevin Sawicki 3b52a6a040 Use underscore-plus 2013-11-01 15:50:38 -07:00
Nathan Sobo e70f87dfc7 Upgrade to telepath 0.20.0 so simple selection changes aren't undone
This version of telepath adds an `undo: 'combine'` option which becomes
the default for marker changes. With an undo strategy of 'combine', the
operation is only undone when combined in a transaction with other
operations that are undone. This prevents simple marker updates from
getting pushed to the undo stack.
2013-11-01 16:39:32 -06:00
Matt Colyer 0695aafe80 Devmode hard-codes the location of the atom repo 2013-11-01 15:33:11 -07:00
Matt Colyer c9eebcf00a Fixture hashes depend on line returns 2013-11-01 15:15:17 -07:00
Matt Colyer f26110a81b Remove empty collaboration menu 2013-11-01 15:02:59 -07:00
Kevin Sawicki 651b40f360 Upgrade to symbols-view@0.18.0 2013-11-01 14:28:27 -07:00
Kevin Sawicki 456c27475b Merge pull request #1069 from atom/ks-git-on-windows
Get git working on windows
2013-11-01 14:01:55 -07:00
Kevin Sawicki bc0a268841 Upgrade to find-and-replace@0.36.0 2013-11-01 13:56:48 -07:00
Kevin Sawicki 9d9ff97995 Upgrade to tree-view@0.26.0 2013-11-01 13:56:48 -07:00
Kevin Sawicki a03a89d359 Ignore debug.log 2013-11-01 13:56:47 -07:00
Kevin Sawicki 7e043f5bc6 Change platform check from windows to win32 2013-11-01 13:56:47 -07:00
Kevin Sawicki e8f8cd2dcd Normalize forward slashes on windows 2013-11-01 13:56:47 -07:00
Kevin Sawicki 132c6f7414 Enable ignoreEolWhitespace in getLineDiffs on windows 2013-11-01 13:56:47 -07:00
Kevin Sawicki a458f7581d Upgrade to git-utils@0.29.0 2013-11-01 13:56:47 -07:00
probablycorey 64565cc510 Update command palette package
I forgot to include this one in the sublime parity branch.
2013-11-01 13:51:47 -07:00
Corey Johnson 7de8b4c2f4 Merge pull request #1066 from atom/cj-sublime-bindings
Sublime key binding pairity
2013-11-01 13:45:44 -07:00
probablycorey 01e40bd866 Update fuzzy finder package 2013-11-01 13:39:49 -07:00
probablycorey 6e47135ba7 Update package versions 2013-11-01 11:49:59 -07:00
probablycorey b041c0176c Merge remote-tracking branch 'origin/master' into cj-sublime-bindings 2013-11-01 11:33:13 -07:00
probablycorey b22d64745f Handle multi-keystroke keybinding
Previously for a binding like `meta-x meta-y` you had to hold down the 
meta key. This makes it possible to release the meta key between
key presses.
2013-11-01 11:15:01 -07:00
Kevin Sawicki cbf55f38f9 Use fs-plus in covert-theme task 2013-11-01 11:11:07 -07:00
probablycorey 9e8b1fb661 Handle modifier keydown events
When only a modifier is pressed it still triggers a keydown event. This
normalizes the keystroke name for those events.
2013-11-01 11:02:46 -07:00
Kevin Sawicki 6d4285f180 Add script/build.cmd 2013-11-01 10:58:25 -07:00
Kevin Sawicki 7d3c272909 Merge pull request #1062 from atom/ks-extract-fs-utils
Extract fs-utils into a module
2013-11-01 09:14:58 -07:00
Kevin Sawicki 6677b2ccdf Upgrade to fs-plus@0.6.0 2013-11-01 09:08:49 -07:00
Kevin Sawicki bf48195752 Upgrade to fs-plus@0.5.0 2013-11-01 08:46:03 -07:00
Kevin Sawicki b8680be6c6 Update writeSync spies 2013-11-01 08:46:03 -07:00
Kevin Sawicki 0264fd6be5 Rename writeSync to writeFileSync 2013-11-01 08:46:03 -07:00
Kevin Sawicki 9c79e39401 Upgrade to fs-plus@0.4.0 2013-11-01 08:46:03 -07:00
Kevin Sawicki e06100fe25 Shim fs.exists 2013-11-01 08:46:03 -07:00
Kevin Sawicki f7686a5485 Fail if error isn't falsey 2013-11-01 08:46:03 -07:00
Kevin Sawicki 01610a3fb8 Add shims for previous fs methods 2013-11-01 08:46:03 -07:00
Kevin Sawicki d8766b9aba Use makeTreeSync 2013-11-01 08:46:03 -07:00
Kevin Sawicki ebb7a2637a Upgrade to fs-plus@0.3.0 2013-11-01 08:46:03 -07:00
Kevin Sawicki a143ca551b Remove unused rimraf dependency 2013-11-01 08:46:03 -07:00
Kevin Sawicki 3cfefc03ff Upgrade to fs-plus@0.2.0 2013-11-01 08:46:03 -07:00
Kevin Sawicki 1646cdc349 Remove plist dependency 2013-11-01 08:46:03 -07:00
Kevin Sawicki bc289cc0cb Remove unused dependency 2013-11-01 08:46:02 -07:00
Kevin Sawicki ef97dadea1 Update fs-utils references to fs-plus 2013-11-01 08:46:02 -07:00
Kevin Sawicki 83dcf79bcf Use fs-plus 2013-11-01 08:46:02 -07:00
Kevin Sawicki 60563f46c9 Upgrade to fs-plus@0.1.0 2013-11-01 08:46:02 -07:00
Ben Ogle 70925263f7 Add ability to specify rowCount to selectUp and selectDown() 2013-10-31 17:47:13 -07:00
Nathan Sobo 166faf1af2 Merge branch 'telepath-next' 2013-10-31 18:39:44 -06:00
Nathan Sobo aab2937a48 Upgrade to telepath 0.19.0 for persist: false marker option 2013-10-31 17:56:00 -06:00
Nathan Sobo 1b9f86d13a Upgrade to telepath 0.18.0
This fixes an issue where markers would no longer be updatable after
reloading an open editor. This was caused by cloned arrays not updating
the array id of their markers.
2013-10-31 17:08:41 -06:00
Nathan Sobo 88802ef4c5 Upgrade telepath to 0.17.0 2013-10-31 17:08:41 -06:00
Nathan Sobo e8e3e3224f Switch to new API for Document.deserialize and ::saveSync 2013-10-31 17:08:41 -06:00
Nathan Sobo 1b6c34673e Upgrade autosave to 0.6.0 2013-10-31 17:08:41 -06:00
Nathan Sobo aa6f2187d8 Upgrade telepath to 0.16.0 2013-10-31 17:08:40 -06:00
Nathan Sobo 7d64cd179e Always mock atom.packages.resolvePackagePath
…instead of only in package specs. This allows specs that assume it is
mocked to work correctly when we run the full spec suite. Namely, the
settings-view specs had an issue with this.
2013-10-31 17:08:40 -06:00
Nathan Sobo 56ff3b79e4 Upgrade to Telepath v0.15.0 2013-10-31 17:08:40 -06:00
Nathan Sobo ba654f15cb Drop collaboration from default packages
We'll revisit it when the codebase has a better relationship with
telepath.
2013-10-31 17:08:40 -06:00
Nathan Sobo 62ccf92a5d Get core specs passing w/ Telepath v0.14.0. Delete replication specs.
Telepath v0.14.0 is a ground-up rewrite of the replication library,
which is principally designed to support moving document fragments
within the overall document. But it's also a lot better in a number of
ways. This commit does the minimal to get things working on the new
telepath. Standard package specs don't pass yet. Also, I deleted the
replication specs since they are extremely convoluted and will be able
to be replaced with much better versions once I complete the changes
enabled by the new Telepath.
2013-10-31 17:08:40 -06:00
Nathan Sobo ca073fb7c2 Upgrade to fuzzy-finder 0.16.0 to avoid null active pane item errors
Fixes #1064
2013-10-31 17:07:52 -06:00
probablycorey 94b5d08b63 Remove unused keybinding comment 2013-10-31 15:41:26 -07:00
probablycorey 678dc82d50 Remove keybindings that are being used 2013-10-31 15:40:59 -07:00
probablycorey 5b5f0af6b5 Add native-key-bindings class 2013-10-31 15:40:44 -07:00
Ben Ogle 695c8d97f2 Remove all the complexity from the gutter check
Give up and serenader all whenever there is a change: newlines included.
2013-10-31 13:06:32 -07:00
Ben Ogle 5ac3a74bf0 Return column = 0 when mouse to the left of editor
Fixes #966
2013-10-31 12:54:21 -07:00
Ben Ogle d150170e5b Fix gutter rendering when there are folds
Fixes #1059
2013-10-31 12:54:21 -07:00
Matt Colyer d14e5a6992 Merge pull request #1061 from atom/win-close-master-process
Don't leak browser processes on windows, fixes #1060
2013-10-31 12:00:33 -07:00
Matt Colyer b419cdf193 Close browser after last window exits on windows 2013-10-31 11:47:52 -07:00
Matt Colyer a57f1e4727 First cut at build documentation 2013-10-31 11:29:43 -07:00
Matt Colyer 34499d87ab Upgrade pathwatcher@0.9.0 2013-10-31 10:57:03 -07:00
Ben Ogle 4e18e7a67c Lists are nested via padding the list items 2013-10-31 10:50:48 -07:00
probablycorey aef9a12910 Left and right tool-panels don't close when escape is pressed. 2013-10-31 10:00:38 -07:00
probablycorey b501758bf7 💄 2013-10-31 10:00:17 -07:00
Cheng Zhao 993cc75c15 Merge pull request #1054 from atom/cz-fix-win32-scripts
Fix scripts on Windows
2013-10-30 17:28:57 -07:00
Ben Ogle 64e02d007c Upgrade to find-and-replace@0.35.0 2013-10-30 17:17:24 -07:00
Kevin Sawicki a39255fa77 Upgrade to settings-view@0.37.0 2013-10-30 16:47:40 -07:00
Kevin Sawicki ddfd1842d1 Upgrade apm for --no-color option 2013-10-30 16:47:40 -07:00
probablycorey 3e71dcfcd0 Comment out unimplementd keybindings 2013-10-30 16:39:46 -07:00
probablycorey 2629345df2 Add OS X "emacs style" bindings 2013-10-30 16:31:47 -07:00
probablycorey 8c3fbc3437 Better sublime text keybinding parity. 2013-10-30 16:28:16 -07:00
Garen Torikian c30f63fa0c Merge pull request #1052 from atom/doc-updates
Doc updates
2013-10-30 15:59:29 -07:00
Ben Ogle 5685eb9263 Upgrade to 2013-10-30 15:53:34 -07:00
Garen Torikian e3fd999964 Address a few more typos 2013-10-30 15:21:51 -07:00
Matt Colyer e8109adeee Retrieve docs/template.jst from the history 2013-10-30 15:14:02 -07:00
Kevin Sawicki b150191263 Upgrade to snippets@0.13.0 2013-10-30 15:11:59 -07:00
Matt Colyer 4dc909de03 Use a fork of grunt-coffeelint
Upgrades version of coffelint to support windows. Related to #1043.
2013-10-30 15:06:07 -07:00
Garen Torikian c029f8eb95 Remove images directory
Depend on the GitHub cloud instead
2013-10-30 15:02:23 -07:00
Garen Torikian 31e75884be Spruce up documentation around themes 2013-10-30 15:01:37 -07:00
Kevin Sawicki 82e5545f6e Stub refresh methods in replication spec 2013-10-30 14:54:48 -07:00
Matt Colyer febd845876 Escape backslashes in task bootstrap on all platforms 2013-10-30 14:48:22 -07:00
Ben Ogle 61021b6a13 Add docs about the keybindings tab 2013-10-30 14:42:53 -07:00
Kevin Sawicki b9274412c5 Refresh index and status after opening repo
Previously this relied on an initial window focus event firing
to kick off the initial load.  This focus event no longer fires
in jquery 2.0 so just explicitly refresh the index and status when
setting the project path.
2013-10-30 14:42:24 -07:00
Ben Ogle d6457152f0 typos 2013-10-30 14:37:08 -07:00
Matt Colyer 49e48a0895 Merge brantch 'win-tasks' 2013-10-30 14:35:48 -07:00
Ben Ogle eae7a7065e Link the package docs together 2013-10-30 14:34:50 -07:00
Kevin Sawicki 696355f6dd Upgrade to tree-view@0.23.0 2013-10-30 14:32:51 -07:00
Matt Colyer ab0c60bd45 Update paths in task bootstrap for windows
Fixes #1049
2013-10-30 14:30:01 -07:00
Ben Ogle 83005deae6 Small changes 2013-10-30 14:28:20 -07:00
Ben Ogle d486a55b4c Fix the panel code to use the tool-panel component 2013-10-30 14:22:12 -07:00
Kevin Sawicki e6b3f400c0 Update git status on buffer path-changed events 2013-10-30 14:15:52 -07:00
Ben Ogle 86cba12457 Remove images from repo
They are hosted on github right now
2013-10-30 14:14:35 -07:00
Ben Ogle 1d6e3c73cf Update image references 2013-10-30 14:14:16 -07:00
Garen Torikian 8fb06a5b11 Add images of sample package 2013-10-30 13:21:02 -07:00
Garen Torikian 8afb3fb6b9 Talk about using Theme Variables 2013-10-30 13:21:02 -07:00
Garen Torikian ff9356bc2c Begin talking about Theme Variables 2013-10-30 13:21:02 -07:00
Garen Torikian b523decc7e Indicating the color in the stylesheet is important 2013-10-30 13:21:02 -07:00
Garen Torikian e7a14bf17f Provide initial edits to "Your First Package" docs 2013-10-30 13:21:02 -07:00
Garen Torikian a593d3b152 Split basic package information from the tutorial 2013-10-30 13:21:02 -07:00
Ben Ogle 9781565df8 Link to the theme docs 2013-10-30 13:21:02 -07:00
Ben Ogle a595378850 Add a theme-variables.md doc 2013-10-30 13:21:01 -07:00
Ben Ogle b2e2a2cdda Upgrade scandal@0.6.1 2013-10-30 12:34:57 -07:00
Ben Ogle eb8d9214b7 Upgrade to find-and-replace@0.34.0
Project search in a tab
2013-10-30 12:23:47 -07:00
Ben Ogle 8ac8b3748f Merge pull request #1053 from atom/bo-singleton-open
openSingletonSync()
2013-10-30 12:21:19 -07:00
Ben Ogle b4a28d7418 Fix test 2013-10-30 12:13:38 -07:00
Ben Ogle c6ee5699e7 Upgrade to status-bar@0.15.1 2013-10-30 11:49:43 -07:00
Ben Ogle 19220aa9f3 Upgrade to tabs@0.7.2 2013-10-30 11:49:10 -07:00
Ben Ogle 0a10603eb3 Pass all options through 2013-10-30 11:38:32 -07:00
Ben Ogle 0700732495 Upgrade to find-and-replace@0.33.1 2013-10-30 11:36:50 -07:00
Ben Ogle c3b270dc80 Upgrade to tabs@0.7.1 2013-10-30 11:26:18 -07:00
Ben Ogle 2baa5ba678 Upgrade to fuzzy-finder@0.15.1 2013-10-30 11:26:04 -07:00
Ben Ogle 0bd701b4a6 Fix tests 2013-10-30 11:25:30 -07:00
Ben Ogle 1be8d5e618 Add openSingletonSync() to rootView 2013-10-30 11:25:30 -07:00
Ben Ogle a212a7c259 pane.split() doesn't implicitly copy the active item. 2013-10-30 11:25:30 -07:00
probablycorey 76a041cfe1 Update autosave package 2013-10-30 11:08:13 -07:00
Kevin Sawicki 46eb6df61e Prepare 34.0.0 release 2013-10-30 10:51:31 -07:00
probablycorey 93c7531cf9 Don't destroy pane items in confirmClose 2013-10-30 10:47:01 -07:00
Kevin Sawicki 8bf726d3e1 Merge pull request #1055 from atom/ks-rename-toml-gfm
Add language- prefix to gfm and toml
2013-10-30 10:43:00 -07:00
Kevin Sawicki 412cb602a4 Upgrade to whitespace@0.8.0 2013-10-30 10:35:50 -07:00
Kevin Sawicki f10abfe630 Upgrade to markdown-preview@0.13.0 2013-10-30 10:34:40 -07:00
Kevin Sawicki 14664625d5 Upgrade to language-toml@0.6.0 2013-10-30 10:29:24 -07:00
Kevin Sawicki 9e12c4610d Upgrade to language-gfm@0.8.0 2013-10-30 10:29:10 -07:00
Kevin Sawicki c1d09f5229 Add cson to valid grammar extensions 2013-10-30 10:23:25 -07:00
Kevin Sawicki d486522cde Upgrade to language-toml@0.4.0 2013-10-30 10:15:41 -07:00
Kevin Sawicki e3ff39bf4f Upgrade to language-gfm@0.6.0 2013-10-30 10:15:18 -07:00
Kevin Sawicki 74a48e58dc Upgrade to settings-view@0.36.0 2013-10-30 09:29:33 -07:00
Kevin Sawicki e63bf75f96 Update apm for native module fix 2013-10-30 09:20:21 -07:00
Kevin Sawicki 8b9595f1bd Use getter when toggling soft tabs 2013-10-30 09:06:12 -07:00
Cheng Zhao 53954c236c Use the apm in node_modules/atom-package-manager instead of vendor/apm. 2013-10-30 23:44:05 +08:00
Cheng Zhao 3de18ae9f6 Fix calling of apm and grunt in script/cibuild and script/test. 2013-10-30 18:10:03 +08:00
Cheng Zhao 9c7ce22abe Unzipping atom-shell.zip on Windows with node-unzip. 2013-10-30 18:02:43 +08:00
Cheng Zhao bfab56247f node_modules/.bin/grunt is a bash script not a js script. 2013-10-30 17:05:08 +08:00
Cheng Zhao e4400c648d Revert "Run apm from node_modules"
This reverts commit 8742f6c06c.

The `node_modules/.bin/apm` is a bash script not a js script, so on
Windows `node node_modules/.bin/apm` would fail with:

```
C:\cygwin\home\zcbenz\codes\atom\node_modules\.bin\apm:2
basedir=`dirname "$0"`
        ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3
```
2013-10-30 10:51:06 +08:00
Kevin Sawicki 271f23083e Bump packages for emissary@0.9.0 upgrade 2013-10-29 18:48:20 -07:00
196 arquivos alterados com 16867 adições e 17297 exclusões
+8
Ver Arquivo
@@ -0,0 +1,8 @@
# Specs depend on character counts, if we don't specify the line endings the
# fixtures will vary depending on platform
spec/fixtures/**/*.js text eol=lf
spec/fixtures/**/*.coffee text eol=lf
spec/fixtures/**/*.less text eol=lf
spec/fixtures/**/*.css text eol=lf
spec/fixtures/**/*.txt text eol=lf
spec/fixtures/dir/**/* text eol=lf
+2
Ver Arquivo
@@ -5,7 +5,9 @@
.nvm-version
node_modules
npm-debug.log
debug.log
/tags
/atom-shell/
docs/output
spec/fixtures/evil-files/
/apm
Ver Arquivo
+46 -52
Ver Arquivo
@@ -1,69 +1,63 @@
# :rotating_light: Contributing to Atom :rotating_light:
# :tada: Contributing to Atom :tada:
These are just guidelines, not rules, use your best judgement and feel free
to propose changes to this document in a pull request.
## Issues
* Include screenshots and animated GIFs whenever possible, they are immensely
helpful
helpful.
* Include the behavior you expected to happen and other places you've seen
that behavior such as Emacs, vi, Xcode, etc.
* Check the Console app for stack traces to include if reporting a crash
* Check the Dev tools (`alt-cmd-i`) for errors and stack traces to include
* Check the Console app for stack traces to include if reporting a crash.
* Check the Dev tools (`alt-cmd-i`) for errors and stack traces to include.
### Package Repositories
## Code
* Follow the [JavaScript](https://github.com/styleguide/javascript),
[CSS](https://github.com/styleguide/css),
and [Objective-C](https://github.com/github/objective-c-conventions)
styleguides
This is the repository for the core Atom editor only. Atom comes bundled with
many packages and themes that are stored in other repos under the
[atom org](https://github.com/atom) such as [tabs](https://github.com/atom/tabs),
[find-and-replace](https://github.com/atom/find-and-replace),
[language-javascript](https://github.com/atom/language-javascript),
and [atom-light-ui](http://github.com/atom/atom-light-ui).
If you think you know which package is causing the issue you are reporting, feel
free to open up the issue in that specific repository instead. When in doubt
just open the issue here but be aware that it may get closed here and reopened
in the proper package's repository.
## Pull Requests
* Include screenshots and animated GIFs whenever possible.
* Follow the [CoffeeScript](#coffeescript-styleguide),
[JavaScript](https://github.com/styleguide/javascript),
and [CSS](https://github.com/styleguide/css) styleguides
* Include thoughtfully worded [Jasmine](http://pivotal.github.com/jasmine/)
specs
* Add 3rd-party packages as a `package.json` dependency
* Commit messages are in the present tense
* Commit messages that improve the format of the code start with :lipstick:
* Commit messages that improve the performance start with :racehorse:
* Commit messages that remove memory leaks start with :non-potable_water:
* Commit messages that improve documentation start with :memo:
* Files end with a newline
* Avoid placing files in `vendor`. 3rd-party packages should be added as a
`package.json` dependency.
* Files end with a newline.
* Requires should be in the following order:
* Built in Node Modules (such as `path`)
* Built in Atom and Atom Shell Modules (such as `atom`, `shell`)
* Local Modules (using relative paths)
* Class variables and methods should be in the following order:
* Class variables (variables starting with a `@`)
* Class methods (methods starting with a `@`)
* Instance variables
* Instance methods
* Be ware of platform differences
* The home directory is `process.env.USERPROFILE` on Windows, while on OS X
and Linux it's `process.env.HOME`
* Path separator is `\` on Windows, and is `/` on OS X and Linux, so use
`path.join` to concatenate filenames.
* Beware of platform differences
* Use `require('atom').fs.getHomeDirectory()` to get the home directory.
* Use `path.join()` to concatenate filenames.
* Temporary directory is not `/tmp` on Windows, use `os.tmpdir()` when
possible
## Philosophy
## Git Commit Messages
* Use the present tense
* Reference issues and pull requests liberally
* Consider starting the commit message with an applicable emoji:
* :lipstick: when improving the format/structure of the code
* :racehorse: when improving performance
* :non-potable_water: when plugging memory leaks
* :memo: when writing docs
### Write Beautiful Code
Once you get something working, take the time to consider whether you can achieve it in a more elegant way. We're planning on open-sourcing Atom, so let's put our best foot forward.
## CoffeeScript Styleguide
### When in doubt, pair-up
Pairing can be an effective and fun way to pass on culture, knowledge, and taste. If you can find the time, we encourage you to work synchronously with other community members of all experience levels to help the knowledge-mulching process. It doesn't have to be all the time; a little pairing goes a long way.
### Write tests, and write them first
The test suite keeps protects our codebase from the ravages of entropy, but it only works when we have thorough coverage. Before you write implementation code, write a failing test proving that it's needed.
### Leave the test suite better than you found it
Consider how the specs you are adding fit into the spec-file as a whole. Is this the right place for your spec? Does the spec need to be reorganized now that you're adding this extra dimension? Specs are only as useful as the next person's ability to understand them.
### Solve today's problem
Avoid adding flexibility that isn't needed *today*. Nothing is ever set in stone, and we can always go back and add flexibility later. Adding it early just means we have to pay for complexity that we might not end up using.
### Favor clarity over brevity or cleverness.
Three lines that someone else can read are better than one line that's tricky.
### Don't be defensive
Only catch exceptions that are truly exceptional. Assume that components we control will honor their contracts. If they don't, the solution is to find and fix the problem in code rather than cluttering the code with attempts to foresee all potential issues at runtime.
### Don't be afraid to add classes and methods
Code rarely suffers from too many methods and classes, and often suffers from too few. Err on the side of numerous short, well-named methods. Pull out classes with well-defined roles.
### Rip shit out
Don't be afraid to delete code. Don't be afraid to rewrite something that needs to be refreshed. If it's in version control, we can always resurrect it.
### Maintain a consistent level of abstraction
Every line in a method should read at the same basic level of abstraction. If there's a section of a method that goes into a lot more detail than the rest of the method, consider extracting a new method and giving it a clear name.
* Set parameter defaults without spaces around the equal sign
* `clear = (count=1) ->` instead of `clear = (count = 1) ->`
+13
Ver Arquivo
@@ -0,0 +1,13 @@
Copyright 2013 GitHub Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+7 -16
Ver Arquivo
@@ -1,26 +1,17 @@
# Atom — Futuristic Text Editing
# Atom — The hackable, ~~collaborative~~ editor
![atom](https://s3.amazonaws.com/speakeasy/apps/icons/27/medium/7db16e44-ba57-11e2-8c6f-981faf658e00.png)
![Atom](http://i.imgur.com/OrTvUAD.png)
Check out our [guides](https://atom-docs.githubapp.com/v26.0/index.html) and [API documentation](https://atom-docs.githubapp.com/v26.0/api/index.html).
Check out our [guides and API documentation](https://www.atom.io/docs/latest/).
## Installing
Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27).
Download the latest [Atom release](https://github.com/atom/atom/releases/latest).
It will automatically update when a new release is available.
Atom will automatically update when a new release is available.
## Building
### Requirements
Follow the instructions in the [build docs][building].
* Mountain Lion
* Boxen (Obviously Atom won't release with this requirement)
### Installation
1. `gh-setup atom`
2. `cd ~/github/atom`
3. `script/build`
[building]: https://github.com/atom/atom/blob/master/docs/building-atom.md
-14
Ver Arquivo
@@ -1,14 +0,0 @@
{
'targets': [
{
'target_name': 'Atom',
'type': 'none',
'postbuilds': [
{
'postbuild_name': 'Create Atom, basically do everything',
'action': ['script/constructicon/build'],
},
],
},
],
}
+7 -8
Ver Arquivo
@@ -3,7 +3,6 @@ require '../spec/spec-helper'
path = require 'path'
{$, _, Point, fs} = require 'atom'
Project = require '../src/project'
fsUtils = require '../src/fs-utils'
TokenizedBuffer = require '../src/tokenized-buffer'
defaultCount = 100
@@ -74,8 +73,8 @@ window.clickEvent = (properties={}) ->
window.mouseEvent = (type, properties) ->
if properties.point
{point, editor} = properties
{top, left} = @pagePixelPositionForPoint(editor, point)
{point, editorView} = properties
{top, left} = @pagePixelPositionForPoint(editorView, point)
properties.pageX = left + 1
properties.pageY = top + 1
properties.originalEvent ?= {detail: 1}
@@ -87,14 +86,14 @@ window.mousedownEvent = (properties={}) ->
window.mousemoveEvent = (properties={}) ->
window.mouseEvent('mousemove', properties)
window.pagePixelPositionForPoint = (editor, point) ->
window.pagePixelPositionForPoint = (editorView, point) ->
point = Point.fromObject point
top = editor.lines.offset().top + point.row * editor.lineHeight
left = editor.lines.offset().left + point.column * editor.charWidth - editor.lines.scrollLeft()
top = editorView.lines.offset().top + point.row * editorView.lineHeight
left = editorView.lines.offset().left + point.column * editorView.charWidth - editorView.lines.scrollLeft()
{ top, left }
window.setEditorWidthInChars = (editor, widthInChars, charWidth=editor.charWidth) ->
editor.width(charWidth * widthInChars + editor.lines.position().left)
window.seteditorViewWidthInChars = (editorView, widthInChars, charWidth=editorView.charWidth) ->
editorView.width(charWidth * widthInChars + editorView.lines.position().left)
$.fn.resultOfTrigger = (type) ->
event = $.Event(type)
+77 -77
Ver Arquivo
@@ -1,30 +1,30 @@
require './benchmark-helper'
{$, _, RootView} = require 'atom'
{$, _, WorkspaceView} = require 'atom'
TokenizedBuffer = require '../src/tokenized-buffer'
describe "editor.", ->
editor = null
describe "editorView.", ->
editorView = null
beforeEach ->
window.rootViewParentSelector = '#jasmine-content'
window.rootView = new RootView
window.rootView.attachToDom()
atom.workspaceViewParentSelector = '#jasmine-content'
atom.workspaceView = new WorkspaceView
atom.workspaceView.attachToDom()
rootView.width(1024)
rootView.height(768)
rootView.openSync() # open blank editor
editor = rootView.getActiveView()
atom.workspaceView.width(1024)
atom.workspaceView.height(768)
atom.workspaceView.openSync()
editorView = atom.workspaceView.getActiveView()
afterEach ->
if editor.pendingDisplayUpdate
if editorView.pendingDisplayUpdate
waitsFor "editor to finish rendering", (done) ->
editor.on 'editor:display-updated', done
editorView.on 'editor:display-updated', done
describe "keymap.", ->
event = null
beforeEach ->
event = keydownEvent('x', target: editor.hiddenInput[0])
event = keydownEvent('x', target: editorView.hiddenInput[0])
benchmark "keydown-event-with-no-binding", 10, ->
keymap.handleKeyEvent(event)
@@ -35,90 +35,90 @@ describe "editor.", ->
describe "empty-file.", ->
benchmark "insert-delete", ->
editor.insertText('x')
editor.backspace()
editorView.insertText('x')
editorView.backspace()
describe "300-line-file.", ->
beforeEach ->
rootView.openSync('medium.coffee')
atom.workspaceView.openSync('medium.coffee')
describe "at-begining.", ->
benchmark "insert-delete", ->
editor.insertText('x')
editor.backspace()
editorView.insertText('x')
editorView.backspace()
benchmark "insert-delete-rehighlight", ->
editor.insertText('"')
editor.backspace()
editorView.insertText('"')
editorView.backspace()
describe "at-end.", ->
beforeEach ->
editor.moveCursorToBottom()
editorView.moveCursorToBottom()
benchmark "insert-delete", ->
editor.insertText('"')
editor.backspace()
editorView.insertText('"')
editorView.backspace()
describe "empty-vs-set-innerHTML.", ->
[firstRow, lastRow] = []
beforeEach ->
firstRow = editor.getFirstVisibleScreenRow()
lastRow = editor.getLastVisibleScreenRow()
firstRow = editorView.getFirstVisibleScreenRow()
lastRow = editorView.getLastVisibleScreenRow()
benchmark "build-gutter-html.", 1000, ->
editor.gutter.renderLineNumbers(null, firstRow, lastRow)
editorView.gutter.renderLineNumbers(null, firstRow, lastRow)
benchmark "set-innerHTML.", 1000, ->
editor.gutter.renderLineNumbers(null, firstRow, lastRow)
editor.gutter.lineNumbers[0].innerHtml = ''
editorView.gutter.renderLineNumbers(null, firstRow, lastRow)
editorView.gutter.lineNumbers[0].innerHtml = ''
benchmark "empty.", 1000, ->
editor.gutter.renderLineNumbers(null, firstRow, lastRow)
editor.gutter.lineNumbers.empty()
editorView.gutter.renderLineNumbers(null, firstRow, lastRow)
editorView.gutter.lineNumbers.empty()
describe "positionLeftForLineAndColumn.", ->
line = null
beforeEach ->
editor.scrollTop(2000)
editor.resetDisplay()
line = editor.lineElementForScreenRow(106)[0]
editorView.scrollTop(2000)
editorView.resetDisplay()
line = editorView.lineElementForScreenRow(106)[0]
describe "one-line.", ->
beforeEach ->
editor.clearCharacterWidthCache()
editorView.clearCharacterWidthCache()
benchmark "uncached", 5000, ->
editor.positionLeftForLineAndColumn(line, 106, 82)
editor.clearCharacterWidthCache()
editorView.positionLeftForLineAndColumn(line, 106, 82)
editorView.clearCharacterWidthCache()
benchmark "cached", 5000, ->
editor.positionLeftForLineAndColumn(line, 106, 82)
editorView.positionLeftForLineAndColumn(line, 106, 82)
describe "multiple-lines.", ->
[firstRow, lastRow] = []
beforeEach ->
firstRow = editor.getFirstVisibleScreenRow()
lastRow = editor.getLastVisibleScreenRow()
firstRow = editorView.getFirstVisibleScreenRow()
lastRow = editorView.getLastVisibleScreenRow()
benchmark "cache-entire-visible-area", 100, ->
for i in [firstRow..lastRow]
line = editor.lineElementForScreenRow(i)[0]
editor.positionLeftForLineAndColumn(line, i, Math.max(0, editor.lineLengthForBufferRow(i)))
line = editorView.lineElementForScreenRow(i)[0]
editorView.positionLeftForLineAndColumn(line, i, Math.max(0, editorView.lineLengthForBufferRow(i)))
describe "text-rendering.", ->
beforeEach ->
editor.scrollTop(2000)
editorView.scrollTop(2000)
benchmark "resetDisplay", 50, ->
editor.resetDisplay()
editorView.resetDisplay()
benchmark "htmlForScreenRows", 1000, ->
lastRow = editor.getLastScreenRow()
editor.htmlForScreenRows(0, lastRow)
lastRow = editorView.getLastScreenRow()
editorView.htmlForScreenRows(0, lastRow)
benchmark "htmlForScreenRows.htmlParsing", 50, ->
lastRow = editor.getLastScreenRow()
html = editor.htmlForScreenRows(0, lastRow)
lastRow = editorView.getLastScreenRow()
html = editorView.htmlForScreenRows(0, lastRow)
div = document.createElement('div')
div.innerHTML = html
@@ -126,44 +126,44 @@ describe "editor.", ->
describe "gutter-api.", ->
describe "getLineNumberElementsForClass.", ->
beforeEach ->
editor.gutter.addClassToLine(20, 'omgwow')
editor.gutter.addClassToLine(40, 'omgwow')
editorView.gutter.addClassToLine(20, 'omgwow')
editorView.gutter.addClassToLine(40, 'omgwow')
benchmark "DOM", 20000, ->
editor.gutter.getLineNumberElementsForClass('omgwow')
editorView.gutter.getLineNumberElementsForClass('omgwow')
benchmark "getLineNumberElement.DOM", 20000, ->
editor.gutter.getLineNumberElement(12)
editorView.gutter.getLineNumberElement(12)
benchmark "toggle-class", 2000, ->
editor.gutter.addClassToLine(40, 'omgwow')
editor.gutter.removeClassFromLine(40, 'omgwow')
editorView.gutter.addClassToLine(40, 'omgwow')
editorView.gutter.removeClassFromLine(40, 'omgwow')
describe "find-then-unset.", ->
classes = ['one', 'two', 'three', 'four']
benchmark "single-class", 200, ->
editor.gutter.addClassToLine(30, 'omgwow')
editor.gutter.addClassToLine(40, 'omgwow')
editor.gutter.removeClassFromAllLines('omgwow')
editorView.gutter.addClassToLine(30, 'omgwow')
editorView.gutter.addClassToLine(40, 'omgwow')
editorView.gutter.removeClassFromAllLines('omgwow')
benchmark "multiple-class", 200, ->
editor.gutter.addClassToLine(30, 'one')
editor.gutter.addClassToLine(30, 'two')
editorView.gutter.addClassToLine(30, 'one')
editorView.gutter.addClassToLine(30, 'two')
editor.gutter.addClassToLine(40, 'two')
editor.gutter.addClassToLine(40, 'three')
editor.gutter.addClassToLine(40, 'four')
editorView.gutter.addClassToLine(40, 'two')
editorView.gutter.addClassToLine(40, 'three')
editorView.gutter.addClassToLine(40, 'four')
for klass in classes
editor.gutter.removeClassFromAllLines(klass)
editorView.gutter.removeClassFromAllLines(klass)
describe "line-htmlification.", ->
div = null
html = null
beforeEach ->
lastRow = editor.getLastScreenRow()
html = editor.htmlForScreenRows(0, lastRow)
lastRow = editorView.getLastScreenRow()
html = editorView.htmlForScreenRows(0, lastRow)
div = document.createElement('div')
benchmark "setInnerHTML", 1, ->
@@ -171,47 +171,47 @@ describe "editor.", ->
describe "9000-line-file.", ->
benchmark "opening.", 5, ->
rootView.openSync('huge.js')
atom.workspaceView.openSync('huge.js')
describe "after-opening.", ->
beforeEach ->
rootView.openSync('huge.js')
atom.workspaceView.openSync('huge.js')
benchmark "moving-to-eof.", 1, ->
editor.moveCursorToBottom()
editorView.moveCursorToBottom()
describe "on-first-line.", ->
benchmark "inserting-newline", 5, ->
editor.insertNewline()
editorView.insertNewline()
describe "on-last-visible-line.", ->
beforeEach ->
editor.setCursorScreenPosition([editor.getLastVisibleScreenRow(), 0])
editorView.setCursorScreenPosition([editorView.getLastVisibleScreenRow(), 0])
benchmark "move-down-and-scroll", 300, ->
editor.trigger 'move-down'
editorView.trigger 'move-down'
describe "at-eof.", ->
endPosition = null
beforeEach ->
editor.moveCursorToBottom()
endPosition = editor.getCursorScreenPosition()
editorView.moveCursorToBottom()
endPosition = editorView.getCursorScreenPosition()
benchmark "move-to-beginning-of-word", ->
editor.moveCursorToBeginningOfWord()
editor.setCursorScreenPosition(endPosition)
editorView.moveCursorToBeginningOfWord()
editorView.setCursorScreenPosition(endPosition)
benchmark "insert", ->
editor.insertText('x')
editorView.insertText('x')
describe "TokenizedBuffer.", ->
describe "coffee-script-grammar.", ->
[languageMode, buffer] = []
beforeEach ->
editSession = benchmarkFixturesProject.openSync('medium.coffee')
{ languageMode, buffer } = editSession
editor = benchmarkFixturesProject.openSync('medium.coffee')
{ languageMode, buffer } = editor
benchmark "construction", 20, ->
new TokenizedBuffer(buffer, { languageMode, tabLength: 2})
+54 -21
Ver Arquivo
@@ -5,9 +5,36 @@ os = require 'os'
fm = require 'json-front-matter'
_ = require 'underscore-plus'
packageJson = require './package.json'
packageJson = require '../package.json'
# OAuth token for atom-bot
# TODO Remove once all repositories are public
process.env.ATOM_ACCESS_TOKEN ?= '362295be4c5258d3f7b967bbabae662a455ca2a7'
# Shim harmony collections in case grunt was invoked without harmony
# collections enabled
_.extend(global, require('harmony-collections')) unless global.WeakMap?
module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-lesslint')
grunt.loadNpmTasks('grunt-cson')
grunt.loadNpmTasks('grunt-contrib-csslint')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-download-atom-shell')
grunt.loadNpmTasks('grunt-peg')
grunt.loadTasks('tasks')
# This allows all subsequent paths to the relative to the root of the repo
grunt.file.setBase(path.resolve('..'))
if not grunt.option('verbose')
grunt.log.writeln = (args...) -> grunt.log
grunt.log.write = (args...) -> grunt.log
[major, minor, patch] = packageJson.version.split('.')
if process.platform is 'win32'
appName = 'Atom'
@@ -15,7 +42,9 @@ module.exports = (grunt) ->
installRoot = process.env.ProgramFiles
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
contentsDir = shellAppDir
appDir = path.join(shellAppDir, 'resources', 'app')
atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells')
else
appName = 'Atom.app'
tmpDir = '/tmp'
@@ -24,6 +53,7 @@ module.exports = (grunt) ->
shellAppDir = path.join(buildDir, appName)
contentsDir = path.join(shellAppDir, 'Contents')
appDir = path.join(contentsDir, 'Resources', 'app')
atomShellDownloadDir = '/tmp/atom-cached-atom-shells'
installDir = path.join(installRoot, appName)
@@ -73,6 +103,13 @@ module.exports = (grunt) ->
dest: appDir
ext: '.json'
pegConfig =
glob_to_multiple:
expand: true
src: ['src/**/*.pegjs']
dest: appDir
ext: '.js'
for child in fs.readdirSync('node_modules') when child isnt '.bin'
directory = path.join('node_modules', child)
{engines, theme} = grunt.file.readJSON(path.join(directory, 'package.json'))
@@ -81,6 +118,7 @@ module.exports = (grunt) ->
lessConfig.glob_to_multiple.src.push("#{directory}/**/*.less")
prebuildLessConfig.src.push("#{directory}/**/*.less") unless theme
csonConfig.glob_to_multiple.src.push("#{directory}/**/*.cson")
pegConfig.glob_to_multiple.src.push("#{directory}/**/*.pegjs")
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
@@ -95,6 +133,8 @@ module.exports = (grunt) ->
cson: csonConfig
peg: pegConfig
coffeelint:
options:
no_empty_param_list:
@@ -107,8 +147,10 @@ module.exports = (grunt) ->
'dot-atom/**/*.coffee'
'exports/**/*.coffee'
'src/**/*.coffee'
'tasks/**/*.coffee'
'Gruntfile.coffee'
]
build: [
'build/tasks/**/*.coffee'
'build/Gruntfile.coffee'
]
test: [
'spec/*.coffee'
@@ -164,6 +206,12 @@ module.exports = (grunt) ->
_.extend(context, parsed.attributes)
parsed.body
'download-atom-shell':
version: packageJson.atomShellVersion
outputDir: 'atom-shell'
downloadDir: atomShellDownloadDir
rebuild: true # rebuild native modules after atom-shell is updated
shell:
'kill-atom':
command: 'pkill -9 Atom'
@@ -172,24 +220,9 @@ module.exports = (grunt) ->
stderr: false
failOnError: false
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-lesslint')
grunt.loadNpmTasks('grunt-cson')
grunt.loadNpmTasks('grunt-contrib-csslint')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-shell')
grunt.loadTasks('tasks')
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson'])
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson', 'peg'])
grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint'])
grunt.registerTask('test', ['shell:kill-atom', 'run-specs'])
grunt.registerTask('ci', ['update-atom-shell', 'build', 'set-development-version', 'lint', 'test'])
grunt.registerTask('deploy', ['partial-clean', 'update-atom-shell', 'build', 'codesign'])
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-version', 'lint', 'test', 'codesign', 'publish-build'])
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
defaultTasks = ['update-atom-shell', 'build']
defaultTasks.push('set-development-version') if process.platform is 'darwin'
defaultTasks.push('install')
grunt.registerTask('default', defaultTasks)
grunt.registerTask('default', ['download-atom-shell', 'build', 'set-version', 'install'])
+10
Ver Arquivo
@@ -0,0 +1,10 @@
# Atom Build
This folder contains the grunt configuration and tasks to build Atom.
It was moved from the root of the repository so that any native modules used
would be compiled against node's v8 headers since anything stored in
`node_modules` at the root of the repo is compiled against atom's v8 headers.
New build dependencies should be added to the `package.json` file located in
this folder.
+34
Ver Arquivo
@@ -0,0 +1,34 @@
{
"name": "atom-build",
"description": "Atom build",
"repository": {
"type": "git",
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"biscotto": "0.0.17",
"first-mate": "~0.10.0",
"formidable": "~1.0.14",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git://github.com/atom/grunt-coffeelint.git",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.5.0",
"grunt-download-atom-shell": "git+https://atom-bot:362295be4c5258d3f7b967bbabae662a455ca2a7@github.com/atom/grunt-download-atom-shell#v0.5.0",
"grunt-lesslint": "0.13.0",
"grunt-markdown": "~0.4.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"js-yaml": "~2.1.0",
"json-front-matter": "~0.1.3",
"rcedit": "~0.1.2",
"request": "~2.27.0",
"rimraf": "~2.2.2",
"unzip": "~0.1.9",
"walkdir": "0.0.7",
"grunt-peg": "~1.1.0"
}
}
@@ -21,12 +21,14 @@ module.exports = (grunt) ->
cp 'atom.sh', path.join(appDir, 'atom.sh')
cp 'package.json', path.join(appDir, 'package.json')
cp 'apm', path.join(appDir, 'apm')
packageDirectories = []
nonPackageDirectories = [
'benchmark'
'dot-atom'
'vendor'
'resources'
]
{devDependencies} = grunt.file.readJSON('package.json')
@@ -41,6 +43,8 @@ module.exports = (grunt) ->
path.join('git-utils', 'deps')
path.join('oniguruma', 'deps')
path.join('vendor', 'apm')
path.join('resources', 'mac')
path.join('resources', 'win')
]
ignoredPaths = ignoredPaths.map (ignoredPath) -> "(#{ignoredPath})"
nodeModulesFilter = new RegExp(ignoredPaths.join('|'))
@@ -60,4 +64,5 @@ module.exports = (grunt) ->
dependencies = ['compile']
dependencies.push('copy-info-plist') if process.platform is 'darwin'
dependencies.push('set-exe-icon') if process.platform is 'win32'
grunt.task.run(dependencies...)
+25
Ver Arquivo
@@ -0,0 +1,25 @@
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'codesign', 'Codesign the app', ->
done = @async()
if process.env.XCODE_KEYCHAIN
unlockKeychain (error) ->
if error?
done(error)
else
signApp(done)
else
signApp(done)
unlockKeychain = (callback) ->
cmd = 'security'
{XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN} = process.env
args = ['unlock-keychain', '-p', XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN]
spawn {cmd, args}, (error) -> callback(error)
signApp = (callback) ->
cmd = 'codesign'
args = ['-f', '-v', '-s', 'Developer ID Application: GitHub', grunt.config.get('atom.shellAppDir')]
spawn {cmd, args}, (error) -> callback(error)
@@ -1,7 +1,7 @@
path = require 'path'
_ = require 'underscore-plus'
plist = require 'plist'
fs = require 'fs-plus'
{ScopeSelector} = require 'first-mate'
module.exports = (grunt) ->
@@ -27,7 +27,7 @@ class TextMateTheme
@buildRulesets()
buildRulesets: ->
{settings} = plist.parseFileSync(@path)
{settings} = fs.readPlistSync(@path)
@buildGlobalSettingsRulesets(settings[0])
@buildScopeSelectorRulesets(settings[1..])
@@ -1,16 +1,15 @@
path = require 'path'
fs = require 'fs'
module.exports = (grunt) ->
cmd = path.join('node_modules', '.bin', 'coffee')
commonArgs = [path.join('node_modules', '.bin', 'biscotto'), '--']
commonArgs = [path.join('build', 'node_modules', '.bin', 'biscotto'), '--']
opts =
stdio: 'inherit'
grunt.registerTask 'build-docs', 'Builds the API docs in src/app', ->
grunt.task.run('markdown:guides')
done = @async()
args = [commonArgs..., '--title', 'Atom API Documentation', '-o', 'docs/output/api', 'src/', 'vendor/telepath/lib/range.coffee', 'vendor/telepath/lib/point.coffee']
args = [commonArgs..., '--title', 'Atom API Documentation', '-o', 'docs/output/api', 'src/', '../text-buffer/src/range.coffee', '../text-buffer/src/point.coffee', '../text-buffer/src/marker.coffee']
grunt.util.spawn({cmd, args, opts}, done)
grunt.registerTask 'lint-docs', 'Generate stats about the doc coverage', ->
@@ -33,17 +32,22 @@ module.exports = (grunt) ->
if error?
callback(error)
else
callback(null, String(result).trim().split('.')[0..1].join('.'))
callback(null, String(result).trim())
copyDocs = (tag, callback) ->
cmd = 'cp'
args = ['-r', 'docs/output/', "../atom-docs/public/#{tag}/"]
args = ['-r', 'docs/output/', "../atom.io/public/docs/api/#{tag}/"]
grunt.util.spawn {cmd, args}, (error, result) ->
if error?
callback(error)
fs.exists "../atom.io/public/docs/api/", (exists) ->
if exists
grunt.util.spawn {cmd, args}, (error, result) ->
if error?
callback(error)
else
callback(null, tag)
else
callback(null, tag)
grunt.log.error "../atom.io/public/docs/api/ doesn't exist"
return false
grunt.util.async.waterfall [fetchTag, copyDocs], done
+25
Ver Arquivo
@@ -0,0 +1,25 @@
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'output-disk-space', 'Print diskspace available', ->
return unless process.platform is 'darwin'
done = @async()
cmd = 'df'
args = ['-Hl']
spawn {cmd, args}, (error, result, code) ->
return done(error) if error?
lines = result.stdout.split("\n")
for line in lines[1..]
[filesystem, size, used, avail, capacity, extra] = line.split(/\s+/)
capacity = parseInt(capacity)
if capacity > 90
grunt.log.error("#{filesystem} is at #{capacity}% capacity!")
else if capacity > 80
grunt.log.ok("#{filesystem} is at #{capacity}% capacity.")
done()
@@ -30,16 +30,16 @@ module.exports = (grunt) ->
themeMains.push(mainPath) if grunt.file.isFile(mainPath)
importPaths.unshift(stylesheetsDir) if grunt.file.isDir(stylesheetsDir)
grunt.log.writeln("Building LESS cache for #{configuration.join(', ').yellow}")
grunt.verbose.writeln("Building LESS cache for #{configuration.join(', ').yellow}")
lessCache = new LessCache
cacheDir: directory
resourcePath: path.resolve('.')
importPaths: importPaths
for file in @filesSrc
grunt.log.writeln("File #{file.cyan} created in cache.")
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
for file in themeMains
grunt.log.writeln("File #{file.cyan} created in cache.")
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
+172
Ver Arquivo
@@ -0,0 +1,172 @@
child_process = require 'child_process'
path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
grunt = null
maxReleases = 10
assetName = 'atom-mac.zip'
assetPath = "/tmp/atom-build/#{assetName}"
commitSha = process.env.JANKY_SHA1
token = process.env.ATOM_ACCESS_TOKEN
defaultHeaders =
Authorization: "token #{token}"
'User-Agent': 'Atom'
module.exports = (gruntObject) ->
grunt = gruntObject
grunt.registerTask 'publish-build', 'Publish the built app', ->
return unless process.platform is 'darwin'
return if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH isnt 'master'
done = @async()
createBuildRelease (error, release) ->
return done(error) if error?
zipApp (error) ->
return done(error) if error?
uploadAsset release, (error) ->
return done(error) if error?
publishRelease release, (error) ->
return done(error) if error?
getAtomDraftRelease (error, release) ->
return done(error) if error?
deleteExistingAsset release, (error) ->
return done(error) if error?
uploadAsset(release, done)
logError = (message, error, details) ->
grunt.log.error(message)
grunt.log.error(error.message ? error) if error?
grunt.log.error(details) if details
zipApp = (callback) ->
fs.removeSync(assetPath)
options = {cwd: path.dirname(assetPath), maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{assetName} Atom.app", options, (error, stdout, stderr) ->
if error?
logError('Zipping Atom.app failed', error, stderr)
callback(error)
getRelease = (callback) ->
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'GET'
headers: defaultHeaders
json: true
request options, (error, response, releases=[]) ->
if error? or response.statusCode isnt 200
logError('Fetching releases failed', error, releases)
callback(error ? new Error(response.statusCode))
else
if releases.length > maxReleases
deleteRelease(release) for release in releases[maxReleases..]
for release in releases when release.name is commitSha
callback(null, release)
return
callback()
getAtomDraftRelease = (callback) ->
atomRepo = new GitHub({repo: 'atom/atom', token})
atomRepo.getReleases (error, releases=[]) ->
if error?
logError('Fetching atom/atom releases failed', error, releases)
callback(error)
else
for release in releases when release.draft
callback(null, release)
return
callback(new Error('No draft release in atom/atom repo'))
deleteRelease = (release) ->
options =
uri: release.url
method: 'DELETE'
headers: defaultHeaders
json: true
request options, (error, response, body='') ->
if error? or response.statusCode isnt 204
logError('Deleting release failed', error, body)
deleteExistingAsset = (release, callback) ->
for asset in release.assets when asset.name is assetName
options =
uri: asset.url
method: 'DELETE'
headers: defaultHeaders
request options, (error, response, body='') ->
if error? or response.statusCode isnt 204
logError('Deleting existing release asset failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback()
return
callback()
createBuildRelease = (callback) ->
getRelease (error, release) ->
if error?
callback(error)
return
if release?
deleteExistingAsset release, (error) ->
callback(error, release)
return
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'POST'
headers: defaultHeaders
json:
tag_name: "v#{commitSha}"
target_commitish: 'master'
name: commitSha
body: "Build of [atom@#{commitSha.substring(0, 7)}](https://github.com/atom/atom/commits/#{commitSha})"
draft: true
prerelease: true
request options, (error, response, release={}) ->
if error? or response.statusCode isnt 201
logError('Creating release failed', error, release)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
uploadAsset = (release, callback) ->
options =
uri: release.upload_url.replace(/\{.*$/, "?name=#{assetName}")
method: 'POST'
headers: _.extend({
'Content-Type': 'application/zip'
'Content-Length': fs.getSizeSync(assetPath)
}, defaultHeaders)
assetRequest = request options, (error, response, body='') ->
if error? or response.statusCode >= 400
logError('Upload release asset failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
fs.createReadStream(assetPath).pipe(assetRequest)
publishRelease = (release, callback) ->
options =
uri: release.url
method: 'POST'
headers: defaultHeaders
json:
draft: false
request options, (error, response, body={}) ->
if error? or response.statusCode isnt 200
logError('Creating release failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback()
@@ -84,7 +84,7 @@ module.exports = (grunt) ->
for name, version of packageDependencies
do (name, version) ->
tasks.push (callback) ->
grunt.log.writeln("Publishing #{name}@#{version}")
grunt.verbose.writeln("Publishing #{name}@#{version}")
tag = "v#{version}"
packageExists name, token, (error, exists) ->
if error?
+12
Ver Arquivo
@@ -0,0 +1,12 @@
path = require 'path'
module.exports = (grunt) ->
grunt.registerTask 'set-exe-icon', 'Set icon of the exe', ->
done = @async()
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
iconPath = path.resolve('resources', 'win', 'atom.ico')
rcedit = require('rcedit')
rcedit(shellExePath, {'icon': iconPath}, done)
+50
Ver Arquivo
@@ -0,0 +1,50 @@
fs = require 'fs'
path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
getVersion = (callback) ->
if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master'
{version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
callback(null, version)
else
cmd = 'git'
args = ['rev-parse', '--short', 'HEAD']
spawn {cmd, args}, (error, {stdout}={}, code) ->
callback(error, stdout?.trim?())
grunt.registerTask 'set-version', 'Set the version in the plist and package.json', ->
done = @async()
getVersion (error, version) ->
if error?
done(error)
return
appDir = grunt.config.get('atom.appDir')
# Replace version field of package.json.
packageJsonPath = path.join(appDir, 'package.json')
packageJson = require(packageJsonPath)
packageJson.version = version
packageJsonString = JSON.stringify(packageJson, null, 2)
fs.writeFileSync(packageJsonPath, packageJsonString)
if process.platform is 'darwin'
cmd = 'script/set-version'
args = [grunt.config.get('atom.buildDir'), version]
spawn {cmd, args}, (error, result, code) -> done(error)
else if process.platform is 'win32'
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
strings =
CompanyName: 'GitHub, Inc.'
FileDescription: 'The hackable, collaborative editor of tomorrow!'
LegalCopyright: 'Copyright (C) 2013 GitHub, Inc. All rights reserved'
ProductName: 'Atom'
ProductVersion: version
rcedit = require('rcedit')
rcedit(shellExePath, {'version-string': strings}, done)
+112
Ver Arquivo
@@ -0,0 +1,112 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
async = require 'async'
module.exports = (grunt) ->
{isAtomPackage, spawn} = require('./task-helpers')(grunt)
packageSpecQueue = null
runPackageSpecs = (callback) ->
failedPackages = []
rootDir = grunt.config.get('atom.shellAppDir')
contentsDir = grunt.config.get('atom.contentsDir')
resourcePath = process.cwd()
if process.platform is 'darwin'
appPath = path.join(contentsDir, 'MacOS', 'Atom')
else if process.platform is 'win32'
appPath = path.join(contentsDir, 'atom.exe')
packageSpecQueue = async.queue (packagePath, callback) ->
if process.platform is 'darwin'
options =
cmd: appPath
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{path.join(packagePath, 'spec')}"]
opts:
cwd: packagePath
env: _.extend({}, process.env, ATOM_PATH: rootDir)
else if process.platform is 'win32'
options =
cmd: process.env.comspec
args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", "--spec-directory=#{path.join(packagePath, 'spec')}", "--log-file=ci.log"]
opts:
cwd: packagePath
env: _.extend({}, process.env, ATOM_PATH: rootDir)
grunt.verbose.writeln "Launching #{path.basename(packagePath)} specs."
spawn options, (error, results, code) ->
if process.platform is 'win32'
process.stderr.write(fs.readFileSync(path.join(packagePath, 'ci.log')))
fs.unlinkSync(path.join(packagePath, 'ci.log'))
failedPackages.push path.basename(packagePath) if error
callback()
modulesDirectory = path.resolve('node_modules')
for packageDirectory in fs.readdirSync(modulesDirectory)
packagePath = path.join(modulesDirectory, packageDirectory)
continue unless grunt.file.isDir(path.join(packagePath, 'spec'))
continue unless isAtomPackage(packagePath)
packageSpecQueue.push(packagePath)
# TODO: Restore concurrency on Windows
packageSpecQueue.concurrency = 1 unless process.platform is 'win32'
packageSpecQueue.drain = -> callback(null, failedPackages)
runCoreSpecs = (callback) ->
contentsDir = grunt.config.get('atom.contentsDir')
if process.platform is 'darwin'
appPath = path.join(contentsDir, 'MacOS', 'Atom')
else if process.platform is 'win32'
appPath = path.join(contentsDir, 'atom.exe')
resourcePath = process.cwd()
coreSpecsPath = path.resolve('spec')
if process.platform is 'darwin'
options =
cmd: appPath
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"]
else if process.platform is 'win32'
options =
cmd: process.env.comspec
args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}", "--log-file=ci.log"]
spawn options, (error, results, code) ->
if process.platform is 'win32'
process.stderr.write(fs.readFileSync('ci.log'))
fs.unlinkSync('ci.log')
else
# TODO: Restore concurrency on Windows
packageSpecQueue.concurrency = 2
callback(null, error)
grunt.registerTask 'run-specs', 'Run the specs', ->
done = @async()
startTime = Date.now()
# TODO: This should really be parallel on both platforms, however our
# fixtures step on each others toes currently.
if process.platform is 'darwin'
method = async.parallel
else if process.platform is 'win32'
method = async.series
method [runCoreSpecs, runPackageSpecs], (error, results) ->
[coreSpecFailed, failedPackages] = results
elapsedTime = Math.round((Date.now() - startTime) / 100) / 10
grunt.verbose.writeln("Total spec time: #{elapsedTime}s")
failures = failedPackages
failures.push "atom core" if coreSpecFailed
grunt.log.error("[Error]".red + " #{failures.join(', ')} spec(s) failed") if failures.length > 0
# TODO: Mark the build as green on Windows until specs pass.
if process.platform is 'darwin'
done(!coreSpecFailed and failedPackages.length == 0)
else if process.platform is 'win32'
done(true)
@@ -23,7 +23,7 @@ module.exports = (grunt) ->
catch error
grunt.fatal(error)
grunt.log.writeln("Copied #{source.cyan} to #{destination.cyan}.")
grunt.verbose.writeln("Copied #{source.cyan} to #{destination.cyan}.")
mkdir: (args...) ->
grunt.file.mkdir(args...)
@@ -32,9 +32,18 @@ module.exports = (grunt) ->
grunt.file.delete(args..., force: true) if grunt.file.exists(args...)
spawn: (options, callback) ->
grunt.util.spawn options, (error, results, code) ->
grunt.log.errorlns results.stderr if results.stderr
callback(error, results, code)
childProcess = require 'child_process'
stdout = []
stderr = []
error = null
proc = childProcess.spawn(options.cmd, options.args, options.opts)
proc.stdout.on 'data', (data) -> stdout.push(data.toString())
proc.stderr.on 'data', (data) -> stderr.push(data.toString())
proc.on 'close', (exitCode, signal) ->
error = new Error(signal) if exitCode != 0
results = {stderr: stderr.join(''), stdout: stdout.join(''), code: exitCode}
grunt.log.error results.stderr if exitCode != 0
callback(error, results, exitCode)
isAtomPackage: (packagePath) ->
try
+34
Ver Arquivo
@@ -0,0 +1,34 @@
## Building Atom
These guide is meant only for users who wish to help develop atom core,
if you're just interested in using atom you should just [download
atom][download].
## OSX
* Use OS X 10.8 or later
* Install the latest node 0.10.x release (32bit preferable)
* Clone [atom][atom-git] to `~/github/atom`
* Run `~/github/atom/script/build`
## Windows
* Install [Visual C++ 2010 Express][win-vs2010]
* Install the [latest 32bit Node 0.10.x][win-node]
* Install the [latest Python 2.7.x][win-python]
* Install [GitHub for Windows][win-github]
* Clone [atom/atom][atom-git] to `C:\Users\<user>\github\atom\`
* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\<user>\github\atom\node_modules\`
to your PATH
* Set ATOM_ACCESS_TOKEN to your oauth2 credentials (run `security -q
find-generic-password -ws 'GitHub API Token'` on OSX to get your
credentials).
* Use the Windows GitHub shell and cd into `C:\Users\<user>\github\atom`
* Run `script\bootstrap`
[download]: https://github.com/atom/atom/releases/latest
[win-node]: http://nodejs.org/download/
[win-python]: http://www.python.org/download/
[win-github]: http://windows.github.com/
[win-vs2010]: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
[atom-git]: https://github.com/atom/atom/
+61 -295
Ver Arquivo
@@ -1,12 +1,11 @@
# Authoring Packages
# Creating Packages
Packages are at the core of Atom. Nearly everything outside of the main editor
is handled by a package. That includes "core" pieces like the file tree, status
bar and more.
is handled by a package. That includes "core" pieces like the [file tree][file-tree],
[status bar][status-bar], [syntax highlighting][cs-syntax], and more.
A package can contain a variety of different resource types to change Atom's
behavior. The basic package layout is as follows (though not every package will
have all of these directories):
behavior. The basic package layout is as follows:
```text
my-package/
@@ -21,9 +20,13 @@ my-package/
package.json
```
Not every package will have (or need) all of these directories.
We have [a tutorial on creating your first package][first-package].
## package.json
Similar to [npm packages][npm], Atom packages can contain a _package.json_ file
Similar to [npm packages][npm], Atom packages contain a _package.json_ file
in their top-level directory. This file contains metadata about the package,
such as the path to its "main" module, library dependencies, and manifests
specifying the order in which its resources should be loaded.
@@ -64,11 +67,11 @@ object.
Your package's top-level module should implement the following methods:
- `activate(rootView, state)`: This **required** method is called when your
package is loaded. It is always passed the window's global `rootView`, and is
sometimes passed state data if the window has been reloaded and your module
implements the `serialize` method. Use this to do initialization work when your
package is started (like setting up DOM elements or binding events).
- `activate(state)`: This **required** method is called when your
package is activated. It is passed the state data from the last time the window
was serialized if your module implements the `serialize()` method. Use this to
do initialization work when your package is started (like setting up DOM
elements or binding events).
- `serialize()`: This **optional** method is called when the window is shutting
down, allowing you to return JSON to represent the state of your component. When
@@ -83,23 +86,25 @@ you don't need to worry because that's getting torn down anyway.
### Simple Package Code
Your directory would look like this:
```text
my-package/
package.json # optional
package.json
index.coffee
lib/
my-package.coffee
```
`index.coffee`:
`index.coffee` might be:
```coffeescript
module.exports = require "./lib/my-package"
```
`my-package/my-package.coffee`:
`my-package/my-package.coffee` might start:
```coffeescript
module.exports =
activate: (rootView, state) -> # ...
activate: (state) -> # ...
deactivate: -> # ...
serialize: -> # ...
```
@@ -111,8 +116,6 @@ Also, please collaborate with us if you need an API that doesn't exist. Our goal
is to build out Atom's API organically based on the needs of package authors
like you.
Check out [wrap-guide] for a simple example of Atom's package API in action.
## Stylesheets
Stylesheets for your package should be placed in the _stylesheets_ directory.
@@ -120,14 +123,16 @@ Any stylesheets in this directory will be loaded and attached to the DOM when
your package is activated. Stylesheets can be written as CSS or [LESS] (but LESS
is recommended).
Ideally you will not need much in the way of styling. We've provided a standard
set of components. You can view all components by opening the styleguide: open
the command palette (`cmd-p`) and search for _styleguide_ or just
`cmd-ctrl-shift-g`.
Ideally, you won't need much in the way of styling. We've provided a standard
set of components which define both the colors and UI elements for any package
that fits into Atom seamlessly. You can view all of Atom's UI components by opening
the styleguide: open the command palette (`cmd-shift-P`) and search for _styleguide_,
or just type `cmd-ctrl-G`.
If you do need styling, we try to keep only structural styles in the package
stylesheets. Colors and sizing should be taken from the active theme's
[ui-variables.less][ui-variables]. If you follow this guideline, your package
If you _do_ need special styling, try to keep only structural styles in the package
stylesheets. If you _must_ specify colors and sizing, these should be taken from
the active theme's [ui-variables.less][ui-variables]. For more information, see the
[theme variables docs][theme-variables]. If you follow this guideline, your package
will look good out of the box with any theme!
An optional `stylesheets` array in your _package.json_ can list the stylesheets
@@ -136,18 +141,23 @@ alphabetically.
## Keymaps
It's recommended that you provide key bindings for commonly used actions for
your extension, especially if you're also adding a new command:
```coffeescript
'.tree-view-scroller':
'ctrl-V': 'changer:magic'
```
It's recommended that you provide key bindings for commonly used actions for
your extension, especially if you're also adding a new command.
Keymaps are placed in the _keymaps_ subdirectory. By default, all keymaps are
loaded in alphabetical order. An optional `keymaps` array in your _package.json_
can specify which keymaps to load and in what order.
Keybindings are executed by determining which element the keypress occured on. In
the example above, `changer:magic` command is executed when pressing `ctrl-V` on
the `.tree-view-scroller` element.
See the [main keymaps documentation][keymaps] for more detailed information on
how keymaps work.
@@ -159,6 +169,9 @@ specify which menus to load and in what order.
### Application Menu
It's recommended that you create an application menu item for common actions
with your package that aren't tied to a specific element:
```coffee-script
'menu': [
{
@@ -178,32 +191,28 @@ specify which menus to load and in what order.
]
```
It's recommended that you create an application menu item for common actions
with your package that aren't tied to a specific element.
To add your own item to the application menu simply create a top level `menu`
key in any menu configuration file in _menus_ (since the above is [CSON] it
should end with `.cson`)
To add your own item to the application menu, simply create a top level `menu`
key in any menu configuration file in _menus_. This can be a JSON or [CSON] file.
The menu templates you specify are merged with all other templates provided
by other packages in the order which they were loaded.
### Context Menu
It's recommended to specify a context menu item for commands that are linked to
specific parts of the interface, like adding a file in the tree-view:
```coffee-script
'context-menu':
'.tree-view':
'Add file': 'tree-view:add-file'
'#root-view':
'.workspace':
'Inspect Element': 'core:inspect'
```
It's recommended to specify a context menu item for commands that are linked to
specific parts of the interface, like adding a file in the tree-view.
To add your own item to the application menu simply create a top level
`context-menu` key in any menu configuration file in _menus_ (since the above is
[CSON] it should end with `.cson`)
`context-menu` key in any menu configuration file in _menus_. This can be a
JSON or [CSON] file.
Context menus are created by determining which element was selected and
then adding all of the menu items whose selectors match that element (in
@@ -216,7 +225,7 @@ or one of its parents has the `tree-view` class applied to it.
## Snippets
An extension can supply language snippets in the _snippets_ directory which
allows the user to enter repetitive text quickly.
allows the user to enter repetitive text quickly:
```coffeescript
".source.coffee .specs":
@@ -302,7 +311,7 @@ protocol URLs to load resources in the package.
The URLs should be in the format of
`atom://package-name/relative-path-to-package-of-resource`, for example, the
`atom://image-view/images/transparent-background.gif` would be equivablent to
`atom://image-view/images/transparent-background.gif` would be equivalent to
`~/.atom/packages/image-view/images/transparent-background.gif`.
You can also use the `atom` protocol URLs in themes.
@@ -312,8 +321,8 @@ You can also use the `atom` protocol URLs in themes.
Your package **should** have tests, and if they're placed in the _spec_
directory, they can be run by Atom.
Under the hood, [Jasmine] is being used to execute the tests, so you can
assume that any DSL available there is available to your package as well.
Under the hood, [Jasmine] executes your tests, so you can assume that any DSL
available there is available to your package as well.
**FIXME: Explain the following**
@@ -323,7 +332,9 @@ assume that any DSL available there is available to your package as well.
* setTimeout
* whatever else is different in spec-helper
## Running tests
## Running Tests
TODO: Probably use the menu option now.
Once you've got your test suite written, the recommended way to run it is `apm
test`. `apm test` prints its output to the console and returns the proper status
@@ -349,257 +360,7 @@ registry.
Run `apm help publish` to see all the available options and `apm help` to see
all the other available commands.
# Full Example
Let's take a look at creating our first package.
To get started hit `cmd-p`, and start typing "Package Generator." to generate
the package. Once you select the package generator command, it'll ask you for a
name for your new package. Let's call ours _changer_.
Now, _changer_ is going to have a default set of folders and files created for
us. Hit `cmd-r` to reload Atom, then hit `cmd-p` and start typing "Changer."
You'll see a new `Changer:Toggle` command which, if selected, pops up a new
message. So far, so good!
In order to demonstrate the capabilities of Atom and its API, our Changer plugin
is going to do two things:
1. It'll show only modified files in the file tree
2. It'll append a new pane to the editor with some information about the modified
files
Let's get started!
## Changing Keybindings and Commands
Since Changer is primarily concerned with the file tree, let's write a
key binding that works only when the tree is focused. Instead of using the
default `toggle`, our keybinding executes a new command called `magic`.
_keymaps/changer.cson_ can easily become this:
```coffeescript
'.tree-view':
'ctrl-V': 'changer:magic'
```
Notice that the keybinding is called `ctrl-V` &mdash; that's actually `ctrl-shift-v`.
You can use capital letters to denote using `shift` for your binding.
`.tree-view` represents the parent container for the tree view.
Keybindings only work within the context of where they're entered. For example,
hitting `ctrl-V` anywhere other than tree won't do anything. You can map to
`body` if you want to scope to anywhere in Atom, or just `.editor` for the
editor portion.
To bind keybindings to a command, we'll use the `rootView.command` method. This
takes a command name and executes a function in the code. For example:
```coffeescript
rootView.command "changer:magic", => @magic()
```
It's common practice to namespace your commands with your package name, and
separate it with a colon (`:`). Rename the existing `toggle` method to `magic`
to get the binding to work.
Reload the editor, click on the tree, hit your keybinding, and...nothing
happens! What the heck?!
Open up the _package.json_ file, and notice the key that says
`activationEvents`. Basically, this tells Atom to not load a package until it
hears a certain event. Let's change the event to `changer:magic` and reload the
editor.
Hitting the key binding on the tree now works!
## Working with Styles
The next step is to hide elements in the tree that aren't modified. To do that,
we'll first try and get a list of files that have not changed.
All packages are able to use jQuery in their code. In fact, we have [a list of
some of the bundled libraries Atom provides by default](#included-libraries).
Let's bring in jQuery:
```coffeescript
{$} = require 'atom'
```
Now, we can query the tree to get us a list of every file that _wasn't_
modified:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("modified")
console.log el
```
You can access the dev console by hitting `alt-cmd-i`. When we execute the
`changer:magic` command, the browser console lists the items that are not being
modified. Let's add a class to each of these elements called `hide-me`:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("modified")
$(el).addClass("hide-me")
```
With our newly added class, we can manipulate the visibility of the elements
with a simple stylesheet. Open up _changer.css_ in the _stylesheets_ directory,
and add a single entry:
```css
ol.entries .hide-me {
display: none;
}
```
Refresh atom, and run the `changer` command. You'll see all the non-changed
files disappear from the tree. There are a number of ways you can get the list
back; let's just naively iterate over the same elements and remove the class:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("modified")
if !$(el).hasClass("hide-me")
$(el).addClass("hide-me")
else
$(el).removeClass("hide-me")
```
## Creating a New Panel
The next goal of this package is to append a panel to the Atom editor that lists
some information about the modified files.
To do that, we're going to first create a new class method called `content`.
Every package that extends from the `View` class can provide an optional class
method called `content`. The `content` method constructs the DOM that your
package uses as its UI. The principals of `content` are built entirely on
[SpacePen], which we'll touch upon only briefly here.
Our display will simply be an unordered list of the file names, and their
modified times. Let's start by carving out a `div` to hold the filenames:
```coffeescript
@content: ->
@div class: 'modified-files-container', =>
@ul class: 'modified-files-list', outlet: 'modifiedFilesList', =>
@li 'Test'
@li 'Test2'
```
You can add any HTML5 attribute you like. `outlet` names the variable your
package can uses to manipulate the element directly. The fat pipe (`=>`)
indicates that the next set are nested children.
We'll add one more line to `magic` to make this pane appear:
```coffeescript
rootView.vertical.append(this)
```
If you hit the key command, you'll see a box appear right underneath the editor.
Success!
Before we populate this, let's apply some logic to toggle the pane off and on,
just like we did with the tree view:
```coffeescript
# toggles the pane
if @hasParent()
rootView.vertical.children().last().remove()
else
rootView.vertical.append(this)
```
There are about a hundred different ways to toggle a pane on and off, and this
might not be the most efficient one. If you know your package needs to be
toggled on and off more freely, it might be better to draw the interface during the
initialization, then immediately call `hide()` on the element to remove it from
the view. You can then swap between `show()` and `hide()`, and instead of
forcing Atom to add and remove the element as we're doing here, it'll just set a
CSS property to control your package's visibility.
Refresh Atom, hit the key combo, and see your test list.
## Calling Node.js Code
Since Atom is built on top of Node.js, you can call any of its libraries,
including other modules that your package requires.
We'll iterate through our resulting tree, and construct the path to our modified
file based on its depth in the tree:
```coffeescript
path = require 'path'
# ...
modifiedFiles = []
# for each single entry...
$('ol.entries li.file.modified span.name').each (i, el) ->
filePath = []
# ...grab its name...
filePath.unshift($(el).text())
# ... then find its parent directories, and grab their names
parents = $(el).parents('.directory.modified')
parents.each (i, el) ->
filePath.unshift($(el).find('div.header span.name').eq(0).text())
modifiedFilePath = path.join(project.rootDirectory.path, filePath.join(path.sep))
modifiedFiles.push modifiedFilePath
```
`modifiedFiles` is an array containing a list of our modified files. We're also
using the node.js [`path` library][path] to get the proper directory separator
for our system.
Let's remove the two `@li` elements we added in `@content`, so that we can
populate our `modifiedFilesList` with real information. We'll do that by
iterating over `modifiedFiles`, accessing a file's last modified time, and
appending it to `modifiedFilesList`:
```coffeescript
# toggles the pane
if @hasParent()
rootView.vertical.children().last().remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
rootView.vertical.append(this)
```
When you toggle the modified files list, your pane is now populated with the
filenames and modified times of files in your project. You might notice that
subsequent calls to this command reduplicate information. We could provide an
elegant way of rechecking files already in the list, but for this demonstration,
we'll just clear the `modifiedFilesList` each time it's closed:
```coffeescript
# toggles the pane
if @hasParent()
@modifiedFilesList.empty()
rootView.vertical.children().last().remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
rootView.vertical.append(this)
```
# Included Libraries
## Included Libraries
FIXME: Describe `require 'atom'
@@ -612,12 +373,16 @@ popular libraries into their packages:
Additional libraries can be found by browsing Atom's *node_modules* folder.
[file-tree]: https://github.com/atom/tree-view
[status-bar]: https://github.com/atom/status-bar
[cs-syntax]: https://github.com/atom/language-coffee-script
[npm]: http://en.wikipedia.org/wiki/Npm_(software)
[npm-keys]: https://npmjs.org/doc/json.html
[apm]: https://github.com/atom/apm
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[wrap-guide]: https://github.com/atom/wrap-guide/
[keymaps]: internals/keymaps.md
[theme-variables]: theme-variables.md
[tm-tokens]: http://manual.macromates.com/en/language_grammars.html
[spacepen]: https://github.com/nathansobo/space-pen
[path]: http://nodejs.org/docs/latest/api/path.html
@@ -627,3 +392,4 @@ Additional libraries can be found by browsing Atom's *node_modules* folder.
[cson]: https://github.com/atom/season
[less]: http://lesscss.org
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
[first-package]: your-first-package.html
+62 -62
Ver Arquivo
@@ -1,72 +1,67 @@
# Creating a Theme
Atom's interface is rendered using HTML and it's styled via [LESS] (a superset
of CSS). Don't worry if you haven't heard of LESS before, it's just like CSS but
Atom's interface is rendered using HTML, and it's styled via [LESS] (a superset
of CSS). Don't worry if you haven't heard of LESS before; it's just like CSS, but
with a few handy extensions.
Since CSS is the basis of the theming system, we can load multiple themes within
Atom and they behaves just as they would on a website. Themes loaded first are overridden by
themes which are loaded later (the order is controlled from within the Settings
pane).
Atom, and the themes behave just as they would on a website. Themes loaded first
are overridden by themes which are loaded later. The order of theme loading is
controlled within the Settings/Themes pane.
This flexibility is helpful for users which prefer a light interface with a dark
syntax theme. Atom currently has only interface and syntax themes but it is
possible to create a theme to style something specific &mdash; say a changing
This flexibility is helpful for users that prefer a light interface with a dark
syntax theme. Atom currently has only interface and syntax themes, but it is
possible to create a theme to style something specific &mdash; say, changing
the colors in the tree view or creating a language specific syntax theme.
## Getting Started
To create your own theme you'll need a few things:
* A working install of [Atom], so you can work on your new theme.
* A working install of [git] to track changes.
* And a [GitHub] account, so you can distribute your themes.
Themes are pretty straight forward but it's still helpful to be familiar with
a few things before starting:
* LESS is a superset of CSS but it has some really handy features like
* LESS is a superset of CSS, but it has some really handy features like
variables. If you aren't familiar with its syntax take a few minutes
to [familiarize yourself][less-tutorial].
* Atom uses Chrome at its core, so you can use Chrome devtools to
inspect the current state of the interface. Checkout Google's
[extensive tutorial][devtools-tutorial] for a short introduction.
* You may also want to review the concept of a _[package.json]_, too. This file
is used to help distribute your theme to Atom users.
## Creating a Minimal Syntax Theme
There are two types of themes you can create: syntax themes and interface themes.
The differences between them are simply a matter of what they target and what
they provide. Syntax themes focus on the entire editor pane, while interface themes
target elements which are outside of the editor.
1. Open the Command Palette (`cmd-p`)
1. Search for `Package Generator: Generate Syntax Theme` and select it.
1. Choose a name for your theme. A folder will be created with this name.
1. Press enter to create your theme. After creation, your theme will be
installed and enabled.
1. An Atom window will open with your newly created theme.
1. Open `package.json` and update the relevant parts.
1. Open `stylesheets/colors.less` to change the various colors variables which
have been already been defined.
1. Open `stylesheets/base.less` and modify the various syntax CSS selectors
that have been already been defined.
1. When you're ready, update the `README.md` and include an example screenshot
of your new theme in action.
1. Reload atom (`cmd-r`) to see changes you made reflected in your Atom window.
1. Look in the theme settings, your new theme should be show in the enabled themes section
![themesettings-img]
1. Open a terminal to your new theme directory; it should be in `~/.atom/packages/<my-name>`.
1. To publish, initialize a git repository, push to GitHub, and run
`apm publish`.
## Creating a Syntax Theme
Want to make edits and have them immediately show up without reloading? Open a
development window (__View > Developer > Open in Dev Mode__ menu) to the
directory of your choice &mdash; even the new theme itself. Then just edit away!
Changes will be instantly reflected in the editor without having to reload.
Let's create your first theme.
## Interface Themes
To get started, hit `cmd-shift-P`, and start typing "Generate Theme" to generate
a package. Select "Generate Theme," and you'll be asked for a theme name. Let's
call ours _motif_.
There are only two differences between interface and syntax themes - what
they target and what they provide. Interface themes only target elements which
are outside of the editor and **must** provide a `ui-variables.less` file which
contains all of the variables provided by the [core themes][ui-variables].
Atom will pop open a new window, showing the _motif_ theme, with a default set of
folders and files created for us. If you hit `cmd-,` and navigate to the Themes
menu option, you'll see the `motif` theme already available. Drag it over from
"Enabled Themes" to "Available Themes."
To create a UI theme, do the following:
Open up _stylesheets/colors.less_ to change the various colors variables which
have been already been defined. For example, turn `@red` into `#f4c2c1`.
Then, open _stylesheets/base.less_, and modify the various syntax CSS selectors
that have been already been defined. Each of these selectors represents a different
part of the Atom window. Themes that don't need to modify a particular region
can simply remove the selectors they don't need.
As an example, let's make the `.gutter` `background-color` into `@red`.
Reload Atom by hitting `cmd-r` to see the changes you made reflected in your Atom
window. Pretty neat!
## Creating an Interface Theme
Interface themes **must** provide a `ui-variables.less` file which contains all
of the variables provided by the [core themes][ui-variables].
To create an interface UI theme, do the following:
1. Fork one of the following repos
1. [atom-dark-ui]
@@ -82,50 +77,55 @@ To create a UI theme, do the following:
## Development workflow
There are a few of tools to help make theme development fast.
There are a few of tools to help make theme development faster.
### Live Reload
Reloading via `cmd-r` after you make changes to your theme less than ideal. Atom
supports [live updating][livereload] of styles on Dev Mode Atom windows.
Reloading by hitting `cmd-r` after you make changes to your theme is less than ideal.
Atom supports [live updating][livereload] of styles on Dev Mode Atom windows.
1. Open your theme directory in a dev window by either using the
__View > Developer > Open in Dev Mode__ menu or the `cmd-shift-o` shortcut
1. Make a change to your theme file and save &mdash; your change should be
To enable a Dev Mode window:
1. Open your theme directory in a dev window by either going to the
__View > Developer > Open in Dev Mode__ menu or by hitting the `cmd-shift-o`
shortcut
1. Make a change to your theme file and save it. Your change should be
immediately applied!
If you'd like to reload all styles at any time, you can use the shortcut
`cmd-ctrl-shift-r`.
If you'd like to reload all the styles at any time, you can use the shortcut
`cmd-ctrl-R`.
### Developer Tools
Atom is based on the Chrome browser, and supports Chrome's Developer Tools. You
can open them by selecting the __View > Toggle Developer Tools__ menu or by using the
`cmd-option-i` shortcut.
can open them by selecting the __View > Toggle Developer Tools__ menu, or by using
the `cmd-option-i` shortcut.
The dev tools allow you to inspect elements and take a look at their CSS
properties.
![devtools-img]
Check out Google's [extensive tutorial][devtools-tutorial] for a short introduction.
### Atom Styleguide
If you are creating an interface theme, you'll want a way to see how your theme
changes affect all the components in the system. The [styleguide] is a page with
every component Atom supports rendered.
To open the styleguide, open the command palette (`cmd-p`) and search for
_styleguide_ or use the shortcut `cmd-ctrl-shift-g`.
To open the styleguide, open the command palette (`cmd-shift-P`) and search for
_styleguide_, or use the shortcut `cmd-ctrl-shift-g`.
![styleguide-img]
[less]: http://lesscss.org/
[git]: http://git-scm.com/
[atom]: https://atom.io/
[github]: https://github.com/
[package.json]: ./creating-a-package.html#package-json
[less-tutorial]: https://speakerdeck.com/danmatthews/less-css
[devtools-tutorial]: https://developers.google.com/chrome-developer-tools/docs/elements
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
[ui-variables]: ./theme-variables.html
[livereload]: https://github.com/atom/dev-live-reload
[styleguide]: https://github.com/atom/styleguide
[atom-dark-ui]: https://github.com/atom/atom-dark-ui
+16 -3
Ver Arquivo
@@ -19,6 +19,16 @@ Themes` section on the `Packages` tab within the Settings panel.
You can install non-bundled packages by going to the `Available Packages`
section on the `Packages` tab within the Settings panel (`cmd-,`).
You can also install packages from the command line using the
[apm](https://github.com/atom/apm) command:
`apm install <package_name>` to install the latest version.
`apm install <package_name>@<package_version>` to install a specific version.
For example `apm install emmet@0.1.5` installs the `0.1.5` release of the
[Emmet](https://github.com/atom/emmet) package into `~/.atom/packages`.
## Customizing Key Bindings
Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
@@ -45,6 +55,10 @@ By default, `~/.atom/keymap.cson` is loaded when Atom is started. It will always
be loaded last, giving you the chance to override bindings that are defined by
Atom's core keymaps or third-party packages.
You'll want to know all the commands available to you. Open the Settings panel
(`cmd-,`) and select the _Keybindings_ tab. It will show you all the keybindings
currently in use.
## Advanced Configuration
Atom loads configuration settings from the `config.cson` file in your _~/.atom_
@@ -52,7 +66,7 @@ directory, which contains CoffeeScript-style JSON:
```coffeescript
core:
hideGitIgnoredFiles: true
excludeVcsIgnoredPaths: true
editor:
fontSize: 18
```
@@ -65,7 +79,6 @@ namespaces: `core` and `editor`.
- `core`
- `disabledPackages`: An array of package names to disable
- `excludeVcsIgnoredPaths`: Don't search within files specified by _.gitignore_
- `hideGitIgnoredFiles`: Whether files in the _.gitignore_ should be hidden
- `ignoredNames`: File names to ignore across all of Atom
- `projectHome`: The directory where projects are assumed to be located
- `themes`: An array of theme names to load, in cascading order
@@ -93,7 +106,7 @@ namespaces: `core` and `editor`.
- `whitespace`
- `ensureSingleTrailingNewline`: Whether to reduce multiple newlines to one at the end of files
- `removeTrailingWhitespace`: Enable/disable striping of whitespace at the end of lines (defaults to `true`)
- `wrapGuide`
- `wrap-guide`
- `columns`: Array of hashes with a `pattern` and `column` key to match the
the path of the current editor to a column position.
+38 -39
Ver Arquivo
@@ -6,13 +6,12 @@ productive as quickly as possible. There are also guides which cover
## The Command Palette
If there's one key-command you must remember in Atom, it should be `cmd-p`. You
can always hit `cmd-p` to bring up a list of commands that are relevant to the
currently focused interface element. If there is a key binding for a given
command, it is also displayed. This is a great way to explore the system and get
to know the key commands interactively. If you'd like to learn about adding or
changing a binding for a command, refer to the [key bindings][key-bindings]
section below.
If there's one key-command you remember in Atom, it should be `cmd-shift-P`. You
can always press `cmd-shift-P` to bring up a list of commands (and key bindings)
that are relevant to the currently focused interface element. This is a great
way to explore the system and learn key bindings interactively. For information
about adding or changing a key binding refer to the [customizing key
bindings][key-bindings] section.
![Command Palette]
@@ -20,24 +19,24 @@ section below.
### Working With Files
Atom windows are scoped to the directory in which they're opened from. So if you
launch Atom from the command line, everything will be relative to the current
directory. This means that the tree view on the left will only show files
contained within that directory.
Atom windows are scoped to the directory they're opened from. If you launch Atom
from the command line everything will be relative to the current directory. This
means that the tree view on the left will only show files contained within that
directory.
This can be a useful way to organize multiple projects, as each project will be
contained within it's own window and it's state will be unique to that window.
contained within its own window.
#### Finding Files
The fastest way to find a file in your project is to use the fuzzy finder. Just
hit `cmd-t` and start typing the name of the file you're looking for. If you
already have the file open as a tab and want to jump to it, hit `cmd-b` to bring
up a searchable list of open buffers.
The fastest way to find a file is to use the fuzzy finder. Press `cmd-t` and
begin typing the name of the file you're looking for. If you are looking for a
file that is already open press `cmd-b` to bring up a searchable list of open
files.
You can also use the tree view to navigate to a file. To open or move focus to
the tree view, hit `cmd-\`. You can then navigate to a file and select it with
`return`.
the tree view, press `cmd-\`. You can then navigate to a file using the arrow
keys and select it with `return`.
#### Adding, Moving, Deleting Files
@@ -46,50 +45,50 @@ select a directory in the tree view and press `a`. Then type the name of the
file. Any intermediate directories you type will be created automatically if
needed.
To move or rename a file or directory, select it in the tree view and hit `m`.
To delete a file, select it in the tree view and hit `delete`.
To move or rename a file or directory, select it in the tree view and press `m`.
To delete a file, select it in the tree view and press `delete`.
### Searching
#### Find and Replace
To search within a buffer use `cmd-f`. To search the entire project use
`cmd-shift-f`. To find and replace within the current buffer use `cmd-alt-f`.
`cmd-shift-f`.
#### Navigating By Symbols
If you want to jump to a method, the `cmd-j` binding opens a list of all symbols
in the current file. `cmd-.` jumps to the tag for the word currently under the
cursor.
If you want to jump to a method press `cmd-r`. It opens a list of all symbols
in the current file.
To search for symbols across your project use `cmd-shift-j`, but you'll need to
make sure you have a tags file generated for the project Also, if you're editing
CoffeeScript, it's a good idea to update your `~/.ctags` file to understand the
language. Here is [a good example][ctags].
To search for symbols across your project use `cmd-shift-r`, but you'll need to
make sure you have a ctags installed and a tags file generated for your project.
Also, if you're editing CoffeeScript, it's a good idea to update your `~/.ctags`
file to understand the language. Here is [a good example][ctags].
### Split Panes
You can split any editor pane horizontally or vertically by using `ctrl-w s` or
`ctrl-w v`. Once you have a split pane, you can move focus between them with
`ctrl-tab` or `ctrl-w w`. To close a pane, close all tabs inside it.
You can split any editor pane horizontally or vertically by using `cmd-k right` or
`cmd-k down`. Once you have a split pane, you can move focus between them with
`cmd-k cmd-right` or `cmd-k cmd-down`. To close a pane, close all tabs inside it.
### Folding
You can fold everything with `ctrl-{` and unfold everything with
`ctrl-}`. Or, you can fold / unfold by a single level with `ctrl-[` and
`ctrl-]`.
You can fold everything with `alt-cmd-{` and unfold everything with
`alt-cmd-}`. Or, you can fold / unfold by a single level with `alt-cmd-[` and
`alt-cmd-]`.
### Soft-Wrap
If you want to toggle soft wrap, trigger the command from the command palette.
Hit `cmd-p` to open the palette, then type "wrap" to find the correct
Press `cmd-shift-P` to open the palette, then type "wrap" to find the correct
command.
## Configuration
If you press `cmd-,`, a configuration panel will appear in the currently focused
pane. This serves as the primary interface for adjusting settings, installing
packages and changing themes.
Press `cmd-,` to display the a settings pane. This serves as the primary
interface for adjusting config settings, installing packages and changing
themes.
For more advanced configuration see the [customization guide][customization].
@@ -97,6 +96,6 @@ For more advanced configuration see the [customization guide][customization].
[theming]: creating-a-theme.md
[extending]: creating-a-package.md
[customization]: customizing-atom.md
[key-bindings]: #customizing-key-bindings
[key-bindings]: customizing-atom.md#customizing-key-bindings
[command palette]: https://f.cloud.github.com/assets/1424/1091618/ee7c3554-166a-11e3-9955-aaa61bb5509c.png
[ctags]: https://github.com/kevinsawicki/dotfiles/blob/master/.ctags
+1
Ver Arquivo
@@ -6,6 +6,7 @@
* [Creating a Theme](creating-a-theme.md)
### Advanced Topics
* [Configuration](internals/configuration.md)
* [Keymaps](internals/keymaps.md)
* [Serialization](internals/serialization.md)
+1 -1
Ver Arquivo
@@ -23,7 +23,7 @@ The `observeConfig` method will call the given callback immediately with the
current value for the specified key path, and it will also call it in the future
whenever the value of that key path changes.
Subscriptions made with `observeConfig` are automatically cancelled when the
Subscriptions made with `observeConfig` are automatically canceled when the
view is removed. You can cancel config subscriptions manually via the
`unobserveConfig` method.
+1 -1
Ver Arquivo
@@ -23,7 +23,7 @@ Note that the last example describes multiple keystrokes in succession:
A semantic event is the name of the custom event that will be triggered on the
target of the keydown event when a key binding matches. You can use the command
palette (bound to `cmd-p`), to get a list of relevant events and their bindings
palette (bound to `cmd-shift-P`), to get a list of relevant events and their bindings
in any focused context in Atom.
### Rules for Mapping A Keydown Event to A Semantic Event
+19 -26
Ver Arquivo
@@ -8,11 +8,11 @@ view objects inherit from the jQuery prototype, and wrap DOM nodes
View objects are actually jQuery wrappers around DOM fragments, supporting all
the typical jQuery traversal and manipulation methods. In addition, view objects
have methods that are view-specific. For example, you could call both general
and view-specific on the global `rootView` instance:
and view-specific on the global `atom.workspaceView` instance:
```coffeescript
rootView.find('.editor.active') # standard jQuery method
rootView.getActiveEditor() # view-specific method
atom.workspaceView.find('.editor.active') # standard jQuery method
atom.workspaceView.getActiveEditor() # view-specific method
```
If you retrieve a jQuery wrapper for an element associated with a view, use the
@@ -20,7 +20,7 @@ If you retrieve a jQuery wrapper for an element associated with a view, use the
```coffeescript
# this is a plain jQuery object; you can't call view-specific methods
editorElement = rootView.find('.editor.active')
editorElement = atom.workspaceView.find('.editor.active')
# get the view object by calling `.view()` to call view-specific methods
editorView = editorElement.view()
@@ -29,37 +29,30 @@ editorView.setCursorBufferPosition([1, 2])
Refer to the [SpacePen] documentation for more details.
### RootView
### WorkspaceView
The root of Atom's view hierarchy is a global called `rootView`, which is a
singleton instance of the `RootView` view class. The root view fills the entire
The root of Atom's view hierarchy is a global called `atom.workspaceView`, which is a
singleton instance of the `WorkspaceView` view class. The root view fills the entire
window, and contains every other view. If you open Atom's inspector with
`alt-cmd-i`, you can see the internal structure of `RootView`:
`alt-cmd-i`, you can see the internal structure of `WorkspaceView`:
![RootView in the inspector][rootview-inspector]
![WorkspaceView in the inspector][workspaceview-inspector]
#### Panes
The `RootView` contains a `#horizontal` and a `#vertical` axis surrounding
`#panes`. Elements in the horizontal axis will tile across the window
horizontally, appearing to have a vertical orientation. Items in the vertical
axis will tile across the window vertically, appearing to have a horizontal
orientation. You would typically attach tool panels to the root view's primary
axes. Tool panels are elements which take up some screen real estate that isn't
devoted to direct editing. In the example above, the `TreeView` is present in
the `#horizontal` axis to the left of the `#panes`, and the `CommandPanel` is
present in the `#vertical` axis below the `#panes`.
You can attach a tool panel to an axis using the `horizontal` or `vertical`
outlets as follows:
The `WorkspaceView` contains `prependToBottom/Top/Left/Right` and
`appendToBottom/Top/Left/Right` methods, which are used to add Tool Panels. Tool
panels are elements that take up screen real estate not devoted to text editing.
In the example above, the `TreeView` is appended to the left, and the
`CommandPanel` is appended to the top.
```coffeescript
# place a view to the left of the panes (or use .append() to place it to the right)
rootView.horizontal.prepend(new MyView)
# place a view to the left of the panes
atom.workspaceView.appendToLeft(new MyView)
# place a view below the panes (or use .prepend() to place it above)
rootView.vertical.append(new MyOtherView)
# place a view below the panes
atom.workspaceView.appendToBottom(new MyOtherView)
```
[spacepen]: http://github.com/nathansobo/space-pen
[rootview-inspector]: https://f.cloud.github.com/assets/1424/1091631/1932c2d6-166b-11e3-8adf-9690fe82d3b8.png
[workspaceView-inspector]: https://f.cloud.github.com/assets/1424/1091631/1932c2d6-166b-11e3-8adf-9690fe82d3b8.png
+39
Ver Arquivo
@@ -0,0 +1,39 @@
# Setting up Travis CI
Packages under the [atom org][atom-org] should use [Travis CI][travis-ci] for
builds.
Currently we have a [Travis Pro][travis-pro] account since the repositories
are private. This process will be simpler and have fewer steps once the
package repos are made public.
Each package builds using the [build-package][build-package] script, any
changes to the build should be made in that script and will affect all
package builds immediately.
Each package builds against the latest successful build of atom@master. The
master builds are stored in the [atom-master-builds][atom-master-builds] repo
as releases named by the SHA-1 built.
## Configuring a package
* Run `cd ~/github/my-package` to navigate to the package repo locally
* Run `apm test` to verify that the package currently builds via [apm][apm]
* Add the package repo to the [Travis CI team][travis-ci-team]
* Run `gem install travis` to install the [travis gem][travis-gem]
* Run `travis login --pro` and log in using the [atom-build][atom-build] user
and the password from the *Shared-Developers* folder in LastPass
* Run `apm ci` to add a `.travis.yml` file to the repo and to configure Travis
* Log into [Travis][travis-ci] as the `atom-build` user and you should now see
the package listed and building
[apm]: https://github.com/atom/apm
[build-package]: https://github.com/atom/apm/blob/master/script/build-package
[atom-build]: https://github.com/atom-build
[atom-master-builds]: https://github.com/atom/atom-master-builds/releases
[atom-org]: https://github.com/atom
[travis-ci]: https://magnum.travis-ci.com
[travis-ci-team]: https://github.com/organizations/atom/teams/596636
[travis-gem]: https://rubygems.org/gems/travis
[travis-pro]: http://about.travis-ci.org/docs/user/travis-pro
+150
Ver Arquivo
@@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
<title>Atom - <%= title %></title>
<style>
/*github.com style (c) Vasily Polovnyov <vast@whiteants.net>*/
pre code {
display: block; padding: 0.5em;
color: #333;
background: #f8f8ff
}
pre .comment,
pre .template_comment,
pre .diff .header,
pre .javadoc {
color: #998;
font-style: italic
}
pre .keyword,
pre .css .rule .keyword,
pre .winutils,
pre .javascript .title,
pre .nginx .title,
pre .subst,
pre .request,
pre .status {
color: #333;
font-weight: bold
}
pre .number,
pre .hexcolor,
pre .ruby .constant {
color: #099;
}
pre .string,
pre .tag .value,
pre .phpdoc,
pre .tex .formula {
color: #d14
}
pre .title,
pre .id {
color: #900;
font-weight: bold
}
pre .javascript .title,
pre .lisp .title,
pre .clojure .title,
pre .subst {
font-weight: normal
}
pre .class .title,
pre .haskell .type,
pre .vhdl .literal,
pre .tex .command {
color: #458;
font-weight: bold
}
pre .tag,
pre .tag .title,
pre .rules .property,
pre .django .tag .keyword {
color: #000080;
font-weight: normal
}
pre .attribute,
pre .variable,
pre .lisp .body {
color: #008080
}
pre .regexp {
color: #009926
}
pre .class {
color: #458;
font-weight: bold
}
pre .symbol,
pre .ruby .symbol .string,
pre .lisp .keyword,
pre .tex .special,
pre .prompt {
color: #990073
}
pre .built_in,
pre .lisp .title,
pre .clojure .built_in {
color: #0086b3
}
pre .preprocessor,
pre .pi,
pre .doctype,
pre .shebang,
pre .cdata {
color: #999;
font-weight: bold
}
pre .deletion {
background: #fdd
}
pre .addition {
background: #dfd
}
pre .diff .change {
background: #0086b3
}
pre .chunk {
color: #aaa
}
body {
padding-top: 50px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/<%= tag %>/index.html">Atom Documentation</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/docs/api/<%= tag %>/api/index.html">API</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<%= content %>
</div>
</body>
</html>
+116
Ver Arquivo
@@ -0,0 +1,116 @@
# Style variables
Atom's UI provides a set of variables you can use in your own themes and packages.
## Use in Themes
Each custom theme must specify a `ui-variables.less` file with all of the
following variables defined. The top-most theme specified in the theme settings
will be loaded and available for import.
## Use in Packages
In any of your package's `.less` files, you can access the theme variables
by importing the `ui-variables` file from Atom.
Your package should generally only specify structural styling, and these should
come from [the style guide][styleguide]. Your package shouldn't specify colors,
padding sizes, or anything in absolute pixels. You should instead use the theme
variables. If you follow this guideline, your package will look good out of the
box with any theme!
Here's an example `.less` file that a package can define using theme variables:
```css
@import "ui-variables";
.my-selector{
background-color: @base-background-color;
padding: @component-padding;
}
```
## Variables
### Text colors
* `@text-color`
* `@text-color-subtle`
* `@text-color-highlight`
* `@text-color-selected`
* `@text-color-info` - A blue
* `@text-color-success`- A green
* `@text-color-warning`- An orange or yellow
* `@text-color-error` - A red
### Background colors
* `@background-color-info` - A blue
* `@background-color-success` - A green
* `@background-color-warning` - An orange or yellow
* `@background-color-error` - A red
* `@background-color-highlight`
* `@background-color-selected`
* `@app-background-color` - The app's background under all the editor components
### Component colors
* `@base-background-color` -
* `@base-border-color` -
* `@pane-item-background-color` -
* `@pane-item-border-color` -
* `@input-background-color` -
* `@input-border-color` -
* `@tool-panel-background-color` -
* `@tool-panel-border-color` -
* `@inset-panel-background-color` -
* `@inset-panel-border-color` -
* `@panel-heading-background-color` -
* `@panel-heading-border-color` -
* `@overlay-background-color` -
* `@overlay-border-color` -
* `@button-background-color` -
* `@button-background-color-hover` -
* `@button-background-color-selected` -
* `@button-border-color` -
* `@tab-bar-background-color` -
* `@tab-bar-border-color` -
* `@tab-background-color` -
* `@tab-background-color-active` -
* `@tab-border-color` -
* `@tree-view-background-color` -
* `@tree-view-border-color` -
* `@ui-site-color-1` -
* `@ui-site-color-2` -
* `@ui-site-color-3` -
* `@ui-site-color-4` -
* `@ui-site-color-5` -
### Component sizes
* `@disclosure-arrow-size` -
* `@component-padding` -
* `@component-icon-padding` -
* `@component-icon-size` -
* `@component-line-height` -
* `@component-border-radius` -
* `@tab-height` -
### Fonts
* `@font-size` -
* `@font-family` -
[styleguide]: https://github.com/atom/styleguide
+335
Ver Arquivo
@@ -0,0 +1,335 @@
# Creating Your First Package
Let's take a look at creating your first package.
To get started, hit `cmd-shift-P`, and start typing "Generate Package" to generate
a package. Once you select the "Generate Package" command, it'll ask you for a
name for your new package. Let's call ours _changer_.
Atom will pop open a new window, showing the _changer_ package with a default set of
folders and files created for us. Hit `cmd-shift-P` and start typing "Changer." You'll
see a new `Changer:Toggle` command which, if selected, pops up a greeting. So far,
so good!
In order to demonstrate the capabilities of Atom and its API, our Changer plugin
is going to do two things:
1. It'll show only modified files in the file tree
2. It'll append a new pane to the editor with some information about the modified
files
Let's get started!
## Changing Keybindings and Commands
Since Changer is primarily concerned with the file tree, let's write a
key binding that works only when the tree is focused. Instead of using the
default `toggle`, our keybinding executes a new command called `magic`.
_keymaps/changer.cson_ should change to look like this:
```coffeescript
'.tree-view':
'ctrl-V': 'changer:magic'
```
Notice that the keybinding is called `ctrl-V` &mdash; that's actually `ctrl-shift-v`.
You can use capital letters to denote using `shift` for your binding.
`.tree-view` represents the parent container for the tree view.
Keybindings only work within the context of where they're entered. In this case,
hitting `ctrl-V` anywhere other than tree won't do anything. Obviously, you can
bind to any part of the editor using element, id, or class names. For example,
you can map to `body` if you want to scope to anywhere in Atom, or just `.editor`
for the editor portion.
To bind keybindings to a command, we'll need to do a bit of association in our
CoffeeScript code using the `atom.workspaceView.command` method. This method takes a command
name and executes a callback function. Open up _lib/changer-view.coffee_, and
change `atom.workspaceView.command "changer:toggle"` to look like this:
```coffeescript
atom.workspaceView.command "changer:magic", => @magic()
```
It's common practice to namespace your commands with your package name, separated
with a colon (`:`). Make sure to rename your `toggle` method to `magic` as well.
Every time you reload the Atom editor, changes to your package code will be reevaluated,
just as if you were writing a script for the browser. Reload the editor, click on
the tree, hit your keybinding, and...nothing happens! What the heck?!
Open up the _package.json_ file, and find the property called `activationEvents`.
Basically, this key tells Atom to not load a package until it hears a certain event.
Change the event to `changer:magic` and reload the editor:
```json
"activationEvents": ["changer:magic"]
```
Hitting the key binding on the tree now works!
## Working with Styles
The next step is to hide elements in the tree that aren't modified. To do that,
we'll first try and get a list of files that have not changed.
All packages are able to use jQuery in their code. In fact, there's [a list of
the bundled libraries Atom provides by default][bundled-libs].
We bring in jQuery by requiring the `atom` package and binding it to the `$` variable:
```coffeescript
{$, View} = require 'atom'
```
Now, we can define the `magic` method to query the tree to get us a list of every
file that _wasn't_ modified:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
console.log el
```
You can access the dev console by hitting `alt-cmd-i`. Here, you'll see all the
statements from `console` calls. When we execute the `changer:magic` command, the
browser console lists items that are not being modified (_i.e._, those without the
`status-modified` class). Let's add a class to each of these elements called `hide-me`:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
$(el).addClass("hide-me")
```
With our newly added class, we can manipulate the visibility of the elements
with a simple stylesheet. Open up _changer.css_ in the _stylesheets_ directory,
and add a single entry:
```css
ol.entries .hide-me {
display: none;
}
```
Refresh Atom, and run the `changer` command. You'll see all the non-changed
files disappear from the tree. Success!
![Changer_File_View]
There are a number of ways you can get the list back; let's just naively iterate
over the same elements and remove the class:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
if !$(el).hasClass("hide-me")
$(el).addClass("hide-me")
else
$(el).removeClass("hide-me")
```
## Creating a New Panel
The next goal of this package is to append a panel to the Atom editor that lists
some information about the modified files.
To do that, we're going to first open up [the style guide][styleguide]. The Style
Guide lists every type of UI element that can be created by an Atom package. Aside
from helping you avoid writing fresh code from scratch, it ensures that packages
have the same look and feel no matter how they're built.
Every package that extends from the `View` class can provide an optional class
method called `content`. The `content` method constructs the DOM that your
package uses as its UI. The principals of `content` are built entirely on
[SpacePen][space-pen], which we'll touch upon only briefly here.
Our display will simply be an unordered list of the file names, and their
modified times. We'll append this list to a panel on the bottom of the editor. A
basic `panel` element inside a `tool-panel` will work well for us. Let's start by carving out a
`div` to hold the filenames:
```coffeescript
@content: ->
@div class: "changer tool-panel panel-bottom", =>
@div class: "panel", =>
@div class: "panel-heading", "Modified Files"
@div class: "panel-body padded", outlet: 'modifiedFilesContainer', =>
@ul class: 'modified-files-list', outlet: 'modifiedFilesList', =>
@li 'Modified File Test'
@li 'Modified File Test'
```
You can add any HTML attribute you like. `outlet` names the variable your
package can use to manipulate the element directly. The fat arrow (`=>`)
indicates that the next DOM set are nested children.
Once again, you can style `li` elements using your stylesheets. Let's test that
out by adding these lines to the _changer.css_ file:
```css
ul.modified-files-list {
color: white;
}
```
We'll add one more line to the end of the `magic` method to make this pane
appear:
```coffeescript
atom.workspaceView.prependToBottom(this)
```
If you refresh Atom and hit the key command, you'll see a box appear right
underneath the editor:
![Changer_Panel_Append]
As you might have guessed, `atom.workspaceView.prependToBottom` tells Atom to
prepend `this` item (_i.e._, whatever is defined by`@content`). If we had called
`atom.workspaceView.appendToBottom`, the pane would be attached below the status
bar.
Before we populate this panel for real, let's apply some logic to toggle the
pane off and on, just like we did with the tree view. Replace the
`atom.workspaceView.prependToBottom` call with this code:
```coffeescript
# toggles the pane
if @hasParent()
@remove()
else
atom.workspaceView.prependToBottom(this)
```
There are about a hundred different ways to toggle a pane on and off, and this
might not be the most efficient one. If you know your package needs to be
toggled on and off more freely, it might be better to draw the interface during the
initialization, then immediately call `hide()` on the element to remove it from
the view. You can then swap between `show()` and `hide()`, and instead of
forcing Atom to add and remove the element as we're doing here, it'll just set a
CSS property to control your package's visibility.
Refresh Atom, hit the key combo, and watch your test list appear and disappear.
## Calling Node.js Code
Since Atom is built on top of [Node.js][node], you can call any of its libraries,
including other modules that your package requires.
We'll iterate through our resulting tree, and construct the path to our modified
file based on its depth in the tree. We'll use Node to handle path joining for
directories.
Add the following Node module to the top of your file:
```coffeescript
path = require 'path'
```
Then, add these lines to your `magic` method, _before_ your pane drawing code:
```coffeescript
modifiedFiles = []
# for each single entry...
$('ol.entries li.file.status-modified span.name').each (i, el) ->
filePath = []
# ...grab its name...
filePath.unshift($(el).text())
# ... then find its parent directories, and grab their names
parents = $(el).parents('.directory.status-modified')
parents.each (i, el) ->
filePath.unshift($(el).find('div.header span.name').eq(0).text())
modifiedFilePath = path.join(atom.project.rootDirectory.path, filePath.join(path.sep))
modifiedFiles.push modifiedFilePath
```
`modifiedFiles` is an array containing a list of our modified files. We're also
using the node.js [`path` library][path] to get the proper directory separator
for our system.
Remove the two `@li` elements we added in `@content`, so that we can
populate our `modifiedFilesList` with real information. We'll do that by
iterating over `modifiedFiles`, accessing a file's last modified time, and
appending it to `modifiedFilesList`:
```coffeescript
# toggles the pane
if @hasParent()
@remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
atom.workspaceView.prependToBottom(this)
```
When you toggle the modified files list, your pane is now populated with the
filenames and modified times of files in your project:
![Changer_Panel_Timestamps]
You might notice that subsequent calls to this command reduplicate information.
We could provide an elegant way of rechecking files already in the list, but for
this demonstration, we'll just clear the `modifiedFilesList` each time it's closed:
```coffeescript
# toggles the pane
if @hasParent()
@modifiedFilesList.empty() # added this to clear the list on close
@remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
atom.workspaceView.prependToBottom(this)
```
## Coloring UI Elements
For packages that create new UI elements, adhering to the style guide is just one
part to keeping visual consistency. Packages dealing with color, fonts, padding,
margins, and other visual cues should rely on [Theme Variables][theme-vars], instead
of developing individual styles. Theme variables are variables defined by Atom
for use in packages and themes. They're only available in [`LESS`](http://lesscss.org/)
stylesheets.
For our package, let's remove the style defined by `ul.modified-files-list` in
_changer.css_. Create a new file under the _stylesheets_ directory called _text-colors.less_.
Here, we'll import the _ui-variables.less_ file, and define some Atom-specific
styles:
```less
@import "ui-variables";
ul.modified-files-list {
color: @text-color;
background-color: @background-color-info;
}
```
Using theme variables ensures that packages look great alongside any theme.
## Further reading
For more information on the mechanics of packages, check out
[Creating a Package][creating-a-package].
[bundled-libs]: creating-a-package.html#included-libraries
[styleguide]: https://github.com/atom/styleguide
[space-pen]: https://github.com/atom/space-pen
[node]: http://nodejs.org/
[path]: http://nodejs.org/docs/latest/api/path.html
[changer_file_view]: https://f.cloud.github.com/assets/69169/1441187/d7a7cb46-41a7-11e3-8128-d93f70a5d5c1.png
[changer_panel_append]: https://f.cloud.github.com/assets/69169/1441189/db0c74da-41a7-11e3-8286-b82dd9190c34.png
[changer_panel_timestamps]: https://f.cloud.github.com/assets/69169/1441190/dcc8eeb6-41a7-11e3-830f-1f1b33072fcd.png
[theme-vars]: theme-variables.html
[creating-a-package]: creating-a-package.html
+5 -9
Ver Arquivo
@@ -1,18 +1,15 @@
{Document, Point, Range, Site} = require 'telepath'
_ = require 'underscore-plus'
{Point, Range} = require 'text-buffer'
module.exports =
_: _
_: require 'underscore-plus'
BufferedNodeProcess: require '../src/buffered-node-process'
BufferedProcess: require '../src/buffered-process'
Directory: require '../src/directory'
Document: Document
File: require '../src/file'
fs: require '../src/fs-utils'
fs: require 'fs-plus'
Git: require '../src/git'
Point: Point
Range: Range
Site: Site
# The following classes can't be used from a Task handler and should therefore
# only be exported when not running as a child node process
@@ -22,9 +19,8 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
module.exports.$ = $
module.exports.$$ = $$
module.exports.$$$ = $$$
module.exports.Editor = require '../src/editor'
module.exports.pathForRepositoryUrl = require('../src/project').pathForRepositoryUrl
module.exports.RootView = require '../src/root-view'
module.exports.EditorView = require '../src/editor-view'
module.exports.WorkspaceView = require '../src/workspace-view'
module.exports.SelectList = require '../src/select-list'
module.exports.ScrollView = require '../src/scroll-view'
module.exports.Task = require '../src/task'
-29
Ver Arquivo
@@ -1,29 +0,0 @@
'body':
'meta-up': 'core:move-to-top'
'meta-down': 'core:move-to-bottom'
'meta-shift-up': 'core:select-to-top'
'meta-shift-down': 'core:select-to-bottom'
'.editor':
'meta-left': 'editor:move-to-first-character-of-line'
'meta-right': 'editor:move-to-end-of-line'
'meta-shift-left': 'editor:select-to-first-character-of-line'
'meta-shift-right': 'editor:select-to-end-of-line'
'home': 'editor:move-to-first-character-of-line'
'end': 'editor:move-to-end-of-line'
'shift-home': 'editor:select-to-first-character-of-line'
'shift-end': 'editor:select-to-end-of-line'
'alt-left': 'editor:move-to-previous-word-boundary'
'alt-right': 'editor:move-to-next-word-boundary'
'alt-shift-left': 'editor:select-to-previous-word-boundary'
'alt-shift-right': 'editor:select-to-next-word-boundary'
'alt-backspace': 'editor:backspace-to-beginning-of-word'
'meta-backspace': 'editor:backspace-to-beginning-of-line'
'alt-delete': 'editor:delete-to-end-of-word'
'ctrl-t': 'editor:transpose'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-E': 'editor:select-to-end-of-line'
-97
Ver Arquivo
@@ -1,97 +0,0 @@
'body':
'meta-q': 'application:quit'
'meta-h': 'application:hide'
'meta-H': 'application:hide-other-applications'
'meta-n': 'application:new-file'
'meta-N': 'application:new-window'
'meta-o': 'application:open'
'meta-O': 'application:open-dev'
'meta-m': 'application:minimize'
'meta-,': 'application:show-settings'
'alt-meta-ctrl-m': 'application:zoom'
'meta-alt-ctrl-s': 'application:run-all-specs'
'meta-s': 'core:save'
'meta-S': 'core:save-as'
'enter': 'core:confirm'
'escape': 'core:cancel'
'meta-w': 'core:close'
'up': 'core:move-up'
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'shift-up': 'core:select-up'
'shift-down': 'core:select-down'
'shift-left': 'core:select-left'
'shift-right': 'core:select-right'
'meta-a': 'core:select-all'
'backspace': 'core:backspace'
'shift-backspace': 'core:backspace'
'delete': 'core:delete'
'meta-z': 'core:undo'
'meta-Z': 'core:redo'
'meta-y': 'core:redo'
'meta-x': 'core:cut'
'meta-c': 'core:copy'
'meta-v': 'core:paste'
'pageup': 'core:page-up'
'pagedown': 'core:page-down'
'meta-alt-s': 'window:save-all'
'meta-W': 'window:close'
'meta-+': 'window:increase-font-size'
'meta--': 'window:decrease-font-size'
'ctrl-w w': 'window:focus-next-pane'
'ctrl-tab': 'window:focus-next-pane'
'ctrl-meta-f': 'window:toggle-full-screen'
'ctrl-alt-meta-r': 'window:reload'
'alt-meta-i': 'window:toggle-dev-tools'
'meta-alt-ctrl-p': 'window:run-package-specs'
'ctrl-|': 'pane:split-right'
'ctrl-w v': 'pane:split-right'
'ctrl--': 'pane:split-down'
'ctrl-w s': 'pane:split-down'
'meta-{': 'pane:show-previous-item'
'meta-}': 'pane:show-next-item'
'alt-meta-left': 'pane:show-previous-item'
'alt-meta-right': 'pane:show-next-item'
'meta-1': 'pane:show-item-1'
'meta-2': 'pane:show-item-2'
'meta-3': 'pane:show-item-3'
'meta-4': 'pane:show-item-4'
'meta-5': 'pane:show-item-5'
'meta-6': 'pane:show-item-6'
'meta-7': 'pane:show-item-7'
'meta-8': 'pane:show-item-8'
'meta-9': 'pane:show-item-9'
'meta-T': 'pane:reopen-closed-item'
'alt-meta-w': 'pane:close-other-items'
'meta-P': 'pane:close'
'.tool-panel':
'meta-escape': 'tool-panel:unfocus'
'escape': 'core:close'
'meta-w': 'noop'
# allow standard input fields to work correctly
'input:not(.hidden-input)':
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'
'left': 'native!'
'right': 'native!'
'shift-left': 'native!'
'shift-right': 'native!'
'backspace': 'native!'
'shift-backspace': 'native!'
'delete': 'native!'
'meta-z': 'native!'
'meta-Z': 'native!'
'meta-x': 'native!'
'meta-c': 'native!'
'meta-v': 'native!'
'button':
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'
+81
Ver Arquivo
@@ -0,0 +1,81 @@
'.editor':
# Platform Bindings
'alt-left': 'editor:move-to-beginning-of-word'
'alt-right': 'editor:move-to-end-of-word'
'alt-shift-left': 'editor:select-to-beginning-of-word'
'alt-shift-right': 'editor:select-to-end-of-word'
'home': 'editor:move-to-first-character-of-line'
'end': 'editor:move-to-end-of-screen-line'
'shift-home': 'editor:select-to-first-character-of-line'
'shift-end': 'editor:select-to-end-of-line'
# Sublime Parity
'ctrl-t': 'editor:transpose'
'.editor:not(.mini)':
# Atom Specific
'ctrl-C': 'editor:copy-path'
# Sublime Parity
'tab': 'editor:indent'
'enter': 'editor:newline'
'shift-tab': 'editor:outdent-selected-rows'
'ctrl-K': 'editor:delete-line'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
'.tool-panel':
'escape': 'core:close'
'.tool-panel.panel-left, .tool-panel.panel-right':
'escape': 'tool-panel:unfocus'
'.editor !important, .editor.mini !important':
'escape': 'editor:consolidate-selections'
# allow standard input fields to work correctly
'body .native-key-bindings':
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'
'enter': 'native!'
'backspace': 'native!'
'shift-backspace': 'native!'
'delete': 'native!'
'up': 'native!'
'down': 'native!'
'shift-up': 'native!'
'shift-down': 'native!'
'alt-up': 'native!'
'alt-down': 'native!'
'alt-shift-up': 'native!'
'alt-shift-down': 'native!'
'cmd-up': 'native!'
'cmd-down': 'native!'
'cmd-shift-up': 'native!'
'cmd-shift-down': 'native!'
'ctrl-up': 'native!'
'ctrl-down': 'native!'
'ctrl-shift-up': 'native!'
'ctrl-shift-down': 'native!'
'left': 'native!'
'right': 'native!'
'shift-left': 'native!'
'shift-right': 'native!'
'alt-left': 'native!'
'alt-right': 'native!'
'alt-shift-left': 'native!'
'alt-shift-right': 'native!'
'cmd-left': 'native!'
'cmd-right': 'native!'
'cmd-shift-left': 'native!'
'cmd-shift-right': 'native!'
'ctrl-left': 'native!'
'ctrl-right': 'native!'
'ctrl-shift-left': 'native!'
'ctrl-shift-right': 'native!'
'ctrl-b': 'native!'
'ctrl-f': 'native!'
'ctrl-F': 'native!'
'ctrl-B': 'native!'
'ctrl-h': 'native!'
'ctrl-d': 'native!'
+156
Ver Arquivo
@@ -0,0 +1,156 @@
'.platform-darwin':
# Apple specific
'cmd-q': 'application:quit'
'cmd-h': 'application:hide'
'cmd-alt-h': 'application:hide-other-applications'
'cmd-m': 'application:minimize'
'alt-cmd-ctrl-m': 'application:zoom'
'ctrl-p': 'core:move-up'
'ctrl-n': 'core:move-down'
'ctrl-b': 'core:move-left'
'ctrl-f': 'core:move-right'
'ctrl-P': 'core:select-up'
'ctrl-N': 'core:select-down'
'ctrl-F': 'core:select-right'
'ctrl-B': 'core:select-left'
'ctrl-h': 'core:backspace'
'ctrl-d': 'core:delete'
# Atom Specific
'cmd-O': 'application:open-dev'
'cmd-alt-ctrl-s': 'application:run-all-specs'
'enter': 'core:confirm'
'escape': 'core:cancel'
'up': 'core:move-up'
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'ctrl-alt-cmd-l': 'window:reload'
'alt-cmd-i': 'window:toggle-dev-tools'
'cmd-alt-ctrl-p': 'window:run-package-specs'
# Sublime Parity
'cmd-,': 'application:show-settings'
'cmd-N': 'application:new-window'
'cmd-W': 'window:close'
'cmd-o': 'application:open'
'cmd-T': 'pane:reopen-closed-item'
'cmd-n': 'application:new-file'
'cmd-s': 'core:save'
'cmd-S': 'core:save-as'
'cmd-alt-s': 'window:save-all'
'cmd-w': 'core:close'
'cmd-ctrl-f': 'window:toggle-full-screen'
'cmd-z': 'core:undo'
'cmd-Z': 'core:redo'
'cmd-y': 'core:redo'
'cmd-x': 'core:cut'
'cmd-c': 'core:copy'
'cmd-v': 'core:paste'
'shift-up': 'core:select-up'
'shift-down': 'core:select-down'
'shift-left': 'core:select-left'
'shift-right': 'core:select-right'
'delete': 'core:delete'
'pageup': 'core:page-up'
'pagedown': 'core:page-down'
'backspace': 'core:backspace'
'shift-backspace': 'core:backspace'
'cmd-up': 'core:move-to-top'
'cmd-down': 'core:move-to-bottom'
'cmd-shift-up': 'core:select-to-top'
'cmd-shift-down': 'core:select-to-bottom'
'cmd-{': 'pane:show-previous-item'
'cmd-}': 'pane:show-next-item'
'cmd-alt-left': 'pane:show-previous-item'
'cmd-alt-right': 'pane:show-next-item'
'cmd-=': 'window:increase-font-size'
'cmd-+': 'window:increase-font-size'
'cmd--': 'window:decrease-font-size'
'cmd-k up': 'pane:split-up' # Atom Specific
'cmd-k down': 'pane:split-down' # Atom Specific
'cmd-k left': 'pane:split-left' # Atom Specific
'cmd-k right': 'pane:split-right' # Atom Specific
'cmd-k cmd-w': 'pane:close' # Atom Specific
'cmd-k alt-cmd-w': 'pane:close-other-items' # Atom Specific
'cmd-k cmd-left': 'window:focus-previous-pane'
'cmd-k cmd-right': 'window:focus-next-pane'
'cmd-1': 'pane:show-item-1'
'cmd-2': 'pane:show-item-2'
'cmd-3': 'pane:show-item-3'
'cmd-4': 'pane:show-item-4'
'cmd-5': 'pane:show-item-5'
'cmd-6': 'pane:show-item-6'
'cmd-7': 'pane:show-item-7'
'cmd-8': 'pane:show-item-8'
'cmd-9': 'pane:show-item-9'
'.platform-darwin .editor':
# Apple Specific
'cmd-backspace': 'editor:backspace-to-beginning-of-line'
'cmd-delete': 'editor:backspace-to-beginning-of-line'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-E': 'editor:select-to-end-of-line'
'cmd-left': 'editor:move-to-first-character-of-line'
'cmd-right': 'editor:move-to-end-of-screen-line'
'cmd-shift-left': 'editor:select-to-first-character-of-line'
'cmd-shift-right': 'editor:select-to-end-of-line'
'alt-backspace': 'editor:backspace-to-beginning-of-word'
'alt-delete': 'editor:delete-to-end-of-word'
'ctrl-a': 'editor:move-to-beginning-of-line'
'ctrl-e': 'editor:move-to-end-of-line'
'ctrl-k': 'editor:cut-to-end-of-line'
# Atom Specific
'ctrl-W': 'editor:select-word'
# Sublime Parity
'cmd-a': 'core:select-all'
'cmd-alt-p': 'editor:log-cursor-scope'
'cmd-k cmd-u': 'editor:upper-case'
'cmd-k cmd-l': 'editor:lower-case'
'cmd-l': 'editor:select-line'
'body.platform-darwin .editor:not(.mini)':
# Atom specific
'alt-cmd-z': 'editor:checkout-head-revision'
'cmd-<': 'editor:scroll-to-cursor'
'alt-cmd-ctrl-f': 'editor:fold-selection'
'cmd-=': 'editor:auto-indent'
# Sublime Parity
'cmd-enter': 'editor:newline-below'
'cmd-shift-enter': 'editor:newline-above'
'cmd-]': 'editor:indent-selected-rows'
'cmd-[': 'editor:outdent-selected-rows'
'ctrl-cmd-up': 'editor:move-line-up'
'ctrl-cmd-down': 'editor:move-line-down'
'cmd-/': 'editor:toggle-line-comments'
'cmd-j': 'editor:join-line'
'cmd-D': 'editor:duplicate-line'
'cmd-L': 'editor:split-selections-into-lines'
'cmd-alt-[': 'editor:fold-current-row'
'cmd-alt-]': 'editor:unfold-current-row'
'cmd-alt-{': 'editor:fold-all' # Atom Specific
'cmd-alt-}': 'editor:unfold-all' # Atom Specific
'cmd-k cmd-0': 'editor:unfold-all'
'cmd-k cmd-1': 'editor:fold-at-indent-level-1'
'cmd-k cmd-2': 'editor:fold-at-indent-level-2'
'cmd-k cmd-3': 'editor:fold-at-indent-level-3'
'cmd-k cmd-4': 'editor:fold-at-indent-level-4'
'cmd-k cmd-5': 'editor:fold-at-indent-level-5'
'cmd-k cmd-6': 'editor:fold-at-indent-level-6'
'cmd-k cmd-7': 'editor:fold-at-indent-level-7'
'cmd-k cmd-8': 'editor:fold-at-indent-level-8'
'cmd-k cmd-9': 'editor:fold-at-indent-level-9'
# allow standard input fields to work correctly
'body.platform-darwin .native-key-bindings':
'cmd-z': 'native!'
'cmd-Z': 'native!'
'cmd-x': 'native!'
'cmd-c': 'native!'
'cmd-v': 'native!'
-50
Ver Arquivo
@@ -1,50 +0,0 @@
'.editor':
'ctrl-K': 'editor:delete-line'
'ctrl-W': 'editor:select-word'
'meta-alt-p': 'editor:log-cursor-scope'
'meta-u': 'editor:upper-case'
'meta-U': 'editor:lower-case'
'.editor:not(.mini)':
'enter': 'editor:newline'
'meta-enter': 'editor:newline-below'
'meta-shift-enter': 'editor:newline-above'
'tab': 'editor:indent'
'meta-=': 'editor:auto-indent'
'ctrl-[': 'editor:fold-current-row'
'ctrl-]': 'editor:unfold-current-row'
'ctrl-{': 'editor:fold-all'
'ctrl-}': 'editor:unfold-all'
'ctrl-meta-1': 'editor:fold-at-indent-level-1'
'ctrl-meta-2': 'editor:fold-at-indent-level-2'
'ctrl-meta-3': 'editor:fold-at-indent-level-3'
'ctrl-meta-4': 'editor:fold-at-indent-level-4'
'ctrl-meta-5': 'editor:fold-at-indent-level-5'
'ctrl-meta-6': 'editor:fold-at-indent-level-6'
'ctrl-meta-7': 'editor:fold-at-indent-level-7'
'ctrl-meta-8': 'editor:fold-at-indent-level-8'
'ctrl-meta-9': 'editor:fold-at-indent-level-9'
'alt-shift-down': 'editor:add-selection-below'
'alt-shift-up': 'editor:add-selection-above'
'alt-meta-ctrl-f': 'editor:fold-selection'
'shift-tab': 'editor:outdent-selected-rows'
'meta-[': 'editor:outdent-selected-rows'
'meta-]': 'editor:indent-selected-rows'
'meta-/': 'editor:toggle-line-comments'
'ctrl-C': 'editor:copy-path'
'ctrl-meta-up': 'editor:move-line-up'
'ctrl-meta-down': 'editor:move-line-down'
'meta-D': 'editor:duplicate-line'
'meta-j': 'editor:join-line'
'meta-<': 'editor:scroll-to-cursor'
'.editor.mini':
'enter': 'core:confirm',
'escape': 'core:cancel'
'meta-w': 'core:cancel'
'.editor !important, .editor.mini !important':
'escape': 'editor:consolidate-selections'
-26
Ver Arquivo
@@ -1,33 +1,7 @@
'body':
'ctrl-p': 'core:move-up'
'ctrl-n': 'core:move-down'
'ctrl-b': 'core:move-left'
'ctrl-f': 'core:move-right'
'ctrl-P': 'core:select-up'
'ctrl-N': 'core:select-down'
'ctrl-F': 'core:select-right'
'ctrl-B': 'core:select-left'
'alt-ctrl-n': 'editor:add-selection-below'
'alt-ctrl-p': 'editor:add-selection-above'
'ctrl-h': 'core:backspace'
'ctrl-d': 'core:delete'
'.editor':
'alt-f': 'editor:move-to-end-of-word'
'alt-F': 'editor:select-to-end-of-word'
'alt-b': 'editor:move-to-beginning-of-word'
'alt-B': 'editor:select-to-beginning-of-word'
'ctrl-a': 'editor:move-to-first-character-of-line'
'ctrl-e': 'editor:move-to-end-of-line'
'alt-h': 'editor:backspace-to-beginning-of-word'
'alt-d': 'editor:delete-to-end-of-word'
'ctrl-k': 'editor:cut-to-end-of-line'
# allow standard input fields to work correctly
'input:not(.hidden-input)':
'ctrl-b': 'native!'
'ctrl-f': 'native!'
'ctrl-F': 'native!'
'ctrl-B': 'native!'
'ctrl-h': 'native!'
'ctrl-d': 'native!'
-2
Ver Arquivo
@@ -1,2 +0,0 @@
'.editor':
'alt-meta-z': 'editor:checkout-head-revision'
-4
Ver Arquivo
@@ -1,4 +0,0 @@
'.select-list .mini.editor':
'enter': 'core:confirm'
'escape': 'core:cancel'
'meta-w': 'core:cancel'
+102
Ver Arquivo
@@ -0,0 +1,102 @@
'.platform-win32':
# Atom Specific
'enter': 'core:confirm'
'escape': 'core:cancel'
'up': 'core:move-up'
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'ctrl-alt-r': 'window:reload'
'ctrl-alt-i': 'window:toggle-dev-tools'
'ctrl-alt-p': 'window:run-package-specs'
'ctrl-alt-s': 'application:run-all-specs'
# Sublime Parity
'ctrl-N': 'application:new-window'
'ctrl-W': 'window:close'
'ctrl-o': 'application:open'
'ctrl-T': 'pane:reopen-closed-item'
'ctrl-n': 'application:new-file'
'ctrl-s': 'core:save'
'ctrl-S': 'core:save-as'
'ctrl-w': 'core:close'
'ctrl-z': 'core:undo'
'ctrl-y': 'core:redo'
'ctrl-x': 'core:cut'
'ctrl-c': 'core:copy'
'ctrl-v': 'core:paste'
'shift-up': 'core:select-up'
'shift-down': 'core:select-down'
'shift-left': 'core:select-left'
'shift-right': 'core:select-right'
'delete': 'core:delete'
'pageup': 'core:page-up'
'pagedown': 'core:page-down'
'backspace': 'core:backspace'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab': 'pane:show-previous-item'
'ctrl-shift-up': 'core:move-up'
'ctrl-shift-down': 'core:move-down'
'ctrl-=': 'window:increase-font-size'
'ctrl-+': 'window:increase-font-size'
'ctrl--': 'window:decrease-font-size'
'ctrl-k up': 'pane:split-up' # Atom Specific
'ctrl-k down': 'pane:split-down' # Atom Specific
'ctrl-k left': 'pane:split-left' # Atom Specific
'ctrl-k right': 'pane:split-right' # Atom Specific
'ctrl-k ctrl-w': 'pane:close' # Atom Specific
'ctrl-k alt-ctrl-w': 'pane:close-other-items' # Atom Specific
'ctrl-k ctrl-left': 'window:focus-previous-pane'
'ctrl-k ctrl-right': 'window:focus-next-pane'
'.platform-win32 .editor':
# Windows specific
'ctrl-delete': 'editor:backspace-to-beginning-of-word'
# Sublime Parity
'ctrl-a': 'core:select-all'
'ctrl-alt-p': 'editor:log-cursor-scope'
'ctrl-k ctrl-u': 'editor:upper-case'
'ctrl-k ctrl-l': 'editor:lower-case'
'.platform-win32 .editor:not(.mini)':
# Atom specific
'alt-ctrl-z': 'editor:checkout-head-revision'
'ctrl-<': 'editor:scroll-to-cursor'
'alt-ctrl-f': 'editor:fold-selection'
'ctrl-=': 'editor:auto-indent'
# Sublime Parity
'ctrl-enter': 'editor:newline-below'
'ctrl-shift-enter': 'editor:newline-above'
'ctrl-]': 'editor:indent-selected-rows'
'ctrl-[': 'editor:outdent-selected-rows'
'ctrl-up': 'editor:move-line-up'
'ctrl-down': 'editor:move-line-down'
'ctrl-/': 'editor:toggle-line-comments'
'ctrl-j': 'editor:join-line'
'ctrl-D': 'editor:duplicate-line'
'ctrl-alt-[': 'editor:fold-current-row'
'ctrl-alt-]': 'editor:unfold-current-row'
'ctrl-alt-{': 'editor:fold-all' # Atom Specific
'ctrl-alt-}': 'editor:unfold-all' # Atom Specific
'ctrl-k ctrl-0': 'editor:unfold-all'
'ctrl-k ctrl-1': 'editor:fold-at-indent-level-1'
'ctrl-k ctrl-2': 'editor:fold-at-indent-level-2'
'ctrl-k ctrl-3': 'editor:fold-at-indent-level-3'
'ctrl-k ctrl-4': 'editor:fold-at-indent-level-4'
'ctrl-k ctrl-5': 'editor:fold-at-indent-level-5'
'ctrl-k ctrl-6': 'editor:fold-at-indent-level-6'
'ctrl-k ctrl-7': 'editor:fold-at-indent-level-7'
'ctrl-k ctrl-8': 'editor:fold-at-indent-level-8'
'ctrl-k ctrl-9': 'editor:fold-at-indent-level-9'
# allow standard input fields to work correctly
'.platform-win32 input:not(.hidden-input), .platform-win32 .native-key-bindings':
'ctrl-z': 'native!'
'ctrl-Z': 'native!'
'ctrl-x': 'native!'
'ctrl-c': 'native!'
'ctrl-v': 'native!'
+1 -22
Ver Arquivo
@@ -99,6 +99,7 @@
submenu: [
{ label: 'Add Selection Above', command: 'editor:add-selection-above' }
{ label: 'Add Selection Below', command: 'editor:add-selection-below' }
{ label: 'Split into Lines', command: 'editor:split-selections-into-lines'}
{ type: 'separator' }
{ label: 'Select to Top', command: 'core:select-to-top' }
{ label: 'Select to Bottom', command: 'core:select-to-bottom' }
@@ -113,23 +114,6 @@
]
}
{
label: 'Movement'
submenu: [
{ label: 'Move to Top', command: 'core:move-to-top' }
{ label: 'Move to Bottom', command: 'core:move-to-bottom' }
{ type: 'separator' }
{ label: 'Move to Beginning of Line', command: 'editor:move-to-beginning-of-line' }
{ label: 'Move to First Character of Line', command: 'editor:move-to-first-character-of-line' }
{ label: 'Move to End of Line', command: 'editor:move-to-end-of-line' }
{ type: 'separator' }
{ label: 'Move to Beginning of Word', command: 'editor:move-to-beginning-of-word' }
{ label: 'Move to End of Word', command: 'editor:move-to-end-of-word' }
{ label: 'Move to Next Word', command: 'editor:move-to-next-word-boundary' }
{ label: 'Move to Previous Word', command: 'editor:move-to-previous-word-boundary' }
]
}
{
label: 'Find'
submenu: []
@@ -154,11 +138,6 @@
]
}
{
label: 'Collaboration'
submenu: []
}
{
label: 'Packages'
submenu: []
+155
Ver Arquivo
@@ -0,0 +1,155 @@
'menu': [
{
label: '&File'
submenu: [
{ label: 'New &Window', command: 'application:new-window' }
{ label: '&New File', command: 'application:new-file' }
{ label: '&Open...', command: 'application:open' }
{ label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' }
{ type: 'separator' }
{ label: '&Preferences...', command: 'application:show-settings' }
{ type: 'separator' }
{ label: '&Save', command: 'core:save' }
{ label: 'Save &As...', command: 'core:save-as' }
{ label: 'Save A&ll', command: 'window:save-all' }
{ type: 'separator' }
{ label: '&Close Buffer', command: 'core:close' }
{ label: 'Close All &Buffers', command: 'pane:close' }
{ label: 'Clos&e Window', command: 'window:close' }
{ type: 'separator' }
{ label: 'E&xit', command: 'application:quit' }
]
}
{
label: '&Edit'
submenu: [
{ label: '&Undo', command: 'core:undo' }
{ label: '&Redo', command: 'core:redo' }
{ type: 'separator' }
{ label: '&Cut', command: 'core:cut' }
{ label: 'C&opy', command: 'core:copy' }
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
{ label: '&Paste', command: 'core:paste' }
{ label: 'Select &All', command: 'core:select-all' }
{ type: 'separator' }
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }
{
label: 'Lines',
submenu: [
{ label: '&Indent', command: 'editor:indent-selected-rows' }
{ label: '&Outdent', command: 'editor:outdent-selected-rows' }
{ label: '&Auto Indent', command: 'editor:auto-indent' }
{ type: 'separator' }
{ label: 'Move Line &Up', command: 'editor:move-line-up' }
{ label: 'Move Line &Down', command: 'editor:move-line-down' }
{ label: 'Du&plicate Line', command: 'editor:duplicate-line' }
{ label: 'D&elete Line', command: 'editor:delete-line' }
{ label: '&Join Lines', command: 'editor:join-line' }
]
}
{
label: 'Text',
submenu: [
{ label: '&Upper Case', command: 'editor:upper-case' }
{ label: '&Lower Case', command: 'editor:lower-case' }
{ type: 'separator' }
{ label: 'Delete to End of &Word', command: 'editor:delete-to-end-of-word' }
{ label: '&Delete Line', command: 'editor:delete-line' }
{ type: 'separator' }
{ label: '&Transpose', command: 'editor:transpose' }
]
}
{
label: 'Folding',
submenu: [
{ label: '&Fold', command: 'editor:fold-current-row' }
{ label: '&Unfold', command: 'editor:unfold-current-row' }
{ label: 'Unfold &All', command: 'editor:unfold-all' }
{ type: 'separator' }
{ label: 'Fol&d All', command: 'editor:fold-all' }
{ label: 'Fold Level 1', command: 'editor:fold-at-indent-level-1' }
{ label: 'Fold Level 2', command: 'editor:fold-at-indent-level-2' }
{ label: 'Fold Level 3', command: 'editor:fold-at-indent-level-3' }
{ label: 'Fold Level 4', command: 'editor:fold-at-indent-level-4' }
{ label: 'Fold Level 5', command: 'editor:fold-at-indent-level-5' }
{ label: 'Fold Level 6', command: 'editor:fold-at-indent-level-6' }
{ label: 'Fold Level 7', command: 'editor:fold-at-indent-level-7' }
{ label: 'Fold Level 8', command: 'editor:fold-at-indent-level-8' }
{ label: 'Fold Level 9', command: 'editor:fold-at-indent-level-9' }
]
}
]
}
{
label: '&View'
submenu: [
{ label: '&Reload', command: 'window:reload' }
{ label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' }
{
label: 'Developer'
submenu: [
{ label: 'Open In &Dev Mode...', command: 'application:open-dev' }
{ label: 'Run &Atom Specs', command: 'application:run-all-specs' }
{ label: 'Run Package &Specs', command: 'window:run-package-specs' }
{ label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' }
]
}
{ type: 'separator' }
{ label: 'Toggle Soft &Wrap', command: 'editor:toggle-soft-wrap' }
]
}
{
label: '&Selection'
submenu: [
{ label: 'Add Selection &Above', command: 'editor:add-selection-above' }
{ label: 'Add Selection &Below', command: 'editor:add-selection-below' }
{ label: 'S&plit into Lines', command: 'editor:split-selections-into-lines'}
{ type: 'separator' }
{ label: 'Select to &Top', command: 'core:select-to-top' }
{ label: 'Select to Botto&m', command: 'core:select-to-bottom' }
{ type: 'separator' }
{ label: 'Select &Line', command: 'editor:select-line' }
{ label: 'Select &Word', command: 'editor:select-word' }
{ label: 'Select to Beginning of W&ord', command: 'editor:select-to-beginning-of-word' }
{ label: 'Select to Beginning of L&ine', command: 'editor:select-to-beginning-of-line' }
{ label: 'Select to First &Character of Line', command: 'editor:select-to-first-character-of-line' }
{ label: 'Select to End of Wor&d', command: 'editor:select-to-end-of-word' }
{ label: 'Select to End of Lin&e', command: 'editor:select-to-end-of-line' }
]
}
{
label: 'F&ind'
submenu: []
}
{
label: '&Packages'
submenu: []
}
{
label: '&Window'
submenu: [
{ label: 'Mi&nimize', command: 'application:minimize' }
{ label: 'Ma&ximize', command: 'application:zoom' }
{ type: 'separator' }
{ label: 'Bring &All to Front', command: 'application:bring-all-windows-to-front' }
]
}
{
label: '&Help'
submenu: [
{ label: '&About Atom...', command: 'application:about' }
{ label: "VERSION", enabled: false }
{ label: "Install &update", command: 'application:install-update', visible: false }
{ type: 'separator' }
{ label: '&Documentation', command: 'application:open-documentation' }
{ type: 'separator' }
]
}
]
+87 -93
Ver Arquivo
@@ -1,6 +1,7 @@
{
"name": "atom",
"version": "33.0.0",
"productName": "Atom",
"version": "0.45.0",
"main": "./src/browser/main.js",
"repository": {
"type": "git",
@@ -9,118 +10,110 @@
"bugs": {
"url": "https://github.com/atom/atom/issues"
},
"atomShellVersion": "0.6.6",
"licenses": [
{
"type": "Apache",
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.7.6",
"dependencies": {
"async": "0.2.6",
"bootstrap": "git://github.com/twbs/bootstrap.git#v3.0.0",
"clear-cut": "0.1.0",
"bootstrap": "git://github.com/benogle/bootstrap.git",
"clear-cut": "0.2.0",
"coffee-script": "1.6.3",
"coffeestack": "0.6.0",
"emissary": "0.9.0",
"first-mate": "0.5.0",
"fuzzaldrin": "0.1.0",
"git-utils": "0.28.0",
"emissary": "0.31.0",
"first-mate": "0.17.0",
"fs-plus": "0.14.0",
"fstream": "0.1.24",
"fuzzaldrin": "0.6.0",
"git-utils": "0.29.0",
"guid": "0.0.10",
"jasmine-focused": "~0.15.0",
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
"jasmine-tagged": "0.2.0",
"mkdirp": "0.3.5",
"less-cache": "0.9.0",
"keytar": "0.13.0",
"less-cache": "0.10.0",
"serializable": "0.3.0",
"nslog": "0.1.0",
"oniguruma": "0.22.0",
"oniguruma": "0.24.0",
"optimist": "0.4.0",
"pathwatcher": "0.8.0",
"pegjs": "0.7.0",
"plist": "git://github.com/nathansobo/node-plist.git",
"pathwatcher": "0.11.0",
"pegjs": "0.8.0",
"q": "0.9.7",
"rimraf": "2.1.4",
"scandal": "0.6.0",
"scandal": "0.11.0",
"season": "0.14.0",
"semver": "1.1.4",
"space-pen": "2.0.0",
"telepath": "0.8.1",
"space-pen": "3.1.0",
"temp": "0.5.0",
"underscore-plus": "0.2.0"
"text-buffer": "0.12.0",
"underscore-plus": "0.6.1",
"theorist": "~0.13.0",
"delegato": "~0.4.0",
"mixto": "~0.4.0"
},
"devDependencies": {
"biscotto": "0.0.17",
"formidable": "~1.0.14",
"fstream": "0.1.24",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "0.0.6",
"grunt-lesslint": "0.13.0",
"grunt-cson": "0.5.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-less": "~0.8.0",
"walkdir": "0.0.7",
"ws": "0.4.27",
"js-yaml": "~2.1.0",
"grunt-markdown": "~0.4.0",
"json-front-matter": "~0.1.3",
"grunt-shell": "~0.3.1",
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
"request": "~2.27.0"
},
"packageDependencies" : {
"atom-light-ui": "0.5.0",
"atom-light-syntax": "0.5.0",
"atom-dark-ui": "0.5.0",
"atom-dark-syntax": "0.5.0",
"base16-tomorrow-dark-theme": "0.2.0",
"solarized-dark-syntax": "0.3.0",
"archive-view": "0.11.0",
"autocomplete": "0.11.0",
"autoflow": "0.5.0",
"autosave": "0.3.0",
"bookmarks": "0.8.0",
"bracket-matcher": "0.7.0",
"collaboration": "0.34.0",
"command-logger": "0.6.0",
"command-palette": "0.6.0",
"dev-live-reload": "0.12.0",
"editor-stats": "0.5.0",
"exception-reporting": "0.5.0",
"find-and-replace": "0.32.0",
"fuzzy-finder": "0.15.0",
"gfm": "0.5.0",
"gists": "0.6.0",
"git-diff": "0.12.0",
"github-sign-in": "0.9.0",
"go-to-line": "0.8.0",
"grammar-selector": "0.8.0",
"image-view": "0.7.0",
"link": "0.7.0",
"markdown-preview": "0.12.0",
"metrics": "0.8.0",
"package-generator": "0.14.0",
"release-notes": "0.11.0",
"settings-view": "0.34.0",
"snippets": "0.11.0",
"spell-check": "0.9.0",
"status-bar": "0.15.0",
"styleguide": "0.9.0",
"symbols-view": "0.15.0",
"tabs": "0.7.0",
"terminal": "0.14.0",
"timecop": "0.9.0",
"to-the-hubs": "0.8.0",
"toml": "0.3.0",
"tree-view": "0.22.0",
"visual-bell": "0.3.0",
"whitespace": "0.7.0",
"wrap-guide": "0.4.0",
"packageDependencies": {
"atom-dark-syntax": "0.10.0",
"atom-dark-ui": "0.19.0",
"atom-light-syntax": "0.10.0",
"atom-light-ui": "0.18.0",
"base16-tomorrow-dark-theme": "0.8.0",
"solarized-dark-syntax": "0.6.0",
"solarized-light-syntax": "0.2.0",
"archive-view": "0.19.0",
"autocomplete": "0.19.0",
"autoflow": "0.11.0",
"autosave": "0.10.0",
"background-tips": "0.4.0",
"bookmarks": "0.15.0",
"bracket-matcher": "0.16.0",
"command-logger": "0.8.0",
"command-palette": "0.14.0",
"dev-live-reload": "0.22.0",
"editor-stats": "0.12.0",
"exception-reporting": "0.11.0",
"feedback": "0.22.0",
"find-and-replace": "0.74.0",
"fuzzy-finder": "0.30.0",
"gists": "0.13.0",
"git-diff": "0.21.0",
"github-sign-in": "0.15.0",
"go-to-line": "0.14.0",
"grammar-selector": "0.16.0",
"image-view": "0.15.0",
"keybinding-resolver": "0.8.0",
"markdown-preview": "0.24.0",
"metrics": "0.21.0",
"package-generator": "0.23.0",
"release-notes": "0.15.0",
"settings-view": "0.55.0",
"snippets": "0.18.0",
"spell-check": "0.18.0",
"status-bar": "0.31.0",
"styleguide": "0.19.0",
"symbols-view": "0.27.0",
"tabs": "0.17.0",
"terminal": "0.23.0",
"timecop": "0.13.0",
"to-the-hubs": "0.17.0",
"tree-view": "0.59.0",
"visual-bell": "0.6.0",
"welcome": "0.4.0",
"whitespace": "0.10.0",
"wrap-guide": "0.11.0",
"language-c": "0.2.0",
"language-clojure": "0.1.0",
"language-coffee-script": "0.1.0",
"language-coffee-script": "0.4.0",
"language-css": "0.2.0",
"language-git": "0.2.0",
"language-gfm": "0.11.0",
"language-git": "0.3.0",
"language-go": "0.2.0",
"language-html": "0.2.0",
"language-hyperlink": "0.3.0",
"language-java": "0.2.0",
"language-javascript": "0.3.0",
"language-javascript": "0.4.0",
"language-json": "0.2.0",
"language-less": "0.1.0",
"language-make": "0.1.0",
@@ -132,7 +125,7 @@
"language-property-list": "0.2.0",
"language-puppet": "0.2.0",
"language-python": "0.2.0",
"language-ruby": "0.4.0",
"language-ruby": "0.6.0",
"language-ruby-on-rails": "0.3.0",
"language-sass": "0.3.0",
"language-shellscript": "0.2.0",
@@ -140,6 +133,7 @@
"language-sql": "0.2.0",
"language-text": "0.2.0",
"language-todo": "0.2.0",
"language-toml": "0.7.0",
"language-xml": "0.2.0",
"language-yaml": "0.1.0"
},
Arquivo executável
BIN
Ver Arquivo
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 52 KiB

Arquivo binário não exibido.
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 345 KiB

+30 -12
Ver Arquivo
@@ -1,30 +1,48 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var fs = require('fs');
var path = require('path');
// OAuth token for atom-bot
// TODO Remove once all repositories are public
if (!process.env.ATOM_ACCESS_TOKEN)
process.env.ATOM_ACCESS_TOKEN = '362295be4c5258d3f7b967bbabae662a455ca2a7';
// Executes an array of commands one by one.
function executeCommands(commands, done, index) {
index = (index == undefined ? 0 : index);
if (index < commands.length)
safeExec(commands[index], executeCommands.bind(this, commands, done, index + 1));
else
if (index < commands.length) {
var command = commands[index];
var options = null;
if (typeof command !== 'string') {
options = command.options;
command = command.command;
}
safeExec(command, options, executeCommands.bind(this, commands, done, index + 1));
} else
done(null);
}
// Join multiple commands into one line.
function joinCommands() {
var commandSeparator = process.platform == 'win32' ? '&' : ';';
return Array.prototype.slice.call(arguments, 0).join(commandSeparator);
}
var apmVendorPath = path.resolve(__dirname, '..', 'vendor', 'apm');
var apmInstallPath = path.resolve(__dirname, '..', 'apm');
if (!fs.existsSync(apmInstallPath))
fs.mkdirSync(apmInstallPath);
if (!fs.existsSync(path.join(apmInstallPath, 'node_modules')))
fs.mkdirSync(path.join(apmInstallPath, 'node_modules'));
var apmFlags = process.env.JANKY_SHA1 || process.argv.indexOf('--no-color') !== -1 ? '--no-color' : '';
var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
joinCommands('cd vendor/apm', 'npm install --silent .'),
'npm install --silent vendor/apm',
{command: 'npm install --quiet', options: {cwd: path.resolve(__dirname, '..', 'build'), ignoreStdout: true}},
{command: 'npm install --quiet', options: {cwd: apmVendorPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {cwd: apmInstallPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {ignoreStdout: true}},
{command: 'node ../../apm/node_modules/atom-package-manager/bin/apm rebuild', options: {cwd: path.resolve('node_modules', 'atom-package-manager'), ignoreStdout: true}},
echoNewLine,
'node node_modules/.bin/apm install --silent'
'node apm/node_modules/atom-package-manager/bin/apm clean ' + apmFlags,
'node apm/node_modules/atom-package-manager/bin/apm install --quiet ' + apmFlags,
];
process.chdir(path.dirname(__dirname));
+6 -5
Ver Arquivo
@@ -1,12 +1,13 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
process.chdir(path.dirname(__dirname));
cp.safeExec('node script/bootstrap', function() {
// ./node_modules/.bin/grunt "$@"
var gruntPath = path.join('node_modules', '.bin', 'grunt');
var args = [gruntPath].concat(process.argv.slice(2));
cp.safeSpawn(process.execPath, args, process.exit);
// build/node_modules/.bin/grunt "$@"
var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(gruntPath, args, process.exit);
});
+5
Ver Arquivo
@@ -0,0 +1,5 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\build" %*
) ELSE (
node "%~dp0\build" %*
)
+16 -12
Ver Arquivo
@@ -1,20 +1,18 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var fs = require('fs');
var path = require('path');
process.chdir(path.dirname(__dirname));
if (process.platform != 'darwin')
throw new Error('cibuild can not run on ' + process.platform + ' yet!');
if (process.platform == 'linux')
throw new Error('cibuild can not run on linux yet!');
var homeDir = process.platform == 'win32' ? process.env.USERPROFILE : process.env.HOME;
function readEnvironmentVariables() {
var credentialsPath = '/var/lib/jenkins/config/atomcredentials';
function loadEnvironmentVariables(filePath) {
try {
var credentials = fs.readFileSync(credentialsPath, 'utf8');
var lines = credentials.trim().split('\n');
var lines = fs.readFileSync(filePath, 'utf8').trim().split('\n');
for (i in lines) {
var parts = lines[i].split('=');
var key = parts[0].trim();
@@ -24,17 +22,23 @@ function readEnvironmentVariables() {
} catch(error) { }
}
function readEnvironmentVariables() {
loadEnvironmentVariables('/var/lib/jenkins/config/atomcredentials')
loadEnvironmentVariables('/var/lib/jenkins/config/xcodekeychain')
}
readEnvironmentVariables();
cp.safeExec.bind(global, 'node script/bootstrap', function(error) {
if (error)
process.exit(1);
require('fs-plus').removeSync.bind(global, path.join(homeDir, '.atom'))
var async = require('async');
async.series([
require('rimraf').bind(global, path.join(homeDir, '.atom')),
var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var tasks = [
cp.safeExec.bind(global, 'git clean -dff'),
cp.safeExec.bind(global, 'node node_modules/.bin/apm clean'),
cp.safeExec.bind(global, 'node node_modules/.bin/grunt ci --stack --no-color'),
], function(error) {
cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color'),
]
async.series(tasks, function(error) {
process.exit(error ? 1 : 0);
});
})();
Arquivo executável
+37
Ver Arquivo
@@ -0,0 +1,37 @@
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
var os = require('os');
var removeCommand = process.platform === 'win32' ? 'del /F /Q /S ' : 'rm -rf ';
var productName = require('../package.json').productName;
process.chdir(path.dirname(__dirname));
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
var tmpdir = process.platform === 'win32' ? os.tmpdir() : '/tmp';
// Windows: Use START as a way to ignore error if Atom.exe isnt running
var killatom = process.platform === 'win32' ? 'START taskkill /F /IM ' + productName + '.exe' : 'pkill -9 ' + productName + ' || true';
var commands = [
killatom,
[__dirname, '..', 'node_modules'],
[__dirname, '..', 'build', 'node_modules'],
[__dirname, '..', 'apm', 'node_modules'],
[__dirname, '..', 'vendor', 'apm', 'node_modules'],
[__dirname, '..', 'atom-shell'],
[home, '.atom', '.node-gyp'],
[home, '.atom', 'storage'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
[tmpdir, 'atom-compile-cache'],
];
var run = function() {
var next = commands.shift();
if (!next)
process.exit(0);
if (Array.isArray(next))
next = removeCommand + path.resolve.apply(path.resolve, next);
cp.safeExec(next, run);
};
run();
+5
Ver Arquivo
@@ -0,0 +1,5 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\clean" %*
) ELSE (
node "%~dp0\clean" %*
)
-15
Ver Arquivo
@@ -1,15 +0,0 @@
#!/bin/sh
set -ex
# This entire file is a hack so that constructicon can build Atom via
# xcode
cd "$(dirname "$0")/../.."
rm -fr node_modules
./script/bootstrap
./node_modules/.bin/grunt --no-color --build-dir="$BUILT_PRODUCTS_DIR" deploy
echo "TARGET_BUILD_DIR=$BUILT_PRODUCTS_DIR"
echo "FULL_PRODUCT_NAME=Atom.app"
echo "PRODUCT_NAME=Atom"
-8
Ver Arquivo
@@ -1,8 +0,0 @@
#!/bin/sh
set -ex
cd "$(dirname "$0")/../.."
export PATH="atom-shell/Atom.app/Contents/Resources/:${PATH}"
rm -rf atom.xcodeproj
gyp --depth=. atom.gyp
Arquivo executável
+9
Ver Arquivo
@@ -0,0 +1,9 @@
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
// node build/node_modules/grunt-cli/bin/grunt "$@"
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', 'grunt-cli', 'bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = [gruntPath, '--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(process.execPath, args, process.exit);
Arquivo executável
+11
Ver Arquivo
@@ -0,0 +1,11 @@
#!/usr/bin/env coffee
path = require 'path'
CommandInstaller = require '../src/command-installer'
callback = (error, sourcePath, destinationPath) ->
unless error?
console.log "#{sourcePath} intalled to #{destinationPath}"
CommandInstaller.installAtomCommand(path.resolve(__dirname, '..'), callback)
CommandInstaller.installApmCommand(path.resolve(__dirname, '..'), callback)
+1 -1
Ver Arquivo
@@ -3,11 +3,11 @@
set -e
BUILT_PRODUCTS_DIR=$1
VERSION=$2
PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Info.plist"
HELPER_PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist"
# Update version
VERSION=$(git rev-parse --short HEAD | tr -d "\n")
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$HELPER_PLIST_PATH"
+3 -2
Ver Arquivo
@@ -1,9 +1,10 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var path = require('path');
process.chdir(path.dirname(__dirname));
safeExec('node script/bootstrap', function() {
safeExec('node node_modules/.bin/grunt ci --stack --no-color', process.exit);
var gruntPath = path.join('node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
safeExec(gruntPath + ' ci --stack --no-color', process.exit);
});
+10 -2
Ver Arquivo
@@ -7,14 +7,22 @@ exports.safeExec = function(command, options, callback) {
callback = options;
options = {};
}
if (!options)
options = {};
// This needed to be increased for `apm test` runs that generate many failures
// The default is 200KB.
options.maxBuffer = 1024 * 1024;
var child = childProcess.exec(command, options, function(error, stdout, stderr) {
if (error)
process.exit(error.code);
process.exit(error.code || 1);
else
callback(null);
});
child.stderr.pipe(process.stderr);
child.stdout.pipe(process.stdout);
if (!options.ignoreStdout)
child.stdout.pipe(process.stdout);
}
// Same with safeExec but call child_process.spawn instead.
+6 -6
Ver Arquivo
@@ -15,14 +15,14 @@ describe "AtomPackage", ->
describe "when the theme contains a single style file", ->
it "loads and applies css", ->
expect($(".editor").css("padding-bottom")).not.toBe "1234px"
themePath = project.resolve('packages/theme-with-index-css')
themePath = atom.project.resolve('packages/theme-with-index-css')
theme = Package.load(themePath)
theme.activate()
expect($(".editor").css("padding-top")).toBe "1234px"
it "parses, loads and applies less", ->
expect($(".editor").css("padding-bottom")).not.toBe "1234px"
themePath = project.resolve('packages/theme-with-index-less')
themePath = atom.project.resolve('packages/theme-with-index-less')
theme = Package.load(themePath)
theme.activate()
expect($(".editor").css("padding-top")).toBe "4321px"
@@ -33,7 +33,7 @@ describe "AtomPackage", ->
expect($(".editor").css("padding-right")).not.toBe("102px")
expect($(".editor").css("padding-bottom")).not.toBe("103px")
themePath = project.resolve('packages/theme-with-package-file')
themePath = atom.project.resolve('packages/theme-with-package-file')
theme = Package.load(themePath)
theme.activate()
expect($(".editor").css("padding-top")).toBe("101px")
@@ -46,7 +46,7 @@ describe "AtomPackage", ->
expect($(".editor").css("padding-right")).not.toBe "20px"
expect($(".editor").css("padding-bottom")).not.toBe "30px"
themePath = project.resolve('packages/theme-without-package-file')
themePath = atom.project.resolve('packages/theme-without-package-file')
theme = Package.load(themePath)
theme.activate()
expect($(".editor").css("padding-top")).toBe "10px"
@@ -55,7 +55,7 @@ describe "AtomPackage", ->
describe "reloading a theme", ->
beforeEach ->
themePath = project.resolve('packages/theme-with-package-file')
themePath = atom.project.resolve('packages/theme-with-package-file')
theme = Package.load(themePath)
theme.activate()
@@ -66,7 +66,7 @@ describe "AtomPackage", ->
describe "events", ->
beforeEach ->
themePath = project.resolve('packages/theme-with-package-file')
themePath = atom.project.resolve('packages/theme-with-package-file')
theme = Package.load(themePath)
theme.activate()
+137 -117
Ver Arquivo
@@ -1,20 +1,20 @@
{$, $$, fs, RootView} = require 'atom'
{$, $$, fs, WorkspaceView} = require 'atom'
Exec = require('child_process').exec
path = require 'path'
ThemeManager = require '../src/theme-manager'
describe "the `atom` global", ->
beforeEach ->
window.rootView = new RootView
atom.workspaceView = new WorkspaceView
describe "package lifecycle methods", ->
describe ".loadPackage(name)", ->
describe "when the package has deferred deserializers", ->
it "requires the package's main module if one of its deferred deserializers is referenced", ->
pack = atom.loadPackage('package-with-activation-events')
pack = atom.packages.loadPackage('package-with-activation-events')
spyOn(pack, 'activateStylesheets').andCallThrough()
expect(pack.mainModule).toBeNull()
object = deserialize({deserializer: 'Foo', data: 5})
object = atom.deserializers.deserialize({deserializer: 'Foo', data: 5})
expect(pack.mainModule).toBeDefined()
expect(object.constructor.name).toBe 'Foo'
expect(object.data).toBe 5
@@ -22,35 +22,35 @@ describe "the `atom` global", ->
it "continues if the package has an invalid package.json", ->
spyOn(console, 'warn')
config.set("core.disabledPackages", [])
expect(-> atom.loadPackage("package-with-broken-package-json")).not.toThrow()
atom.config.set("core.disabledPackages", [])
expect(-> atom.packages.loadPackage("package-with-broken-package-json")).not.toThrow()
it "continues if the package has an invalid keymap", ->
config.set("core.disabledPackages", [])
expect(-> atom.loadPackage("package-with-broken-keymap")).not.toThrow()
atom.config.set("core.disabledPackages", [])
expect(-> atom.packages.loadPackage("package-with-broken-keymap")).not.toThrow()
describe ".unloadPackage(name)", ->
describe "when the package is active", ->
it "throws an error", ->
pack = atom.activatePackage('package-with-main')
expect(atom.isPackageLoaded(pack.name)).toBeTruthy()
expect(atom.isPackageActive(pack.name)).toBeTruthy()
expect( -> atom.unloadPackage(pack.name)).toThrow()
expect(atom.isPackageLoaded(pack.name)).toBeTruthy()
expect(atom.isPackageActive(pack.name)).toBeTruthy()
pack = atom.packages.activatePackage('package-with-main')
expect(atom.packages.isPackageLoaded(pack.name)).toBeTruthy()
expect(atom.packages.isPackageActive(pack.name)).toBeTruthy()
expect( -> atom.packages.unloadPackage(pack.name)).toThrow()
expect(atom.packages.isPackageLoaded(pack.name)).toBeTruthy()
expect(atom.packages.isPackageActive(pack.name)).toBeTruthy()
describe "when the package is not loaded", ->
it "throws an error", ->
expect(atom.isPackageLoaded('unloaded')).toBeFalsy()
expect( -> atom.unloadPackage('unloaded')).toThrow()
expect(atom.isPackageLoaded('unloaded')).toBeFalsy()
expect(atom.packages.isPackageLoaded('unloaded')).toBeFalsy()
expect( -> atom.packages.unloadPackage('unloaded')).toThrow()
expect(atom.packages.isPackageLoaded('unloaded')).toBeFalsy()
describe "when the package is loaded", ->
it "no longers reports it as being loaded", ->
pack = atom.loadPackage('package-with-main')
expect(atom.isPackageLoaded(pack.name)).toBeTruthy()
atom.unloadPackage(pack.name)
expect(atom.isPackageLoaded(pack.name)).toBeFalsy()
pack = atom.packages.loadPackage('package-with-main')
expect(atom.packages.isPackageLoaded(pack.name)).toBeTruthy()
atom.packages.unloadPackage(pack.name)
expect(atom.packages.isPackageLoaded(pack.name)).toBeFalsy()
describe ".activatePackage(id)", ->
describe "atom packages", ->
@@ -59,7 +59,7 @@ describe "the `atom` global", ->
it "requires the module at the specified path", ->
mainModule = require('./fixtures/packages/package-with-main/main-module')
spyOn(mainModule, 'activate')
pack = atom.activatePackage('package-with-main')
pack = atom.packages.activatePackage('package-with-main')
expect(mainModule.activate).toHaveBeenCalled()
expect(pack.mainModule).toBe mainModule
@@ -67,15 +67,15 @@ describe "the `atom` global", ->
it "requires index.coffee", ->
indexModule = require('./fixtures/packages/package-with-index/index')
spyOn(indexModule, 'activate')
pack = atom.activatePackage('package-with-index')
pack = atom.packages.activatePackage('package-with-index')
expect(indexModule.activate).toHaveBeenCalled()
expect(pack.mainModule).toBe indexModule
it "assigns config defaults from the module", ->
expect(config.get('package-with-config-defaults.numbers.one')).toBeUndefined()
atom.activatePackage('package-with-config-defaults')
expect(config.get('package-with-config-defaults.numbers.one')).toBe 1
expect(config.get('package-with-config-defaults.numbers.two')).toBe 2
expect(atom.config.get('package-with-config-defaults.numbers.one')).toBeUndefined()
atom.packages.activatePackage('package-with-config-defaults')
expect(atom.config.get('package-with-config-defaults.numbers.one')).toBe 1
expect(atom.config.get('package-with-config-defaults.numbers.two')).toBe 2
describe "when the package metadata includes activation events", ->
[mainModule, pack] = []
@@ -85,24 +85,24 @@ describe "the `atom` global", ->
spyOn(mainModule, 'activate').andCallThrough()
AtomPackage = require '../src/atom-package'
spyOn(AtomPackage.prototype, 'requireMainModule').andCallThrough()
pack = atom.activatePackage('package-with-activation-events')
pack = atom.packages.activatePackage('package-with-activation-events')
it "defers requiring/activating the main module until an activation event bubbles to the root view", ->
expect(pack.requireMainModule).not.toHaveBeenCalled()
expect(mainModule.activate).not.toHaveBeenCalled()
rootView.trigger 'activation-event'
atom.workspaceView.trigger 'activation-event'
expect(mainModule.activate).toHaveBeenCalled()
it "triggers the activation event on all handlers registered during activation", ->
rootView.openSync()
editor = rootView.getActiveView()
atom.workspaceView.openSync()
editorView = atom.workspaceView.getActiveView()
eventHandler = jasmine.createSpy("activation-event")
editor.command 'activation-event', eventHandler
editor.trigger 'activation-event'
editorView.command 'activation-event', eventHandler
editorView.trigger 'activation-event'
expect(mainModule.activate.callCount).toBe 1
expect(mainModule.activationEventCallCount).toBe 1
expect(eventHandler.callCount).toBe 1
editor.trigger 'activation-event'
editorView.trigger 'activation-event'
expect(mainModule.activationEventCallCount).toBe 2
expect(eventHandler.callCount).toBe 2
expect(mainModule.activate.callCount).toBe 1
@@ -111,23 +111,23 @@ describe "the `atom` global", ->
it "does not throw an exception", ->
spyOn(console, "error")
spyOn(console, "warn").andCallThrough()
expect(-> atom.activatePackage('package-without-module')).not.toThrow()
expect(-> atom.packages.activatePackage('package-without-module')).not.toThrow()
expect(console.error).not.toHaveBeenCalled()
expect(console.warn).not.toHaveBeenCalled()
it "passes the activate method the package's previously serialized state if it exists", ->
pack = atom.activatePackage("package-with-serialization")
pack = atom.packages.activatePackage("package-with-serialization")
expect(pack.mainModule.someNumber).not.toBe 77
pack.mainModule.someNumber = 77
atom.deactivatePackage("package-with-serialization")
atom.packages.deactivatePackage("package-with-serialization")
spyOn(pack.mainModule, 'activate').andCallThrough()
atom.activatePackage("package-with-serialization")
atom.packages.activatePackage("package-with-serialization")
expect(pack.mainModule.activate).toHaveBeenCalledWith({someNumber: 77})
it "logs warning instead of throwing an exception if the package fails to load", ->
config.set("core.disabledPackages", [])
atom.config.set("core.disabledPackages", [])
spyOn(console, "warn")
expect(-> atom.activatePackage("package-that-throws-an-exception")).not.toThrow()
expect(-> atom.packages.activatePackage("package-that-throws-an-exception")).not.toThrow()
expect(console.warn).toHaveBeenCalled()
describe "keymap loading", ->
@@ -137,28 +137,28 @@ describe "the `atom` global", ->
element2 = $$ -> @div class: 'test-2'
element3 = $$ -> @div class: 'test-3'
expect(keymap.bindingsForElement(element1)['ctrl-z']).toBeUndefined()
expect(keymap.bindingsForElement(element2)['ctrl-z']).toBeUndefined()
expect(keymap.bindingsForElement(element3)['ctrl-z']).toBeUndefined()
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element2)).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element3)).toHaveLength 0
atom.activatePackage("package-with-keymaps")
atom.packages.activatePackage("package-with-keymaps")
expect(keymap.bindingsForElement(element1)['ctrl-z']).toBe "test-1"
expect(keymap.bindingsForElement(element2)['ctrl-z']).toBe "test-2"
expect(keymap.bindingsForElement(element3)['ctrl-z']).toBeUndefined()
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)[0].command).toBe "test-1"
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element2)[0].command).toBe "test-2"
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element3)).toHaveLength 0
describe "when the metadata contains a 'keymaps' manifest", ->
it "loads only the keymaps specified by the manifest, in the specified order", ->
element1 = $$ -> @div class: 'test-1'
element3 = $$ -> @div class: 'test-3'
expect(keymap.bindingsForElement(element1)['ctrl-z']).toBeUndefined()
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)).toHaveLength 0
atom.activatePackage("package-with-keymaps-manifest")
atom.packages.activatePackage("package-with-keymaps-manifest")
expect(keymap.bindingsForElement(element1)['ctrl-z']).toBe 'keymap-1'
expect(keymap.bindingsForElement(element1)['ctrl-n']).toBe 'keymap-2'
expect(keymap.bindingsForElement(element3)['ctrl-y']).toBeUndefined()
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)[0].command).toBe 'keymap-1'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-n', element1)[0].command).toBe 'keymap-2'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-y', element3)).toHaveLength 0
describe "menu loading", ->
beforeEach ->
@@ -171,7 +171,7 @@ describe "the `atom` global", ->
expect(atom.contextMenu.definitionsForElement(element)).toEqual []
atom.activatePackage("package-with-menus")
atom.packages.activatePackage("package-with-menus")
expect(atom.menu.template.length).toBe 2
expect(atom.menu.template[0].label).toBe "Second to Last"
@@ -186,7 +186,7 @@ describe "the `atom` global", ->
expect(atom.contextMenu.definitionsForElement(element)).toEqual []
atom.activatePackage("package-with-menus-manifest")
atom.packages.activatePackage("package-with-menus-manifest")
expect(atom.menu.template[0].label).toBe "Second to Last"
expect(atom.menu.template[1].label).toBe "Last"
@@ -200,11 +200,16 @@ describe "the `atom` global", ->
one = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/1.css")
two = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/2.less")
three = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/3.css")
one = atom.themes.stringToId(one)
two = atom.themes.stringToId(two)
three = atom.themes.stringToId(three)
expect(atom.themes.stylesheetElementForId(one)).not.toExist()
expect(atom.themes.stylesheetElementForId(two)).not.toExist()
expect(atom.themes.stylesheetElementForId(three)).not.toExist()
atom.activatePackage("package-with-stylesheets-manifest")
atom.packages.activatePackage("package-with-stylesheets-manifest")
expect(atom.themes.stylesheetElementForId(one)).toExist()
expect(atom.themes.stylesheetElementForId(two)).toExist()
@@ -216,11 +221,17 @@ describe "the `atom` global", ->
one = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/1.css")
two = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/2.less")
three = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/3.css")
one = atom.themes.stringToId(one)
two = atom.themes.stringToId(two)
three = atom.themes.stringToId(three)
expect(atom.themes.stylesheetElementForId(one)).not.toExist()
expect(atom.themes.stylesheetElementForId(two)).not.toExist()
expect(atom.themes.stylesheetElementForId(three)).not.toExist()
atom.activatePackage("package-with-stylesheets")
atom.packages.activatePackage("package-with-stylesheets")
expect(atom.themes.stylesheetElementForId(one)).toExist()
expect(atom.themes.stylesheetElementForId(two)).toExist()
expect(atom.themes.stylesheetElementForId(three)).toExist()
@@ -228,90 +239,91 @@ describe "the `atom` global", ->
describe "grammar loading", ->
it "loads the package's grammars", ->
atom.activatePackage('package-with-grammars')
expect(syntax.selectGrammar('a.alot').name).toBe 'Alot'
expect(syntax.selectGrammar('a.alittle').name).toBe 'Alittle'
atom.packages.activatePackage('package-with-grammars')
expect(atom.syntax.selectGrammar('a.alot').name).toBe 'Alot'
expect(atom.syntax.selectGrammar('a.alittle').name).toBe 'Alittle'
describe "scoped-property loading", ->
it "loads the scoped properties", ->
atom.activatePackage("package-with-scoped-properties")
expect(syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBe '^a'
atom.packages.activatePackage("package-with-scoped-properties")
expect(atom.syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBe '^a'
describe "textmate packages", ->
it "loads the package's grammars", ->
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
atom.activatePackage('language-ruby', sync: true)
expect(syntax.selectGrammar("file.rb").name).toBe "Ruby"
expect(atom.syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
atom.packages.activatePackage('language-ruby', sync: true)
expect(atom.syntax.selectGrammar("file.rb").name).toBe "Ruby"
it "translates the package's scoped properties to Atom terms", ->
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
atom.activatePackage('language-ruby', sync: true)
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBe '# '
expect(atom.syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
atom.packages.activatePackage('language-ruby', sync: true)
expect(atom.syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBe '# '
describe "when the package has no grammars but does have preferences", ->
it "loads the package's preferences as scoped properties", ->
jasmine.unspy(window, 'setTimeout')
spyOn(syntax, 'addProperties').andCallThrough()
spyOn(atom.syntax, 'addProperties').andCallThrough()
atom.activatePackage('package-with-preferences-tmbundle')
atom.packages.activatePackage('package-with-preferences-tmbundle')
waitsFor ->
syntax.addProperties.callCount > 0
atom.syntax.addProperties.callCount > 0
runs ->
expect(syntax.getProperty(['.source.pref'], 'editor.increaseIndentPattern')).toBe '^abc$'
expect(atom.syntax.getProperty(['.source.pref'], 'editor.increaseIndentPattern')).toBe '^abc$'
describe ".deactivatePackage(id)", ->
describe "atom packages", ->
it "calls `deactivate` on the package's main module if activate was successful", ->
pack = atom.activatePackage("package-with-deactivate")
expect(atom.isPackageActive("package-with-deactivate")).toBeTruthy()
pack = atom.packages.activatePackage("package-with-deactivate")
expect(atom.packages.isPackageActive("package-with-deactivate")).toBeTruthy()
spyOn(pack.mainModule, 'deactivate').andCallThrough()
atom.deactivatePackage("package-with-deactivate")
atom.packages.deactivatePackage("package-with-deactivate")
expect(pack.mainModule.deactivate).toHaveBeenCalled()
expect(atom.isPackageActive("package-with-module")).toBeFalsy()
expect(atom.packages.isPackageActive("package-with-module")).toBeFalsy()
spyOn(console, 'warn')
badPack = atom.activatePackage("package-that-throws-on-activate")
expect(atom.isPackageActive("package-that-throws-on-activate")).toBeTruthy()
badPack = atom.packages.activatePackage("package-that-throws-on-activate")
expect(atom.packages.isPackageActive("package-that-throws-on-activate")).toBeTruthy()
spyOn(badPack.mainModule, 'deactivate').andCallThrough()
atom.deactivatePackage("package-that-throws-on-activate")
atom.packages.deactivatePackage("package-that-throws-on-activate")
expect(badPack.mainModule.deactivate).not.toHaveBeenCalled()
expect(atom.isPackageActive("package-that-throws-on-activate")).toBeFalsy()
expect(atom.packages.isPackageActive("package-that-throws-on-activate")).toBeFalsy()
it "does not serialize packages that have not been activated called on their main module", ->
spyOn(console, 'warn')
badPack = atom.activatePackage("package-that-throws-on-activate")
badPack = atom.packages.activatePackage("package-that-throws-on-activate")
spyOn(badPack.mainModule, 'serialize').andCallThrough()
atom.deactivatePackage("package-that-throws-on-activate")
atom.packages.deactivatePackage("package-that-throws-on-activate")
expect(badPack.mainModule.serialize).not.toHaveBeenCalled()
it "absorbs exceptions that are thrown by the package module's serialize methods", ->
spyOn(console, 'error')
atom.activatePackage('package-with-serialize-error', immediate: true)
atom.activatePackage('package-with-serialization', immediate: true)
atom.deactivatePackages()
atom.packages.activatePackage('package-with-serialize-error', immediate: true)
atom.packages.activatePackage('package-with-serialization', immediate: true)
atom.packages.deactivatePackages()
expect(atom.packages.packageStates['package-with-serialize-error']).toBeUndefined()
expect(atom.packages.packageStates['package-with-serialization']).toEqual someNumber: 1
expect(console.error).toHaveBeenCalled()
it "removes the package's grammars", ->
atom.activatePackage('package-with-grammars')
atom.deactivatePackage('package-with-grammars')
expect(syntax.selectGrammar('a.alot').name).toBe 'Null Grammar'
expect(syntax.selectGrammar('a.alittle').name).toBe 'Null Grammar'
atom.packages.activatePackage('package-with-grammars')
atom.packages.deactivatePackage('package-with-grammars')
expect(atom.syntax.selectGrammar('a.alot').name).toBe 'Null Grammar'
expect(atom.syntax.selectGrammar('a.alittle').name).toBe 'Null Grammar'
it "removes the package's keymaps", ->
atom.activatePackage('package-with-keymaps')
atom.deactivatePackage('package-with-keymaps')
expect(keymap.bindingsForElement($$ -> @div class: 'test-1')['ctrl-z']).toBeUndefined()
expect(keymap.bindingsForElement($$ -> @div class: 'test-2')['ctrl-z']).toBeUndefined()
atom.packages.activatePackage('package-with-keymaps')
atom.packages.deactivatePackage('package-with-keymaps')
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', $$ -> @div class: 'test-1')).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', $$ -> @div class: 'test-2')).toHaveLength 0
it "removes the package's stylesheets", ->
atom.activatePackage('package-with-stylesheets')
atom.deactivatePackage('package-with-stylesheets')
atom.packages.activatePackage('package-with-stylesheets')
atom.packages.deactivatePackage('package-with-stylesheets')
one = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/1.css")
two = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/2.less")
three = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/3.css")
@@ -320,23 +332,23 @@ describe "the `atom` global", ->
expect(atom.themes.stylesheetElementForId(three)).not.toExist()
it "removes the package's scoped-properties", ->
atom.activatePackage("package-with-scoped-properties")
expect(syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBe '^a'
atom.deactivatePackage("package-with-scoped-properties")
expect(syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBeUndefined()
atom.packages.activatePackage("package-with-scoped-properties")
expect(atom.syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBe '^a'
atom.packages.deactivatePackage("package-with-scoped-properties")
expect(atom.syntax.getProperty ['.source.omg'], 'editor.increaseIndentPattern').toBeUndefined()
describe "textmate packages", ->
it "removes the package's grammars", ->
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
atom.activatePackage('language-ruby', sync: true)
expect(syntax.selectGrammar("file.rb").name).toBe "Ruby"
atom.deactivatePackage('language-ruby')
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
expect(atom.syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
atom.packages.activatePackage('language-ruby', sync: true)
expect(atom.syntax.selectGrammar("file.rb").name).toBe "Ruby"
atom.packages.deactivatePackage('language-ruby')
expect(atom.syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
it "removes the package's scoped properties", ->
atom.activatePackage('language-ruby', sync: true)
atom.deactivatePackage('language-ruby')
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
atom.packages.activatePackage('language-ruby', sync: true)
atom.packages.deactivatePackage('language-ruby')
expect(atom.syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
describe ".activate()", ->
packageActivator = null
@@ -376,7 +388,7 @@ describe "the `atom` global", ->
packageName = 'package-with-main'
atom.config.pushAtKeyPath('core.disabledPackages', packageName)
atom.packages.observeDisabledPackages()
expect(config.get('core.disabledPackages')).toContain packageName
expect(atom.config.get('core.disabledPackages')).toContain packageName
pack = atom.packages.enablePackage(packageName)
@@ -384,19 +396,19 @@ describe "the `atom` global", ->
activatedPackages = atom.packages.getActivePackages()
expect(loadedPackages).toContain(pack)
expect(activatedPackages).toContain(pack)
expect(config.get('core.disabledPackages')).not.toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
it ".disablePackage() disables an enabled package", ->
packageName = 'package-with-main'
atom.packages.activatePackage(packageName)
atom.packages.observeDisabledPackages()
expect(config.get('core.disabledPackages')).not.toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
pack = atom.packages.disablePackage(packageName)
activatedPackages = atom.packages.getActivePackages()
expect(activatedPackages).not.toContain(pack)
expect(config.get('core.disabledPackages')).toContain packageName
expect(atom.config.get('core.disabledPackages')).toContain packageName
describe "with themes", ->
beforeEach ->
@@ -409,20 +421,28 @@ describe "the `atom` global", ->
it ".enablePackage() and .disablePackage() enables and disables a theme", ->
packageName = 'theme-with-package-file'
expect(config.get('core.themes')).not.toContain packageName
expect(config.get('core.disabledPackages')).not.toContain packageName
expect(atom.config.get('core.themes')).not.toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
# enabling of theme
pack = atom.packages.enablePackage(packageName)
activatedPackages = atom.packages.getActivePackages()
expect(activatedPackages).toContain(pack)
expect(config.get('core.themes')).toContain packageName
expect(config.get('core.disabledPackages')).not.toContain packageName
expect(atom.config.get('core.themes')).toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
# disabling of theme
pack = atom.packages.disablePackage(packageName)
activatedPackages = atom.packages.getActivePackages()
expect(activatedPackages).not.toContain(pack)
expect(config.get('core.themes')).not.toContain packageName
expect(config.get('core.themes')).not.toContain packageName
expect(config.get('core.disabledPackages')).not.toContain packageName
expect(atom.config.get('core.themes')).not.toContain packageName
expect(atom.config.get('core.themes')).not.toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
describe ".isReleasedVersion()", ->
it "returns false if the version is a SHA and true otherwise", ->
version = '0.1.0'
spyOn(atom.constructor, 'getVersion').andCallFake -> version
expect(atom.isReleasedVersion()).toBe true
version = '36b5518'
expect(atom.isReleasedVersion()).toBe false
+18 -17
Ver Arquivo
@@ -12,24 +12,25 @@ describe "install(commandPath, callback)", ->
spyOn(installer, 'findInstallDirectory').andCallFake (callback) ->
callback(directory)
fs.remove(directory) if fs.exists(directory)
fs.removeSync(directory) if fs.existsSync(directory)
it "symlinks the command and makes it executable", ->
fs.writeSync(commandPath, 'test')
expect(fs.isFileSync(commandPath)).toBeTruthy()
expect(fs.isExecutableSync(commandPath)).toBeFalsy()
expect(fs.isFileSync(destinationPath)).toBeFalsy()
describe "on #darwin", ->
it "symlinks the command and makes it executable", ->
fs.writeFileSync(commandPath, 'test')
expect(fs.isFileSync(commandPath)).toBeTruthy()
expect(fs.isExecutableSync(commandPath)).toBeFalsy()
expect(fs.isFileSync(destinationPath)).toBeFalsy()
installDone = false
installError = null
installer.install commandPath, (error) ->
installDone = true
installError = error
installDone = false
installError = null
installer.install commandPath, (error) ->
installDone = true
installError = error
waitsFor -> installDone
waitsFor -> installDone
runs ->
expect(installError).toBeNull()
expect(fs.isFileSync(destinationPath)).toBeTruthy()
expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath)
expect(fs.isExecutableSync(destinationPath)).toBeTruthy()
runs ->
expect(installError).toBeNull()
expect(fs.isFileSync(destinationPath)).toBeTruthy()
expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath)
expect(fs.isExecutableSync(destinationPath)).toBeTruthy()
+146 -122
Ver Arquivo
@@ -8,272 +8,296 @@ describe "Config", ->
describe ".get(keyPath)", ->
it "allows a key path's value to be read", ->
expect(config.set("foo.bar.baz", 42)).toBe 42
expect(config.get("foo.bar.baz")).toBe 42
expect(config.get("bogus.key.path")).toBeUndefined()
expect(atom.config.set("foo.bar.baz", 42)).toBe 42
expect(atom.config.get("foo.bar.baz")).toBe 42
expect(atom.config.get("bogus.key.path")).toBeUndefined()
it "returns a deep clone of the key path's value", ->
config.set('value', array: [1, b: 2, 3])
retrievedValue = config.get('value')
atom.config.set('value', array: [1, b: 2, 3])
retrievedValue = atom.config.get('value')
retrievedValue.array[0] = 4
retrievedValue.array[1].b = 2.1
expect(config.get('value')).toEqual(array: [1, b: 2, 3])
expect(atom.config.get('value')).toEqual(array: [1, b: 2, 3])
describe ".set(keyPath, value)", ->
it "allows a key path's value to be written", ->
expect(config.set("foo.bar.baz", 42)).toBe 42
expect(config.get("foo.bar.baz")).toBe 42
expect(atom.config.set("foo.bar.baz", 42)).toBe 42
expect(atom.config.get("foo.bar.baz")).toBe 42
it "updates observers and saves when a key path is set", ->
observeHandler = jasmine.createSpy "observeHandler"
config.observe "foo.bar.baz", observeHandler
atom.config.observe "foo.bar.baz", observeHandler
observeHandler.reset()
config.set("foo.bar.baz", 42)
atom.config.set("foo.bar.baz", 42)
expect(config.save).toHaveBeenCalled()
expect(atom.config.save).toHaveBeenCalled()
expect(observeHandler).toHaveBeenCalledWith 42, {previous: undefined}
describe "when the value equals the default value", ->
it "does not store the value", ->
config.setDefaults("foo", same: 1, changes: 1)
expect(config.settings.foo).toBeUndefined()
config.set('foo.same', 1)
config.set('foo.changes', 2)
expect(config.settings.foo).toEqual {changes: 2}
atom.config.setDefaults("foo", same: 1, changes: 1)
expect(atom.config.settings.foo).toBeUndefined()
atom.config.set('foo.same', 1)
atom.config.set('foo.changes', 2)
expect(atom.config.settings.foo).toEqual {changes: 2}
config.set('foo.changes', 1)
expect(config.settings.foo).toEqual {}
atom.config.set('foo.changes', 1)
expect(atom.config.settings.foo).toEqual {}
describe ".toggle(keyPath)", ->
it "negates the boolean value of the current key path value", ->
atom.config.set('foo.a', 1)
atom.config.toggle('foo.a')
expect(atom.config.get('foo.a')).toBe false
atom.config.set('foo.a', '')
atom.config.toggle('foo.a')
expect(atom.config.get('foo.a')).toBe true
atom.config.set('foo.a', null)
atom.config.toggle('foo.a')
expect(atom.config.get('foo.a')).toBe true
atom.config.set('foo.a', true)
atom.config.toggle('foo.a')
expect(atom.config.get('foo.a')).toBe false
describe ".pushAtKeyPath(keyPath, value)", ->
it "pushes the given value to the array at the key path and updates observers", ->
config.set("foo.bar.baz", ["a"])
atom.config.set("foo.bar.baz", ["a"])
observeHandler = jasmine.createSpy "observeHandler"
config.observe "foo.bar.baz", observeHandler
atom.config.observe "foo.bar.baz", observeHandler
observeHandler.reset()
expect(config.pushAtKeyPath("foo.bar.baz", "b")).toBe 2
expect(config.get("foo.bar.baz")).toEqual ["a", "b"]
expect(observeHandler).toHaveBeenCalledWith config.get("foo.bar.baz"), {previous: ['a']}
expect(atom.config.pushAtKeyPath("foo.bar.baz", "b")).toBe 2
expect(atom.config.get("foo.bar.baz")).toEqual ["a", "b"]
expect(observeHandler).toHaveBeenCalledWith atom.config.get("foo.bar.baz"), {previous: ['a']}
describe ".unshiftAtKeyPath(keyPath, value)", ->
it "unshifts the given value to the array at the key path and updates observers", ->
config.set("foo.bar.baz", ["b"])
atom.config.set("foo.bar.baz", ["b"])
observeHandler = jasmine.createSpy "observeHandler"
config.observe "foo.bar.baz", observeHandler
atom.config.observe "foo.bar.baz", observeHandler
observeHandler.reset()
expect(config.unshiftAtKeyPath("foo.bar.baz", "a")).toBe 2
expect(config.get("foo.bar.baz")).toEqual ["a", "b"]
expect(observeHandler).toHaveBeenCalledWith config.get("foo.bar.baz"), {previous: ['b']}
expect(atom.config.unshiftAtKeyPath("foo.bar.baz", "a")).toBe 2
expect(atom.config.get("foo.bar.baz")).toEqual ["a", "b"]
expect(observeHandler).toHaveBeenCalledWith atom.config.get("foo.bar.baz"), {previous: ['b']}
describe ".removeAtKeyPath(keyPath, value)", ->
it "removes the given value from the array at the key path and updates observers", ->
config.set("foo.bar.baz", ["a", "b", "c"])
atom.config.set("foo.bar.baz", ["a", "b", "c"])
observeHandler = jasmine.createSpy "observeHandler"
config.observe "foo.bar.baz", observeHandler
atom.config.observe "foo.bar.baz", observeHandler
observeHandler.reset()
expect(config.removeAtKeyPath("foo.bar.baz", "b")).toEqual ["a", "c"]
expect(config.get("foo.bar.baz")).toEqual ["a", "c"]
expect(observeHandler).toHaveBeenCalledWith config.get("foo.bar.baz"), {previous: ['a', 'b', 'c']}
expect(atom.config.removeAtKeyPath("foo.bar.baz", "b")).toEqual ["a", "c"]
expect(atom.config.get("foo.bar.baz")).toEqual ["a", "c"]
expect(observeHandler).toHaveBeenCalledWith atom.config.get("foo.bar.baz"), {previous: ['a', 'b', 'c']}
describe ".getPositiveInt(keyPath, defaultValue)", ->
it "returns the proper current or default value", ->
config.set('editor.preferredLineLength', 0)
expect(config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
config.set('editor.preferredLineLength', -1234)
expect(config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
config.set('editor.preferredLineLength', 'abcd')
expect(config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
config.set('editor.preferredLineLength', null)
expect(config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
atom.config.set('editor.preferredLineLength', 0)
expect(atom.config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
atom.config.set('editor.preferredLineLength', -1234)
expect(atom.config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
atom.config.set('editor.preferredLineLength', 'abcd')
expect(atom.config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
atom.config.set('editor.preferredLineLength', null)
expect(atom.config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
describe ".save()", ->
nodeFs = require 'fs'
CSON = require 'season'
beforeEach ->
spyOn(nodeFs, 'writeFileSync')
jasmine.unspy config, 'save'
spyOn(CSON, 'writeFileSync')
jasmine.unspy atom.config, 'save'
describe "when ~/.atom/config.json exists", ->
it "writes any non-default properties to ~/.atom/config.json", ->
config.configFilePath = path.join(config.configDirPath, "config.json")
config.set("a.b.c", 1)
config.set("a.b.d", 2)
config.set("x.y.z", 3)
config.setDefaults("a.b", e: 4, f: 5)
atom.config.configFilePath = path.join(atom.config.configDirPath, "atom.config.json")
atom.config.set("a.b.c", 1)
atom.config.set("a.b.d", 2)
atom.config.set("x.y.z", 3)
atom.config.setDefaults("a.b", e: 4, f: 5)
nodeFs.writeFileSync.reset()
config.save()
CSON.writeFileSync.reset()
atom.config.save()
expect(nodeFs.writeFileSync.argsForCall[0][0]).toBe(path.join(config.configDirPath, "config.json"))
writtenConfig = JSON.parse(nodeFs.writeFileSync.argsForCall[0][1])
expect(writtenConfig).toEqual config.settings
expect(CSON.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.json"))
writtenConfig = CSON.writeFileSync.argsForCall[0][1]
expect(writtenConfig).toBe atom.config.settings
describe "when ~/.atom/config.json doesn't exist", ->
it "writes any non-default properties to ~/.atom/config.cson", ->
config.configFilePath = path.join(config.configDirPath, "config.cson")
config.set("a.b.c", 1)
config.set("a.b.d", 2)
config.set("x.y.z", 3)
config.setDefaults("a.b", e: 4, f: 5)
atom.config.configFilePath = path.join(atom.config.configDirPath, "atom.config.cson")
atom.config.set("a.b.c", 1)
atom.config.set("a.b.d", 2)
atom.config.set("x.y.z", 3)
atom.config.setDefaults("a.b", e: 4, f: 5)
nodeFs.writeFileSync.reset()
config.save()
CSON.writeFileSync.reset()
atom.config.save()
expect(nodeFs.writeFileSync.argsForCall[0][0]).toBe(path.join(config.configDirPath, "config.cson"))
expect(CSON.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.cson"))
CoffeeScript = require 'coffee-script'
writtenConfig = CoffeeScript.eval(nodeFs.writeFileSync.argsForCall[0][1], bare: true)
expect(writtenConfig).toEqual config.settings
writtenConfig = CSON.writeFileSync.argsForCall[0][1]
expect(writtenConfig).toEqual atom.config.settings
describe ".setDefaults(keyPath, defaults)", ->
it "assigns any previously-unassigned keys to the object at the key path", ->
config.set("foo.bar.baz", a: 1)
config.setDefaults("foo.bar.baz", a: 2, b: 3, c: 4)
expect(config.get("foo.bar.baz.a")).toBe 1
expect(config.get("foo.bar.baz.b")).toBe 3
expect(config.get("foo.bar.baz.c")).toBe 4
atom.config.set("foo.bar.baz", a: 1)
atom.config.setDefaults("foo.bar.baz", a: 2, b: 3, c: 4)
expect(atom.config.get("foo.bar.baz.a")).toBe 1
expect(atom.config.get("foo.bar.baz.b")).toBe 3
expect(atom.config.get("foo.bar.baz.c")).toBe 4
config.setDefaults("foo.quux", x: 0, y: 1)
expect(config.get("foo.quux.x")).toBe 0
expect(config.get("foo.quux.y")).toBe 1
atom.config.setDefaults("foo.quux", x: 0, y: 1)
expect(atom.config.get("foo.quux.x")).toBe 0
expect(atom.config.get("foo.quux.y")).toBe 1
describe ".observe(keyPath)", ->
observeHandler = null
[observeHandler, observeSubscription] = []
beforeEach ->
observeHandler = jasmine.createSpy("observeHandler")
config.set("foo.bar.baz", "value 1")
config.observe "foo.bar.baz", observeHandler
atom.config.set("foo.bar.baz", "value 1")
observeSubscription = atom.config.observe "foo.bar.baz", observeHandler
it "fires the given callback with the current value at the keypath", ->
expect(observeHandler).toHaveBeenCalledWith("value 1")
it "fires the callback every time the observed value changes", ->
observeHandler.reset() # clear the initial call
config.set('foo.bar.baz', "value 2")
atom.config.set('foo.bar.baz', "value 2")
expect(observeHandler).toHaveBeenCalledWith("value 2", {previous: 'value 1'})
observeHandler.reset()
config.set('foo.bar.baz', "value 1")
atom.config.set('foo.bar.baz', "value 1")
expect(observeHandler).toHaveBeenCalledWith("value 1", {previous: 'value 2'})
it "fires the callback when the observed value is deleted", ->
observeHandler.reset() # clear the initial call
config.set('foo.bar.baz', undefined)
atom.config.set('foo.bar.baz', undefined)
expect(observeHandler).toHaveBeenCalledWith(undefined, {previous: 'value 1'})
it "fires the callback when the full key path goes into and out of existence", ->
observeHandler.reset() # clear the initial call
config.set("foo.bar", undefined)
atom.config.set("foo.bar", undefined)
expect(observeHandler).toHaveBeenCalledWith(undefined, {previous: 'value 1'})
observeHandler.reset()
config.set("foo.bar.baz", "i'm back")
atom.config.set("foo.bar.baz", "i'm back")
expect(observeHandler).toHaveBeenCalledWith("i'm back", {previous: undefined})
it "does not fire the callback once the observe subscription is off'ed", ->
observeHandler.reset() # clear the initial call
observeSubscription.off()
atom.config.set('foo.bar.baz', "value 2")
expect(observeHandler).not.toHaveBeenCalled()
describe ".initializeConfigDirectory()", ->
beforeEach ->
config.configDirPath = dotAtomPath
expect(fs.exists(config.configDirPath)).toBeFalsy()
atom.config.configDirPath = dotAtomPath
expect(fs.existsSync(atom.config.configDirPath)).toBeFalsy()
afterEach ->
fs.remove(dotAtomPath) if fs.exists(dotAtomPath)
fs.removeSync(dotAtomPath) if fs.existsSync(dotAtomPath)
describe "when the configDirPath doesn't exist", ->
it "copies the contents of dot-atom to ~/.atom", ->
initializationDone = false
jasmine.unspy(window, "setTimeout")
config.initializeConfigDirectory ->
atom.config.initializeConfigDirectory ->
initializationDone = true
waitsFor -> initializationDone
runs ->
expect(fs.exists(config.configDirPath)).toBeTruthy()
expect(fs.exists(path.join(config.configDirPath, 'packages'))).toBeTruthy()
expect(fs.exists(path.join(config.configDirPath, 'snippets'))).toBeTruthy()
expect(fs.isFileSync(path.join(config.configDirPath, 'config.cson'))).toBeTruthy()
expect(fs.existsSync(atom.config.configDirPath)).toBeTruthy()
expect(fs.existsSync(path.join(atom.config.configDirPath, 'packages'))).toBeTruthy()
expect(fs.existsSync(path.join(atom.config.configDirPath, 'snippets'))).toBeTruthy()
expect(fs.isFileSync(path.join(atom.config.configDirPath, 'config.cson'))).toBeTruthy()
describe ".loadUserConfig()", ->
beforeEach ->
config.configDirPath = dotAtomPath
config.configFilePath = path.join(config.configDirPath, "config.cson")
expect(fs.exists(config.configDirPath)).toBeFalsy()
atom.config.configDirPath = dotAtomPath
atom.config.configFilePath = path.join(atom.config.configDirPath, "atom.config.cson")
expect(fs.existsSync(atom.config.configDirPath)).toBeFalsy()
afterEach ->
fs.remove(dotAtomPath) if fs.exists(dotAtomPath)
fs.removeSync(dotAtomPath) if fs.existsSync(dotAtomPath)
describe "when the config file contains valid cson", ->
beforeEach ->
fs.writeSync(config.configFilePath, "foo: bar: 'baz'")
config.loadUserConfig()
fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'")
atom.config.loadUserConfig()
it "updates the config data based on the file contents", ->
expect(config.get("foo.bar")).toBe 'baz'
expect(atom.config.get("foo.bar")).toBe 'baz'
describe "when the config file contains invalid cson", ->
beforeEach ->
spyOn(console, 'error')
fs.writeSync(config.configFilePath, "{{{{{")
fs.writeFileSync(atom.config.configFilePath, "{{{{{")
it "logs an error to the console and does not overwrite the config file on a subsequent save", ->
config.loadUserConfig()
atom.config.loadUserConfig()
expect(console.error).toHaveBeenCalled()
config.set("hair", "blonde") # trigger a save
expect(config.save).not.toHaveBeenCalled()
atom.config.set("hair", "blonde") # trigger a save
expect(atom.config.save).not.toHaveBeenCalled()
describe "when the config file does not exist", ->
it "creates it with an empty object", ->
fs.makeTree(config.configDirPath)
config.loadUserConfig()
expect(fs.exists(config.configFilePath)).toBe true
expect(CSON.readFileSync(config.configFilePath)).toEqual {}
fs.makeTreeSync(atom.config.configDirPath)
atom.config.loadUserConfig()
expect(fs.existsSync(atom.config.configFilePath)).toBe true
expect(CSON.readFileSync(atom.config.configFilePath)).toEqual {}
describe ".observeUserConfig()", ->
updatedHandler = null
beforeEach ->
config.configDirPath = dotAtomPath
config.configFilePath = path.join(config.configDirPath, "config.cson")
expect(fs.exists(config.configDirPath)).toBeFalsy()
fs.writeSync(config.configFilePath, "foo: bar: 'baz'")
config.loadUserConfig()
config.observeUserConfig()
atom.config.configDirPath = dotAtomPath
atom.config.configFilePath = path.join(atom.config.configDirPath, "atom.config.cson")
expect(fs.existsSync(atom.config.configDirPath)).toBeFalsy()
fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'")
atom.config.loadUserConfig()
atom.config.observeUserConfig()
updatedHandler = jasmine.createSpy("updatedHandler")
config.on 'updated', updatedHandler
atom.config.on 'updated', updatedHandler
afterEach ->
config.unobserveUserConfig()
fs.remove(dotAtomPath) if fs.exists(dotAtomPath)
atom.config.unobserveUserConfig()
fs.removeSync(dotAtomPath) if fs.existsSync(dotAtomPath)
describe "when the config file changes to contain valid cson", ->
it "updates the config data", ->
fs.writeSync(config.configFilePath, "foo: { bar: 'quux', baz: 'bar'}")
fs.writeFileSync(atom.config.configFilePath, "foo: { bar: 'quux', baz: 'bar'}")
waitsFor 'update event', -> updatedHandler.callCount > 0
runs ->
expect(config.get('foo.bar')).toBe 'quux'
expect(config.get('foo.baz')).toBe 'bar'
expect(atom.config.get('foo.bar')).toBe 'quux'
expect(atom.config.get('foo.baz')).toBe 'bar'
describe "when the config file changes to contain invalid cson", ->
beforeEach ->
spyOn(console, 'error')
fs.writeSync(config.configFilePath, "}}}")
fs.writeFileSync(atom.config.configFilePath, "}}}")
waitsFor "error to be logged", -> console.error.callCount > 0
it "logs a warning and does not update config data", ->
expect(updatedHandler.callCount).toBe 0
expect(config.get('foo.bar')).toBe 'baz'
config.set("hair", "blonde") # trigger a save
expect(config.save).not.toHaveBeenCalled()
expect(atom.config.get('foo.bar')).toBe 'baz'
atom.config.set("hair", "blonde") # trigger a save
expect(atom.config.save).not.toHaveBeenCalled()
describe "when the config file subsequently changes again to contain valid cson", ->
beforeEach ->
fs.writeSync(config.configFilePath, "foo: bar: 'baz'")
fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'")
waitsFor 'update event', -> updatedHandler.callCount > 0
it "updates the config data and resumes saving", ->
config.set("hair", "blonde")
expect(config.save).toHaveBeenCalled()
atom.config.set("hair", "blonde")
expect(atom.config.save).toHaveBeenCalled()
+64 -36
Ver Arquivo
@@ -16,10 +16,10 @@ describe "Directory", ->
beforeEach ->
temporaryFilePath = path.join(__dirname, 'fixtures', 'temporary')
fs.remove(temporaryFilePath) if fs.exists(temporaryFilePath)
fs.removeSync(temporaryFilePath) if fs.existsSync(temporaryFilePath)
afterEach ->
fs.remove(temporaryFilePath) if fs.exists(temporaryFilePath)
fs.removeSync(temporaryFilePath) if fs.existsSync(temporaryFilePath)
it "triggers 'contents-changed' event handlers", ->
changeHandler = null
@@ -27,13 +27,13 @@ describe "Directory", ->
runs ->
changeHandler = jasmine.createSpy('changeHandler')
directory.on 'contents-changed', changeHandler
fs.writeSync(temporaryFilePath, '')
fs.writeFileSync(temporaryFilePath, '')
waitsFor "first change", -> changeHandler.callCount > 0
runs ->
changeHandler.reset()
fs.remove(temporaryFilePath)
fs.removeSync(temporaryFilePath)
waitsFor "second change", -> changeHandler.callCount > 0
@@ -42,10 +42,10 @@ describe "Directory", ->
beforeEach ->
temporaryFilePath = path.join(directory.path, 'temporary')
fs.remove(temporaryFilePath) if fs.exists(temporaryFilePath)
fs.removeSync(temporaryFilePath) if fs.existsSync(temporaryFilePath)
afterEach ->
fs.remove(temporaryFilePath) if fs.exists(temporaryFilePath)
fs.removeSync(temporaryFilePath) if fs.existsSync(temporaryFilePath)
it "no longer triggers events", ->
changeHandler = null
@@ -53,7 +53,7 @@ describe "Directory", ->
runs ->
changeHandler = jasmine.createSpy('changeHandler')
directory.on 'contents-changed', changeHandler
fs.writeSync(temporaryFilePath, '')
fs.writeFileSync(temporaryFilePath, '')
waitsFor "change event", -> changeHandler.callCount > 0
@@ -62,36 +62,63 @@ describe "Directory", ->
directory.off()
waits 20
runs -> fs.remove(temporaryFilePath)
runs -> fs.removeSync(temporaryFilePath)
waits 20
runs -> expect(changeHandler.callCount).toBe 0
it "includes symlink information about entries", ->
entries = directory.getEntries()
for entry in entries
name = entry.getBaseName()
if name is 'symlink-to-dir' or name is 'symlink-to-file'
expect(entry.symlink).toBeTruthy()
else
expect(entry.symlink).toBeFalsy()
describe "on #darwin or #linux", ->
it "includes symlink information about entries", ->
entries = directory.getEntriesSync()
for entry in entries
name = entry.getBaseName()
if name is 'symlink-to-dir' or name is 'symlink-to-file'
expect(entry.symlink).toBeTruthy()
else
expect(entry.symlink).toBeFalsy()
callback = jasmine.createSpy('getEntries')
directory.getEntries(callback)
waitsFor -> callback.callCount is 1
runs ->
entries = callback.mostRecentCall.args[1]
for entry in entries
name = entry.getBaseName()
if name is 'symlink-to-dir' or name is 'symlink-to-file'
expect(entry.symlink).toBeTruthy()
else
expect(entry.symlink).toBeFalsy()
describe ".relativize(path)", ->
it "returns a relative path based on the directory's path", ->
absolutePath = directory.getPath()
expect(directory.relativize(absolutePath)).toBe ''
expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b"
expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b/file.coffee"
expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee"
describe "on #darwin or #linux", ->
it "returns a relative path based on the directory's path", ->
absolutePath = directory.getPath()
expect(directory.relativize(absolutePath)).toBe ''
expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b"
expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b/file.coffee"
expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee"
it "returns a relative path based on the directory's symlinked source path", ->
symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir')
symlinkDirectory = new Directory(symlinkPath)
realFilePath = require.resolve('./fixtures/dir/a')
expect(symlinkDirectory.relativize(symlinkPath)).toBe ''
expect(symlinkDirectory.relativize(realFilePath)).toBe 'a'
it "returns a relative path based on the directory's symlinked source path", ->
symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir')
symlinkDirectory = new Directory(symlinkPath)
realFilePath = require.resolve('./fixtures/dir/a')
expect(symlinkDirectory.relativize(symlinkPath)).toBe ''
expect(symlinkDirectory.relativize(realFilePath)).toBe 'a'
it "returns the full path if the directory's path is not a prefix of the path", ->
expect(directory.relativize('/not/relative')).toBe '/not/relative'
it "returns the full path if the directory's path is not a prefix of the path", ->
expect(directory.relativize('/not/relative')).toBe '/not/relative'
describe "on #win32", ->
it "returns a relative path based on the directory's path", ->
absolutePath = directory.getPath()
expect(directory.relativize(absolutePath)).toBe ''
expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b"
expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b\\file.coffee"
expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee"
it "returns the full path if the directory's path is not a prefix of the path", ->
expect(directory.relativize('/not/relative')).toBe "\\not\\relative"
describe ".contains(path)", ->
it "returns true if the path is a child of the directory's path", ->
@@ -100,11 +127,12 @@ describe "Directory", ->
expect(directory.contains(path.join(absolutePath, "b", "file.coffee"))).toBe true
expect(directory.contains(path.join(absolutePath, "file.coffee"))).toBe true
it "returns true if the path is a child of the directory's symlinked source path", ->
symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir')
symlinkDirectory = new Directory(symlinkPath)
realFilePath = require.resolve('./fixtures/dir/a')
expect(symlinkDirectory.contains(realFilePath)).toBe true
it "returns false if the directory's path is not a prefix of the path", ->
expect(directory.contains('/not/relative')).toBe false
describe "on #darwin or #linux", ->
it "returns true if the path is a child of the directory's symlinked source path", ->
symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir')
symlinkDirectory = new Directory(symlinkPath)
realFilePath = require.resolve('./fixtures/dir/a')
expect(symlinkDirectory.contains(realFilePath)).toBe true
+17 -22
Ver Arquivo
@@ -5,8 +5,8 @@ describe "DisplayBuffer", ->
[displayBuffer, buffer, changeHandler, tabLength] = []
beforeEach ->
tabLength = 2
atom.activatePackage('language-javascript', sync: true)
buffer = project.bufferForPathSync('sample.js')
atom.packages.activatePackage('language-javascript', sync: true)
buffer = atom.project.bufferForPathSync('sample.js')
displayBuffer = new DisplayBuffer({buffer, tabLength})
changeHandler = jasmine.createSpy 'changeHandler'
displayBuffer.on 'changed', changeHandler
@@ -15,19 +15,6 @@ describe "DisplayBuffer", ->
displayBuffer.destroy()
buffer.release()
describe "@deserialize(state)", ->
it "constructs a display buffer with the same buffer, folds, editorWidthInChars, and tabLength", ->
displayBuffer.setTabLength(4)
displayBuffer.setEditorWidthInChars(64)
displayBuffer.createFold(2, 4)
displayBuffer2 = deserialize(displayBuffer.serialize())
expect(displayBuffer2.id).toBe displayBuffer.id
expect(displayBuffer2.buffer).toBe displayBuffer.buffer
expect(displayBuffer2.tokenizedBuffer.buffer).toBe displayBuffer.tokenizedBuffer.buffer
expect(displayBuffer2.isFoldedAtBufferRow(2)).toBeTruthy()
expect(displayBuffer2.getSoftWrapColumn()).toBe displayBuffer.getSoftWrapColumn()
expect(displayBuffer2.getTabLength()).toBe displayBuffer.getTabLength()
describe ".copy()", ->
it "creates a new DisplayBuffer with the same initial state", ->
marker1 = displayBuffer.markBufferRange([[1, 2], [3, 4]], id: 1)
@@ -66,14 +53,14 @@ describe "DisplayBuffer", ->
describe "rendering of soft-wrapped lines", ->
describe "when editor.softWrapAtPreferredLineLength is set", ->
it "uses the preferred line length as the soft wrap column when it is less than the configured soft wrap column", ->
config.set('editor.preferredLineLength', 100)
config.set('editor.softWrapAtPreferredLineLength', true)
atom.config.set('editor.preferredLineLength', 100)
atom.config.set('editor.softWrapAtPreferredLineLength', true)
expect(displayBuffer.lineForRow(10).text).toBe ' return '
config.set('editor.preferredLineLength', 5)
atom.config.set('editor.preferredLineLength', 5)
expect(displayBuffer.lineForRow(10).text).toBe 'funct'
config.set('editor.softWrapAtPreferredLineLength', false)
atom.config.set('editor.softWrapAtPreferredLineLength', false)
expect(displayBuffer.lineForRow(10).text).toBe ' return '
describe "when the line is shorter than the max line length", ->
@@ -103,6 +90,14 @@ describe "DisplayBuffer", ->
expect(displayBuffer.lineForRow(3).text).toBe ' var pivot = items.shift(), current, left = [], '
expect(displayBuffer.lineForRow(4).text).toBe 'right = [];'
describe "when there are hard tabs", ->
beforeEach ->
buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t'))
it "correctly tokenizes the hard tabs", ->
expect(displayBuffer.lineForRow(3).tokens[0].isHardTab).toBeTruthy()
expect(displayBuffer.lineForRow(3).tokens[1].isHardTab).toBeTruthy()
describe "when the buffer changes", ->
describe "when buffer lines are updated", ->
describe "when whitespace is added after the max line length", ->
@@ -154,7 +149,7 @@ describe "DisplayBuffer", ->
describe "when a newline is inserted, deleted, and re-inserted at the end of a wrapped line (regression)", ->
it "correctly renders the original wrapped line", ->
buffer = project.buildBufferSync(null, '')
buffer = atom.project.buildBufferSync(null, '')
displayBuffer = new DisplayBuffer({buffer, tabLength, editorWidthInChars: 30, softWrap: true})
buffer.insert([0, 0], "the quick brown fox jumps over the lazy dog.")
@@ -206,7 +201,7 @@ describe "DisplayBuffer", ->
beforeEach ->
displayBuffer.destroy()
buffer.release()
buffer = project.bufferForPathSync('two-hundred.txt')
buffer = atom.project.bufferForPathSync('two-hundred.txt')
displayBuffer = new DisplayBuffer({buffer, tabLength})
displayBuffer.on 'changed', changeHandler
@@ -600,7 +595,7 @@ describe "DisplayBuffer", ->
it "unsubscribes all display buffer markers from their underlying buffer marker (regression)", ->
marker = displayBuffer.markBufferPosition([12, 2])
displayBuffer.destroy()
expect(marker.bufferMarker.subscriptionCount()).toBe 0
expect(marker.bufferMarker.getSubscriptionCount()).toBe 0
expect( -> buffer.insert([12, 2], '\n')).not.toThrow()
describe "markers", ->
-62
Ver Arquivo
@@ -1,62 +0,0 @@
{Site} = require 'telepath'
Environment = require './environment'
describe "EditSession replication", ->
[env1, env2, editSession1, editSession2] = []
beforeEach ->
env1 = new Environment(siteId: 1)
env2 = env1.clone(siteId: 2)
envConnection = env1.connect(env2)
doc2 = null
env1.run ->
editSession1 = project.openSync('sample.js')
editSession1.setScrollTop(5)
editSession1.setScrollLeft(5)
editSession1.setCursorScreenPosition([0, 5])
editSession1.addSelectionForBufferRange([[1, 2], [3, 4]])
doc1 = editSession1.getState()
doc2 = doc1.clone(env2.site)
envConnection.connect(doc1, doc2)
env2.run ->
editSession2 = deserialize(doc2)
afterEach ->
env1.destroy()
env2.destroy()
it "replicates the selections of existing replicas", ->
expect(editSession2.getRemoteSelectedBufferRanges()).toEqual editSession1.getSelectedBufferRanges()
editSession1.getLastSelection().setBufferRange([[2, 3], [4, 5]])
expect(editSession2.getRemoteSelectedBufferRanges()).toEqual editSession1.getSelectedBufferRanges()
editSession1.addCursorAtBufferPosition([5, 6])
expect(editSession2.getRemoteSelectedBufferRanges()).toEqual editSession1.getSelectedBufferRanges()
editSession1.consolidateSelections()
expect(editSession2.getRemoteSelectedBufferRanges()).toEqual editSession1.getSelectedBufferRanges()
it "introduces a local cursor for a new replica at the position of the last remote cursor", ->
expect(editSession2.getCursors().length).toBe 1
expect(editSession2.getSelections().length).toBe 1
expect(editSession2.getCursorBufferPosition()).toEqual [3, 4]
expect(editSession2.getSelectedBufferRanges()).toEqual [[[3, 4], [3, 4]]]
expect(editSession1.getRemoteCursors().length).toBe 1
expect(editSession1.getRemoteSelections().length).toBe 1
[cursor] = editSession1.getRemoteCursors()
[selection] = editSession1.getRemoteSelections()
expect(cursor.getBufferPosition()).toEqual [3, 4]
expect(selection.getBufferRange()).toEqual [[3, 4], [3, 4]]
it "replicates the scroll position", ->
expect(editSession2.getScrollTop()).toBe editSession1.getScrollTop()
expect(editSession2.getScrollLeft()).toBe editSession1.getScrollLeft()
editSession1.setScrollTop(10)
expect(editSession2.getScrollTop()).toBe 10
editSession2.setScrollLeft(20)
expect(editSession1.getScrollLeft()).toBe 20
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
-37
Ver Arquivo
@@ -1,37 +0,0 @@
{Site} = require 'telepath'
Editor = require '../src/editor'
Environment = require './environment'
describe "Editor replication", ->
[env1, env2, editSession1, editSession2, editor1, editor2] = []
beforeEach ->
env1 = new Environment(siteId: 1)
env2 = env1.clone(siteId: 2)
envConnection = env1.connect(env2)
doc2 = null
env1.run ->
editSession1 = project.openSync('sample.js')
editSession1.setSelectedBufferRange([[1, 2], [3, 4]])
doc1 = editSession1.getState()
doc2 = doc1.clone(env2.site)
envConnection.connect(doc1, doc2)
editor1 = new Editor(editSession1)
editor1.attachToDom()
env2.run ->
editSession2 = deserialize(doc2)
editor2 = new Editor(editSession2)
editor2.attachToDom()
afterEach ->
env1.destroy()
env2.destroy()
it "displays the cursors and selections from all replicas", ->
expect(editor1.getSelectionViews().length).toBe 2
expect(editor2.getSelectionViews().length).toBe 2
expect(editor1.getCursorViews().length).toBe 2
expect(editor2.getCursorViews().length).toBe 2
+2727 -2713
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
-59
Ver Arquivo
@@ -1,59 +0,0 @@
path = require 'path'
{Site} = require 'telepath'
{fs} = require 'atom'
Project = require '../src/project'
module.exports =
class Environment
constructor: ({@site, @state, siteId, projectPath}={}) ->
@site ?= new Site(siteId ? 1)
if @state?
@run => @project = deserialize(@state.get('project'))
else
@state = @site.createDocument({})
@project = new Project(projectPath ? path.join(__dirname, 'fixtures'))
@state.set(project: @project.getState())
clone: (params) ->
site = new Site(params.siteId)
new Environment(site: site, state: @state.clone(site))
destroy: ->
@project.destroy()
getState: -> @state
run: (fn) ->
uninstall = @install()
fn()
uninstall()
install: ->
oldSite = window.site
oldProject = window.project
window.site = @site
window.project = @project
->
window.site = oldSite
window.project = oldProject
connect: (otherEnv) ->
new EnvironmentConnection(this, otherEnv)
connectDocuments: (docA, docB, envB) ->
class EnvironmentConnection
constructor: (@envA, @envB) ->
@envA.getState().connect(@envB.getState())
connect: (docA, docB) ->
unless docA.site is @envA.site
throw new Error("Document and environment sites do not match (doc: site #{docA.site.id}, env: site #{@envA.site.id})")
unless docB.site is @envB.site
throw new Error("Document and environment sites do not match (doc: site #{docB.site.id}, env: site #{@envB.site.id})")
connection = docA.connect(docB)
connection.abFilter = (fn) => @envB.run(fn)
connection.baFilter = (fn) => @envA.run(fn)
connection
+15 -15
Ver Arquivo
@@ -6,19 +6,19 @@ describe 'File', ->
beforeEach ->
filePath = path.join(__dirname, 'fixtures', 'atom-file-test.txt') # Don't put in /tmp because /tmp symlinks to /private/tmp and screws up the rename test
fs.remove(filePath) if fs.exists(filePath)
fs.writeSync(filePath, "this is old!")
fs.removeSync(filePath) if fs.existsSync(filePath)
fs.writeFileSync(filePath, "this is old!")
file = new File(filePath)
afterEach ->
file.off()
fs.remove(filePath) if fs.exists(filePath)
fs.removeSync(filePath) if fs.existsSync(filePath)
describe "when the file has not been read", ->
describe "when the contents of the file change", ->
it "triggers 'contents-changed' event handlers", ->
file.on 'contents-changed', changeHandler = jasmine.createSpy('changeHandler')
fs.writeSync(file.getPath(), "this is new!")
fs.writeFileSync(file.getPath(), "this is new!")
waitsFor "change event", ->
changeHandler.callCount > 0
@@ -32,14 +32,14 @@ describe 'File', ->
changeHandler = null
changeHandler = jasmine.createSpy('changeHandler')
file.on 'contents-changed', changeHandler
fs.writeSync(file.getPath(), "this is new!")
fs.writeFileSync(file.getPath(), "this is new!")
waitsFor "change event", ->
changeHandler.callCount > 0
runs ->
changeHandler.reset()
fs.writeSync(file.getPath(), "this is newer!")
fs.writeFileSync(file.getPath(), "this is newer!")
waitsFor "second change event", ->
changeHandler.callCount > 0
@@ -49,7 +49,7 @@ describe 'File', ->
removeHandler = null
removeHandler = jasmine.createSpy('removeHandler')
file.on 'removed', removeHandler
fs.remove(file.getPath())
fs.removeSync(file.getPath())
waitsFor "remove event", ->
removeHandler.callCount > 0
@@ -61,8 +61,8 @@ describe 'File', ->
newPath = path.join(path.dirname(filePath), "atom-file-was-moved-test.txt")
afterEach ->
if fs.exists(newPath)
fs.remove(newPath)
if fs.existsSync(newPath)
fs.removeSync(newPath)
waitsFor "remove event", (done) -> file.on 'removed', done
it "it updates its path", ->
@@ -71,7 +71,7 @@ describe 'File', ->
moveHandler = jasmine.createSpy('moveHandler')
file.on 'moved', moveHandler
fs.move(filePath, newPath)
fs.moveSync(filePath, newPath)
waitsFor "move event", ->
moveHandler.callCount > 0
@@ -88,14 +88,14 @@ describe 'File', ->
changeHandler = jasmine.createSpy('changeHandler')
file.on 'contents-changed', changeHandler
fs.move(filePath, newPath)
fs.moveSync(filePath, newPath)
waitsFor "move event", ->
moveHandler.callCount > 0
runs ->
expect(changeHandler).not.toHaveBeenCalled()
fs.writeSync(file.getPath(), "this is new!")
fs.writeFileSync(file.getPath(), "this is new!")
waitsFor "change event", ->
changeHandler.callCount > 0
@@ -112,12 +112,12 @@ describe 'File', ->
expect(changeHandler).not.toHaveBeenCalled()
fs.remove(filePath)
fs.removeSync(filePath)
expect(changeHandler).not.toHaveBeenCalled()
waits 20
runs ->
fs.writeSync(filePath, "HE HAS RISEN!")
fs.writeFileSync(filePath, "HE HAS RISEN!")
expect(changeHandler).not.toHaveBeenCalled()
waitsFor "resurrection change event", ->
@@ -125,7 +125,7 @@ describe 'File', ->
runs ->
expect(removeHandler).not.toHaveBeenCalled()
fs.writeSync(filePath, "Hallelujah!")
fs.writeFileSync(filePath, "Hallelujah!")
changeHandler.reset()
waitsFor "post-resurrection change event", ->
@@ -1,5 +1,5 @@
class Foo
registerDeserializer(this)
atom.deserializers.add(this)
@deserialize: ({data}) -> new Foo(data)
constructor: (@data) ->
@@ -9,5 +9,5 @@ module.exports =
activate: ->
@activateCallCount++
rootView.getActiveView()?.command 'activation-event', =>
atom.workspaceView.getActiveView()?.command 'activation-event', =>
@activationEventCallCount++
@@ -0,0 +1,4 @@
'name': 'test'
'scopeName': 'source.test'
'injectionSelector': 'comment'
'patterns': [{'include': 'source.sql'}]
@@ -1,5 +1,5 @@
# This package loads async, otherwise it would log errors when it
# is automatically serialized when rootView is deactivatated
# is automatically serialized when workspaceView is deactivatated
'main': 'index.coffee'
'activationEvents': ['activation-event']
-140
Ver Arquivo
@@ -1,140 +0,0 @@
{fs} = require 'atom'
path = require 'path'
temp = require 'temp'
describe "fs", ->
fixturesDir = path.join(__dirname, 'fixtures')
describe ".read(path)", ->
it "return contents of file", ->
expect(fs.read(require.resolve("./fixtures/sample.txt"))).toBe "Some text.\n"
it "does not through an exception when the path is a binary file", ->
expect(-> fs.read(require.resolve("./fixtures/binary-file.png"))).not.toThrow()
describe ".isFileSync(path)", ->
it "returns true with a file path", ->
expect(fs.isFileSync(path.join(fixturesDir, 'sample.js'))).toBe true
it "returns false with a directory path", ->
expect(fs.isFileSync(fixturesDir)).toBe false
it "returns false with a non-existent path", ->
expect(fs.isFileSync(path.join(fixturesDir, 'non-existent'))).toBe false
expect(fs.isFileSync(null)).toBe false
describe ".exists(path)", ->
it "returns true when path exsits", ->
expect(fs.exists(fixturesDir)).toBe true
it "returns false when path doesn't exsit", ->
expect(fs.exists(path.join(fixturesDir, "-nope-does-not-exist"))).toBe false
expect(fs.exists("")).toBe false
expect(fs.exists(null)).toBe false
describe ".makeTree(path)", ->
aPath = path.join(temp.dir, 'a')
beforeEach ->
fs.remove(aPath) if fs.exists(aPath)
it "creates all directories in path including any missing parent directories", ->
abcPath = path.join(aPath, 'b', 'c')
fs.makeTree(abcPath)
expect(fs.exists(abcPath)).toBeTruthy()
describe ".traverseTreeSync(path, onFile, onDirectory)", ->
it "calls fn for every path in the tree at the given path", ->
paths = []
onPath = (childPath) ->
paths.push(childPath)
true
fs.traverseTreeSync fixturesDir, onPath, onPath
expect(paths).toEqual fs.listTreeSync(fixturesDir)
it "does not recurse into a directory if it is pruned", ->
paths = []
onPath = (childPath) ->
if childPath.match(/\/dir$/)
false
else
paths.push(childPath)
true
fs.traverseTreeSync fixturesDir, onPath, onPath
expect(paths.length).toBeGreaterThan 0
for filePath in paths
expect(filePath).not.toMatch /\/dir\//
it "returns entries if path is a symlink", ->
symlinkPath = path.join(fixturesDir, 'symlink-to-dir')
symlinkPaths = []
onSymlinkPath = (path) -> symlinkPaths.push(path.substring(symlinkPath.length + 1))
regularPath = path.join(fixturesDir, 'dir')
paths = []
onPath = (path) -> paths.push(path.substring(regularPath.length + 1))
fs.traverseTreeSync(symlinkPath, onSymlinkPath, onSymlinkPath)
fs.traverseTreeSync(regularPath, onPath, onPath)
expect(symlinkPaths).toEqual(paths)
it "ignores missing symlinks", ->
directory = temp.mkdirSync('symlink-in-here')
paths = []
onPath = (childPath) -> paths.push(childPath)
fs.symlinkSync(path.join(directory, 'source'), path.join(directory, 'destination'))
fs.traverseTreeSync(directory, onPath)
expect(paths.length).toBe 0
describe ".md5ForPath(path)", ->
it "returns the MD5 hash of the file at the given path", ->
expect(fs.md5ForPath(require.resolve('./fixtures/sample.js'))).toBe 'dd38087d0d7e3e4802a6d3f9b9745f2b'
describe ".list(path, extensions)", ->
it "returns the absolute paths of entries within the given directory", ->
paths = fs.listSync(project.getPath())
expect(paths).toContain project.resolve('css.css')
expect(paths).toContain project.resolve('coffee.coffee')
expect(paths).toContain project.resolve('two-hundred.txt')
it "returns an empty array for paths that aren't directories or don't exist", ->
expect(fs.listSync(project.resolve('sample.js'))).toEqual []
expect(fs.listSync('/non/existent/directory')).toEqual []
it "can filter the paths by an optional array of file extensions", ->
paths = fs.listSync(project.getPath(), ['.css', 'coffee'])
expect(paths).toContain project.resolve('css.css')
expect(paths).toContain project.resolve('coffee.coffee')
expect(listedPath).toMatch /(css|coffee)$/ for listedPath in paths
describe ".list(path, [extensions,] callback)", ->
paths = null
it "calls the callback with the absolute paths of entries within the given directory", ->
waitsFor (done) ->
fs.list project.getPath(), (err, result) ->
paths = result
done()
runs ->
expect(paths).toContain project.resolve('css.css')
expect(paths).toContain project.resolve('coffee.coffee')
expect(paths).toContain project.resolve('two-hundred.txt')
it "can filter the paths by an optional array of file extensions", ->
waitsFor (done) ->
fs.list project.getPath(), ['css', '.coffee'], (err, result) ->
paths = result
done()
runs ->
expect(paths).toContain project.resolve('css.css')
expect(paths).toContain project.resolve('coffee.coffee')
expect(listedPath).toMatch /(css|coffee)$/ for listedPath in paths
describe ".absolute(relativePath)", ->
it "converts a leading ~ segment to the HOME directory", ->
homeDir = atom.getHomeDirPath()
expect(fs.absolute('~')).toBe fs.realpathSync(homeDir)
expect(fs.absolute(path.join('~', 'does', 'not', 'exist'))).toBe path.join(homeDir, 'does', 'not', 'exist')
expect(fs.absolute('~test')).toBe '~test'
+65 -60
Ver Arquivo
@@ -9,7 +9,7 @@ describe "Git", ->
beforeEach ->
gitPath = path.join(temp.dir, '.git')
fs.remove(gitPath) if fs.isDirectorySync(gitPath)
fs.removeSync(gitPath) if fs.isDirectorySync(gitPath)
afterEach ->
repo.destroy() if repo?.repo?
@@ -47,22 +47,22 @@ describe "Git", ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
filePath = require.resolve('./fixtures/git/working-dir/file.txt')
newPath = path.join(__dirname, 'fixtures', 'git', 'working-dir', 'new-path.txt')
originalPathText = fs.read(filePath)
originalPathText = fs.readFileSync(filePath, 'utf8')
afterEach ->
fs.writeSync(filePath, originalPathText)
fs.remove(newPath) if fs.exists(newPath)
fs.writeFileSync(filePath, originalPathText)
fs.removeSync(newPath) if fs.existsSync(newPath)
describe "when the path is unstaged", ->
it "returns false if the path has not been modified", ->
expect(repo.isPathModified(filePath)).toBeFalsy()
it "returns true if the path is modified", ->
fs.writeSync(filePath, "change")
fs.writeFileSync(filePath, "change")
expect(repo.isPathModified(filePath)).toBeTruthy()
it "returns true if the path is deleted", ->
fs.remove(filePath)
fs.removeSync(filePath)
expect(repo.isPathModified(filePath)).toBeTruthy()
it "returns false if the path is new", ->
@@ -75,10 +75,10 @@ describe "Git", ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
filePath = require.resolve('./fixtures/git/working-dir/file.txt')
newPath = path.join(__dirname, 'fixtures', 'git', 'working-dir', 'new-path.txt')
fs.writeSync(newPath, "i'm new here")
fs.writeFileSync(newPath, "i'm new here")
afterEach ->
fs.remove(newPath) if fs.exists(newPath)
fs.removeSync(newPath) if fs.existsSync(newPath)
describe "when the path is unstaged", ->
it "returns true if the path is new", ->
@@ -93,35 +93,35 @@ describe "Git", ->
beforeEach ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
path1 = require.resolve('./fixtures/git/working-dir/file.txt')
originalPath1Text = fs.read(path1)
originalPath1Text = fs.readFileSync(path1, 'utf8')
path2 = require.resolve('./fixtures/git/working-dir/other.txt')
originalPath2Text = fs.read(path2)
originalPath2Text = fs.readFileSync(path2, 'utf8')
afterEach ->
fs.writeSync(path1, originalPath1Text)
fs.writeSync(path2, originalPath2Text)
fs.writeFileSync(path1, originalPath1Text)
fs.writeFileSync(path2, originalPath2Text)
it "no longer reports a path as modified after checkout", ->
expect(repo.isPathModified(path1)).toBeFalsy()
fs.writeSync(path1, '')
fs.writeFileSync(path1, '')
expect(repo.isPathModified(path1)).toBeTruthy()
expect(repo.checkoutHead(path1)).toBeTruthy()
expect(repo.isPathModified(path1)).toBeFalsy()
it "restores the contents of the path to the original text", ->
fs.writeSync(path1, '')
fs.writeFileSync(path1, '')
expect(repo.checkoutHead(path1)).toBeTruthy()
expect(fs.read(path1)).toBe(originalPath1Text)
expect(fs.readFileSync(path1, 'utf8')).toBe(originalPath1Text)
it "only restores the path specified", ->
fs.writeSync(path2, 'path 2 is edited')
fs.writeFileSync(path2, 'path 2 is edited')
expect(repo.isPathModified(path2)).toBeTruthy()
expect(repo.checkoutHead(path1)).toBeTruthy()
expect(fs.read(path2)).toBe('path 2 is edited')
expect(fs.readFileSync(path2, 'utf8')).toBe('path 2 is edited')
expect(repo.isPathModified(path2)).toBeTruthy()
it "fires a status-changed event if the checkout completes successfully", ->
fs.writeSync(path1, '')
fs.writeFileSync(path1, '')
repo.getPathStatus(path1)
statusHandler = jasmine.createSpy('statusHandler')
repo.on 'status-changed', statusHandler
@@ -144,14 +144,14 @@ describe "Git", ->
beforeEach ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
filePath = require.resolve('./fixtures/git/working-dir/file.txt')
originalPathText = fs.read(filePath)
originalPathText = fs.readFileSync(filePath, 'utf8')
afterEach ->
fs.writeSync(filePath, originalPathText)
fs.writeFileSync(filePath, originalPathText)
it "returns the number of lines added and deleted", ->
expect(repo.getDiffStats(filePath)).toEqual {added: 0, deleted: 0}
fs.writeSync(filePath, "#{originalPathText} edited line")
fs.writeFileSync(filePath, "#{originalPathText} edited line")
expect(repo.getDiffStats(filePath)).toEqual {added: 1, deleted: 1}
describe ".getPathStatus(path)", ->
@@ -160,20 +160,20 @@ describe "Git", ->
beforeEach ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
filePath = require.resolve('./fixtures/git/working-dir/file.txt')
originalPathText = fs.read(filePath)
originalPathText = fs.readFileSync(filePath, 'utf8')
afterEach ->
fs.writeSync(filePath, originalPathText)
fs.writeFileSync(filePath, originalPathText)
it "trigger a status-changed event when the new status differs from the last cached one", ->
statusHandler = jasmine.createSpy("statusHandler")
repo.on 'status-changed', statusHandler
fs.writeSync(filePath, '')
fs.writeFileSync(filePath, '')
status = repo.getPathStatus(filePath)
expect(statusHandler.callCount).toBe 1
expect(statusHandler.argsForCall[0][0..1]).toEqual [filePath, status]
fs.writeSync(filePath, 'abc')
fs.writeFileSync(filePath, 'abc')
status = repo.getPathStatus(filePath)
expect(statusHandler.callCount).toBe 1
@@ -182,18 +182,18 @@ describe "Git", ->
beforeEach ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
modifiedPath = project.resolve('git/working-dir/file.txt')
originalModifiedPathText = fs.read(modifiedPath)
newPath = project.resolve('git/working-dir/untracked.txt')
cleanPath = project.resolve('git/working-dir/other.txt')
fs.writeSync(newPath, '')
modifiedPath = atom.project.resolve('git/working-dir/file.txt')
originalModifiedPathText = fs.readFileSync(modifiedPath, 'utf8')
newPath = atom.project.resolve('git/working-dir/untracked.txt')
cleanPath = atom.project.resolve('git/working-dir/other.txt')
fs.writeFileSync(newPath, '')
afterEach ->
fs.writeSync(modifiedPath, originalModifiedPathText)
fs.remove(newPath) if fs.exists(newPath)
fs.writeFileSync(modifiedPath, originalModifiedPathText)
fs.removeSync(newPath) if fs.existsSync(newPath)
it "returns status information for all new and modified files", ->
fs.writeSync(modifiedPath, 'making this path modified')
fs.writeFileSync(modifiedPath, 'making this path modified')
statusHandler = jasmine.createSpy('statusHandler')
repo.on 'statuses-changed', statusHandler
repo.refreshStatus()
@@ -207,52 +207,57 @@ describe "Git", ->
expect(repo.isStatusNew(statuses[newPath])).toBeTruthy()
expect(repo.isStatusModified(statuses[modifiedPath])).toBeTruthy()
describe "when a buffer is changed and then saved", ->
[originalContent, editSession] = []
describe "buffer events", ->
[originalContent, editor] = []
beforeEach ->
editor = atom.project.openSync('sample.js')
originalContent = editor.getText()
afterEach ->
fs.writeSync(editSession.getPath(), originalContent)
fs.writeFileSync(editor.getPath(), originalContent)
it "emits a status-changed event", ->
editSession = project.openSync('sample.js')
originalContent = editSession.getText()
editSession.insertNewline()
it "emits a status-changed event when a buffer is saved", ->
editor.insertNewline()
statusHandler = jasmine.createSpy('statusHandler')
project.getRepo().on 'status-changed', statusHandler
editSession.save()
atom.project.getRepo().on 'status-changed', statusHandler
editor.save()
expect(statusHandler.callCount).toBe 1
expect(statusHandler).toHaveBeenCalledWith editSession.getPath(), 256
expect(statusHandler).toHaveBeenCalledWith editor.getPath(), 256
describe "when a buffer is reloaded and has been changed", ->
[originalContent, editSession] = []
afterEach ->
fs.writeSync(editSession.getPath(), originalContent)
it "emits a status-changed event", ->
editSession = project.openSync('sample.js')
originalContent = editSession.getText()
fs.writeSync(editSession.getPath(), 'changed')
it "emits a status-changed event when a buffer is reloaded", ->
fs.writeFileSync(editor.getPath(), 'changed')
statusHandler = jasmine.createSpy('statusHandler')
project.getRepo().on 'status-changed', statusHandler
editSession.getBuffer().reload()
atom.project.getRepo().on 'status-changed', statusHandler
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
expect(statusHandler).toHaveBeenCalledWith editSession.getPath(), 256
editSession.getBuffer().reload()
expect(statusHandler).toHaveBeenCalledWith editor.getPath(), 256
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
it "emits a status-changed event when a buffer's path changes", ->
fs.writeFileSync(editor.getPath(), 'changed')
statusHandler = jasmine.createSpy('statusHandler')
atom.project.getRepo().on 'status-changed', statusHandler
editor.getBuffer().emit 'path-changed'
expect(statusHandler.callCount).toBe 1
expect(statusHandler).toHaveBeenCalledWith editor.getPath(), 256
editor.getBuffer().emit 'path-changed'
expect(statusHandler.callCount).toBe 1
describe "when a project is deserialized", ->
[originalContent, buffer, project2] = []
afterEach ->
fs.writeSync(buffer.getPath(), originalContent)
fs.writeFileSync(buffer.getPath(), originalContent)
project2?.destroy()
it "subscribes to all the serialized buffers in the project", ->
project.openSync('sample.js')
project2 = deserialize(project.serialize())
atom.project.openSync('sample.js')
project2 = atom.project.testSerialization()
buffer = project2.getBuffers()[0]
waitsFor ->
+19 -7
Ver Arquivo
@@ -1,22 +1,33 @@
module.exports.runSpecSuite = (specSuite, logErrors=true) ->
fs = require 'fs'
module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) ->
{$, $$} = require 'atom'
window[key] = value for key, value of require '../vendor/jasmine'
require 'jasmine-focused'
require 'jasmine-tagged'
TimeReporter = require './time-reporter'
timeReporter = new TimeReporter()
logStream = fs.openSync(logFile, 'w') if logFile?
log = (str) ->
if logStream?
fs.writeSync(logStream, str)
else
process.stderr.write(str)
if atom.getLoadSettings().exitWhenDone
{jasmineNode} = require 'jasmine-node/lib/jasmine-node/reporter'
reporter = new jasmineNode.TerminalReporter
print: (args...) ->
process.stderr.write(args...)
print: (str) ->
log(str)
onComplete: (runner) ->
process.stdout.write('\n')
timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n")
process.stdout.write('\n')
timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n")
log('\n')
timeReporter.logLongestSuites 10, (line) -> log("#{line}\n")
log('\n')
timeReporter.logLongestSpecs 10, (line) -> log("#{line}\n")
fs.closeSync(logStream) if logStream?
atom.exit(runner.results().failedCount > 0 ? 1 : 0)
else
AtomReporter = require './atom-reporter'
@@ -27,6 +38,7 @@ module.exports.runSpecSuite = (specSuite, logErrors=true) ->
jasmineEnv = jasmine.getEnv()
jasmineEnv.addReporter(reporter)
jasmineEnv.addReporter(timeReporter)
jasmineEnv.setIncludedTags([process.platform])
$('body').append $$ -> @div id: 'jasmine-content'
+98 -108
Ver Arquivo
@@ -1,12 +1,18 @@
fs = require 'fs-plus'
path = require 'path'
temp = require 'temp'
Keymap = require '../src/keymap'
{$, $$, RootView} = require 'atom'
{$, $$, WorkspaceView} = require 'atom'
describe "Keymap", ->
fragment = null
keymap = null
resourcePath = atom.getLoadSettings().resourcePath
configDirPath = null
beforeEach ->
keymap = new Keymap
configDirPath = temp.mkdirSync('atom')
keymap = new Keymap({configDirPath, resourcePath})
fragment = $ """
<div class="command-mode">
<div class="child-node">
@@ -15,28 +21,25 @@ describe "Keymap", ->
</div>
"""
afterEach ->
keymap.destroy()
describe ".handleKeyEvent(event)", ->
deleteCharHandler = null
insertCharHandler = null
commandZHandler = null
beforeEach ->
keymap.bindKeys '.command-mode', 'x': 'deleteChar'
keymap.bindKeys '.insert-mode', 'x': 'insertChar'
keymap.bindKeys 'name', '.command-mode', 'x': 'deleteChar'
keymap.bindKeys 'name', '.insert-mode', 'x': 'insertChar'
keymap.bindKeys 'name', '.command-mode', 'cmd-z': 'commandZPressed'
deleteCharHandler = jasmine.createSpy('deleteCharHandler')
insertCharHandler = jasmine.createSpy('insertCharHandler')
commandZHandler = jasmine.createSpy('commandZHandler')
fragment.on 'deleteChar', deleteCharHandler
fragment.on 'insertChar', insertCharHandler
it "adds a 'keystrokes' string to the event object", ->
event = keydownEvent('x', altKey: true, metaKey: true)
keymap.handleKeyEvent(event)
expect(event.keystrokes).toBe 'alt-meta-x'
event = keydownEvent(',', metaKey: true)
event.which = 188
keymap.handleKeyEvent(event)
expect(event.keystrokes).toBe 'meta-,'
fragment.on 'commandZPressed', commandZHandler
describe "when no binding matches the event's keystroke", ->
it "does not return false so the event continues to propagate", ->
@@ -44,10 +47,11 @@ describe "Keymap", ->
describe "when a non-English keyboard language is used", ->
it "uses the physical character pressed instead of the character it maps to in the current language", ->
event = keydownEvent('U+03B6', metaKey: true) # This is the 'z' key using the Greek keyboard layout
event.which = 122
keymap.handleKeyEvent(event)
expect(event.keystrokes).toBe 'meta-z'
event = keydownEvent('U+03B6', metaKey: true, which: 122, target: fragment[0]) # This is the 'z' key using the Greek keyboard layout
result = keymap.handleKeyEvent(event)
expect(result).toBe(false)
expect(commandZHandler).toHaveBeenCalled()
describe "when at least one binding fully matches the event's keystroke", ->
describe "when the event's target node matches a selector with a matching binding", ->
@@ -64,9 +68,6 @@ describe "Keymap", ->
keymap.handleKeyEvent(event)
expect(deleteCharHandler).not.toHaveBeenCalled()
expect(insertCharHandler).toHaveBeenCalled()
commandEvent = insertCharHandler.argsForCall[0][0]
expect(commandEvent.keyEvent).toBe event
expect(event.keystrokes).toBe 'x'
describe "when the event's target node *descends* from a selector with a matching binding", ->
it "triggers the command event associated with that binding on the target node and returns false", ->
@@ -85,7 +86,7 @@ describe "Keymap", ->
describe "when the event's target node descends from multiple nodes that match selectors with a binding", ->
beforeEach ->
keymap.bindKeys '.child-node', 'x': 'foo'
keymap.bindKeys 'name', '.child-node', 'x': 'foo'
it "only triggers bindings on selectors associated with the closest ancestor node", ->
fooHandler = jasmine.createSpy 'fooHandler'
@@ -122,10 +123,10 @@ describe "Keymap", ->
describe "when the event bubbles to a node that matches multiple selectors", ->
describe "when the matching selectors differ in specificity", ->
it "triggers the binding for the most specific selector", ->
keymap.bindKeys 'div .child-node', 'x': 'foo'
keymap.bindKeys '.command-mode .child-node !important', 'x': 'baz'
keymap.bindKeys '.command-mode .child-node', 'x': 'quux'
keymap.bindKeys '.child-node', 'x': 'bar'
keymap.bindKeys 'name', 'div .child-node', 'x': 'foo'
keymap.bindKeys 'name', '.command-mode .child-node !important', 'x': 'baz'
keymap.bindKeys 'name', '.command-mode .child-node', 'x': 'quux'
keymap.bindKeys 'name', '.child-node', 'x': 'bar'
fooHandler = jasmine.createSpy 'fooHandler'
barHandler = jasmine.createSpy 'barHandler'
@@ -143,8 +144,8 @@ describe "Keymap", ->
describe "when the matching selectors have the same specificity", ->
it "triggers the bindings for the most recently declared selector", ->
keymap.bindKeys '.child-node', 'x': 'foo', 'y': 'baz'
keymap.bindKeys '.child-node', 'x': 'bar'
keymap.bindKeys 'name', '.child-node', 'x': 'foo', 'y': 'baz'
keymap.bindKeys 'name', '.child-node', 'x': 'bar'
fooHandler = jasmine.createSpy 'fooHandler'
barHandler = jasmine.createSpy 'barHandler'
@@ -163,11 +164,12 @@ describe "Keymap", ->
expect(bazHandler).toHaveBeenCalled()
describe "when the event's target is the document body", ->
it "triggers the mapped event on the rootView", ->
window.rootView = new RootView
keymap.bindKeys 'body', 'x': 'foo'
it "triggers the mapped event on the workspaceView", ->
atom.workspaceView = new WorkspaceView
atom.workspaceView.attachToDom()
keymap.bindKeys 'name', 'body', 'x': 'foo'
fooHandler = jasmine.createSpy("fooHandler")
rootView.on 'foo', fooHandler
atom.workspaceView.on 'foo', fooHandler
result = keymap.handleKeyEvent(keydownEvent('x', target: document.body))
expect(result).toBe(false)
@@ -177,7 +179,7 @@ describe "Keymap", ->
describe "when the event matches a 'native!' binding", ->
it "returns true, allowing the browser's native key handling to process the event", ->
keymap.bindKeys '.grandchild-node', 'x': 'native!'
keymap.bindKeys 'name', '.grandchild-node', 'x': 'native!'
nativeHandler = jasmine.createSpy("nativeHandler")
fragment.on 'native!', nativeHandler
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment.find('.grandchild-node')[0]))).toBe true
@@ -187,7 +189,7 @@ describe "Keymap", ->
[quitHandler, closeOtherWindowsHandler] = []
beforeEach ->
keymap.bindKeys "*",
keymap.bindKeys 'name', "*",
'ctrl-x ctrl-c': 'quit'
'ctrl-x 1': 'close-other-windows'
@@ -203,6 +205,7 @@ describe "Keymap", ->
describe "when a second keystroke added to the first to match a multi-stroke binding completely", ->
it "triggers the event associated with the matched multi-stroke binding", ->
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBeFalsy()
expect(keymap.handleKeyEvent(keydownEvent('ctrl', target: fragment[0]))).toBeFalsy() # This simulates actual key event behavior
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0], ctrlKey: true))).toBeFalsy()
expect(quitHandler).toHaveBeenCalled()
@@ -216,7 +219,7 @@ describe "Keymap", ->
expect(closeOtherWindowsHandler).toHaveBeenCalled()
describe "when a second keystroke added to the first doesn't match any bindings", ->
it "clears the queued keystrokes without triggering any events", ->
it "clears the queued keystroke without triggering any events", ->
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBe false
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0]))).toBe false
expect(quitHandler).not.toHaveBeenCalled()
@@ -226,7 +229,7 @@ describe "Keymap", ->
describe "when the event's target node descends from multiple nodes that match selectors with a partial binding match", ->
it "allows any of the bindings to be triggered upon a second keystroke, favoring the most specific selector", ->
keymap.bindKeys ".grandchild-node", 'ctrl-x ctrl-c': 'more-specific-quit'
keymap.bindKeys 'name', ".grandchild-node", 'ctrl-x ctrl-c': 'more-specific-quit'
grandchildNode = fragment.find('.grandchild-node')[0]
moreSpecificQuitHandler = jasmine.createSpy('moreSpecificQuitHandler')
fragment.on 'more-specific-quit', moreSpecificQuitHandler
@@ -250,39 +253,17 @@ describe "Keymap", ->
describe "when there is a complete binding with a more specific selector", ->
it "favors the more specific complete match", ->
describe "when a tab keystroke does not match any bindings", ->
it "returns false to prevent the browser from transferring focus", ->
expect(keymap.handleKeyEvent(keydownEvent('U+0009', target: fragment[0]))).toBe false
describe ".keystrokesByCommandForSelector(selector)", ->
it "returns a hash of all commands and their keybindings", ->
keymap.bindKeys 'body', 'a': 'letter'
keymap.bindKeys '.editor', 'b': 'letter'
keymap.bindKeys '.editor', '1': 'number'
keymap.bindKeys '.editor', 'meta-alt-1': 'number-with-modifiers'
expect(keymap.keystrokesByCommandForSelector()).toEqual
'letter': ['b', 'a']
'number': ['1']
'number-with-modifiers': ['alt-meta-1']
expect(keymap.keystrokesByCommandForSelector('.editor')).toEqual
'letter': ['b']
'number': ['1']
'number-with-modifiers': ['alt-meta-1']
describe ".bindKeys(selector, bindings)", ->
describe ".bindKeys(name, selector, bindings)", ->
it "normalizes the key patterns in the hash to put the modifiers in alphabetical order", ->
fooHandler = jasmine.createSpy('fooHandler')
fragment.on 'foo', fooHandler
keymap.bindKeys '*', 'ctrl-alt-delete': 'foo'
keymap.bindKeys 'name', '*', 'ctrl-alt-delete': 'foo'
result = keymap.handleKeyEvent(keydownEvent('delete', ctrlKey: true, altKey: true, target: fragment[0]))
expect(result).toBe(false)
expect(fooHandler).toHaveBeenCalled()
fooHandler.reset()
keymap.bindKeys '*', 'ctrl-alt--': 'foo'
keymap.bindKeys 'name', '*', 'ctrl-alt--': 'foo'
result = keymap.handleKeyEvent(keydownEvent('-', ctrlKey: true, altKey: true, target: fragment[0]))
expect(result).toBe(false)
expect(fooHandler).toHaveBeenCalled()
@@ -295,15 +276,17 @@ describe "Keymap", ->
'.brown':
'ctrl-h': 'harvest'
expect(keymap.bindingsForElement($$ -> @div class: 'green')).toEqual { 'ctrl-c': 'cultivate' }
expect(keymap.bindingsForElement($$ -> @div class: 'brown')).toEqual { 'ctrl-h': 'harvest' }
keymap.add 'medical',
'.green':
'ctrl-v': 'vomit'
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'green')).toHaveLength 2
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'brown')).toHaveLength 1
keymap.remove('nature')
expect(keymap.bindingsForElement($$ -> @div class: 'green')).toEqual {}
expect(keymap.bindingsForElement($$ -> @div class: 'brown')).toEqual {}
expect(keymap.bindingSetsByFirstKeystroke['ctrl-c']).toEqual []
expect(keymap.bindingSetsByFirstKeystroke['ctrl-h']).toEqual []
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'green')).toHaveLength 1
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'brown')).toEqual []
describe ".keystrokeStringForEvent(event)", ->
describe "when no modifiers are pressed", ->
@@ -314,12 +297,12 @@ describe "Keymap", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('left'))).toBe 'left'
expect(keymap.keystrokeStringForEvent(keydownEvent('\b'))).toBe 'backspace'
describe "when ctrl, alt or meta is pressed with a non-modifier key", ->
describe "when ctrl, alt or command is pressed with a non-modifier key", ->
it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('a', altKey: true))).toBe 'alt-a'
expect(keymap.keystrokeStringForEvent(keydownEvent('[', metaKey: true))).toBe 'meta-['
expect(keymap.keystrokeStringForEvent(keydownEvent('[', metaKey: true))).toBe 'cmd-['
expect(keymap.keystrokeStringForEvent(keydownEvent('*', ctrlKey: true))).toBe 'ctrl-*'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', ctrlKey: true, metaKey: true, altKey: true))).toBe 'alt-ctrl-meta-left'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', ctrlKey: true, metaKey: true, altKey: true))).toBe 'alt-cmd-ctrl-left'
describe "when shift is pressed when a non-modifer key", ->
it "returns a string that identifies the key pressed", ->
@@ -328,54 +311,61 @@ describe "Keymap", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('left', shiftKey: true))).toBe 'shift-left'
expect(keymap.keystrokeStringForEvent(keydownEvent('Left', shiftKey: true))).toBe 'shift-left'
describe ".bindingsForElement(element)", ->
describe ".keyBindingsMatchingElement(element)", ->
it "returns the matching bindings for the element", ->
keymap.bindKeys '.command-mode', 'c': 'c'
keymap.bindKeys '.grandchild-node', 'g': 'g'
keymap.bindKeys 'name', '.command-mode', 'c': 'c'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'g'
bindings = keymap.bindingsForElement(fragment.find('.grandchild-node'))
expect(Object.keys(bindings).length).toBe 2
expect(bindings['c']).toEqual "c"
expect(bindings['g']).toEqual "g"
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 2
expect(bindings[0].command).toEqual "g"
expect(bindings[1].command).toEqual "c"
describe "when multiple bindings match a keystroke", ->
it "only returns bindings that match the most specific selector", ->
keymap.bindKeys '.command-mode', 'g': 'command-mode'
keymap.bindKeys '.command-mode .grandchild-node', 'g': 'command-and-grandchild-node'
keymap.bindKeys '.grandchild-node', 'g': 'grandchild-node'
keymap.bindKeys 'name', '.command-mode', 'g': 'cmd-mode'
keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'cmd-and-grandchild-node'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'grandchild-node'
bindings = keymap.bindingsForElement(fragment.find('.grandchild-node'))
expect(Object.keys(bindings).length).toBe 1
expect(bindings['g']).toEqual "command-and-grandchild-node"
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 3
expect(bindings[0].command).toEqual "cmd-and-grandchild-node"
describe ".getAllKeyMappings", ->
it "returns the all bindings", ->
keymap.bindKeys '~/.atom/packages/dummy/keymaps/a.cson', '.command-mode', 'k': 'c'
describe ".keyBindingsForCommandMatchingElement(element)", ->
beforeEach ->
keymap.add 'nature',
'.green':
'ctrl-c': 'cultivate'
'.green-2':
'ctrl-o': 'cultivate'
'.brown':
'ctrl-h': 'harvest'
'.blue':
'ctrl-c': 'fly'
mappings = keymap.getAllKeyMappings()
expect(mappings.length).toBe 1
expect(mappings[0].source).toEqual 'dummy'
expect(mappings[0].keystrokes).toEqual 'k'
expect(mappings[0].command).toEqual 'c'
expect(mappings[0].selector).toEqual '.command-mode'
it "finds a keymap for an element", ->
el = $$ -> @div class: 'green'
bindings = keymap.keyBindingsForCommandMatchingElement('cultivate', el)
expect(bindings).toHaveLength 1
expect(bindings[0].keystroke).toEqual "ctrl-c"
describe ".determineSource", ->
describe "for a package", ->
it "returns '<package-name>'", ->
expect(keymap.determineSource('~/.atom/packages/dummy/keymaps/a.cson')).toEqual 'dummy'
it "no keymap an element without that map", ->
el = $$ -> @div class: 'brown'
bindings = keymap.keyBindingsForCommandMatchingElement('cultivate', el)
expect(bindings).toHaveLength 0
describe "for a linked package", ->
it "returns '<package-name>'", ->
expect(keymap.determineSource('/Users/john/github/dummy/keymaps/a.cson')).toEqual 'dummy'
describe "when the user keymap file is changed", ->
it "is reloaded", ->
keymapFilePath = path.join(configDirPath, "keymap.cson")
fs.writeFileSync(keymapFilePath, '"body": "ctrl-l": "core:move-left"')
keymap.loadUserKeymap()
describe "for a user defined keymap", ->
it "returns 'User'", ->
expect(keymap.determineSource('~/.atom/keymaps/a.cson')).toEqual 'User'
spyOn(keymap, 'loadUserKeymap').andCallThrough()
fs.writeFileSync(keymapFilePath, "'body': 'ctrl-l': 'core:move-right'")
describe "for a core keymap", ->
it "returns 'Core'", ->
expect(keymap.determineSource('/Applications/Atom.app/.../node_modules/dummy/keymaps/a.cson')).toEqual 'Core'
waitsFor ->
keymap.loadUserKeymap.callCount > 0
describe "for a linked core keymap", ->
it "returns 'Core'", ->
expect(keymap.determineSource('/Users/john/github/atom/keymaps/a.cson')).toEqual 'Core'
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding.command).toBe 'core:move-right'
+56 -56
Ver Arquivo
@@ -1,14 +1,14 @@
describe "LanguageMode", ->
[editSession, buffer, languageMode] = []
[editor, buffer, languageMode] = []
afterEach ->
editSession.destroy()
editor.destroy()
describe "javascript", ->
beforeEach ->
atom.activatePackage('language-javascript', sync: true)
editSession = project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-javascript', sync: true)
editor = atom.project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editor
describe ".minIndentLevelForRowRange(startRow, endRow)", ->
it "returns the minimum indent level for the given row range", ->
@@ -109,9 +109,9 @@ describe "LanguageMode", ->
describe "coffeescript", ->
beforeEach ->
atom.activatePackage('language-coffee-script', sync: true)
editSession = project.openSync('coffee.coffee', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-coffee-script', sync: true)
editor = atom.project.openSync('coffee.coffee', autoIndent: false)
{buffer, languageMode} = editor
describe ".toggleLineCommentsForBufferRows(start, end)", ->
it "comments/uncomments lines in the given range", ->
@@ -156,9 +156,9 @@ describe "LanguageMode", ->
describe "css", ->
beforeEach ->
atom.activatePackage('language-css', sync: true)
editSession = project.openSync('css.css', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-css', sync: true)
editor = atom.project.openSync('css.css', autoIndent: false)
{buffer, languageMode} = editor
describe ".toggleLineCommentsForBufferRows(start, end)", ->
it "comments/uncomments lines in the given range", ->
@@ -197,10 +197,10 @@ describe "LanguageMode", ->
describe "less", ->
beforeEach ->
atom.activatePackage('language-less', sync: true)
atom.activatePackage('language-css', sync: true)
editSession = project.openSync('sample.less', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-less', sync: true)
atom.packages.activatePackage('language-css', sync: true)
editor = atom.project.openSync('sample.less', autoIndent: false)
{buffer, languageMode} = editor
describe "when commenting lines", ->
it "only uses the `commentEnd` pattern if it comes from the same grammar as the `commentStart`", ->
@@ -209,68 +209,68 @@ describe "LanguageMode", ->
describe "folding", ->
beforeEach ->
atom.activatePackage('language-javascript', sync: true)
editSession = project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-javascript', sync: true)
editor = atom.project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editor
it "maintains cursor buffer position when a folding/unfolding", ->
editSession.setCursorBufferPosition([5,5])
editor.setCursorBufferPosition([5,5])
languageMode.foldAll()
expect(editSession.getCursorBufferPosition()).toEqual([5,5])
expect(editor.getCursorBufferPosition()).toEqual([5,5])
describe ".unfoldAll()", ->
it "unfolds every folded line", ->
initialScreenLineCount = editSession.getScreenLineCount()
initialScreenLineCount = editor.getScreenLineCount()
languageMode.foldBufferRow(0)
languageMode.foldBufferRow(1)
expect(editSession.getScreenLineCount()).toBeLessThan initialScreenLineCount
expect(editor.getScreenLineCount()).toBeLessThan initialScreenLineCount
languageMode.unfoldAll()
expect(editSession.getScreenLineCount()).toBe initialScreenLineCount
expect(editor.getScreenLineCount()).toBe initialScreenLineCount
describe ".foldAll()", ->
it "folds every foldable line", ->
languageMode.foldAll()
fold1 = editSession.lineForScreenRow(0).fold
fold1 = editor.lineForScreenRow(0).fold
expect([fold1.getStartRow(), fold1.getEndRow()]).toEqual [0, 12]
fold1.destroy()
fold2 = editSession.lineForScreenRow(1).fold
fold2 = editor.lineForScreenRow(1).fold
expect([fold2.getStartRow(), fold2.getEndRow()]).toEqual [1, 9]
fold2.destroy()
fold3 = editSession.lineForScreenRow(4).fold
fold3 = editor.lineForScreenRow(4).fold
expect([fold3.getStartRow(), fold3.getEndRow()]).toEqual [4, 7]
describe ".foldBufferRow(bufferRow)", ->
describe "when bufferRow can be folded", ->
it "creates a fold based on the syntactic region starting at the given row", ->
languageMode.foldBufferRow(1)
fold = editSession.lineForScreenRow(1).fold
fold = editor.lineForScreenRow(1).fold
expect(fold.getStartRow()).toBe 1
expect(fold.getEndRow()).toBe 9
describe "when bufferRow can't be folded", ->
it "searches upward for the first row that begins a syntatic region containing the given buffer row (and folds it)", ->
languageMode.foldBufferRow(8)
fold = editSession.lineForScreenRow(1).fold
fold = editor.lineForScreenRow(1).fold
expect(fold.getStartRow()).toBe 1
expect(fold.getEndRow()).toBe 9
describe "when the bufferRow is already folded", ->
it "searches upward for the first row that begins a syntatic region containing the folded row (and folds it)", ->
languageMode.foldBufferRow(2)
expect(editSession.lineForScreenRow(1).fold).toBeDefined()
expect(editSession.lineForScreenRow(0).fold).not.toBeDefined()
expect(editor.lineForScreenRow(1).fold).toBeDefined()
expect(editor.lineForScreenRow(0).fold).not.toBeDefined()
languageMode.foldBufferRow(1)
expect(editSession.lineForScreenRow(0).fold).toBeDefined()
expect(editor.lineForScreenRow(0).fold).toBeDefined()
describe "when the bufferRow is in a multi-line comment", ->
it "searches upward and downward for surrounding comment lines and folds them as a single fold", ->
buffer.insert([1,0], " //this is a comment\n // and\n //more docs\n\n//second comment")
languageMode.foldBufferRow(1)
fold = editSession.lineForScreenRow(1).fold
fold = editor.lineForScreenRow(1).fold
expect(fold.getStartRow()).toBe 1
expect(fold.getEndRow()).toBe 3
@@ -278,7 +278,7 @@ describe "LanguageMode", ->
it "searches upward for the first row that begins a syntatic region containing the folded row (and folds it)", ->
buffer.insert([1,0], " //this is a single line comment\n")
languageMode.foldBufferRow(1)
fold = editSession.lineForScreenRow(0).fold
fold = editor.lineForScreenRow(0).fold
expect(fold.getStartRow()).toBe 0
expect(fold.getEndRow()).toBe 13
@@ -286,77 +286,77 @@ describe "LanguageMode", ->
describe "when bufferRow can be unfolded", ->
it "destroys a fold based on the syntactic region starting at the given row", ->
languageMode.foldBufferRow(1)
expect(editSession.lineForScreenRow(1).fold).toBeDefined()
expect(editor.lineForScreenRow(1).fold).toBeDefined()
languageMode.unfoldBufferRow(1)
expect(editSession.lineForScreenRow(1).fold).toBeUndefined()
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
describe "when bufferRow can't be unfolded", ->
it "does not throw an error", ->
expect(editSession.lineForScreenRow(1).fold).toBeUndefined()
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
languageMode.unfoldBufferRow(1)
expect(editSession.lineForScreenRow(1).fold).toBeUndefined()
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
describe "folding with comments", ->
beforeEach ->
atom.activatePackage('language-javascript', sync: true)
editSession = project.openSync('sample-with-comments.js', autoIndent: false)
{buffer, languageMode} = editSession
atom.packages.activatePackage('language-javascript', sync: true)
editor = atom.project.openSync('sample-with-comments.js', autoIndent: false)
{buffer, languageMode} = editor
describe ".unfoldAll()", ->
it "unfolds every folded line", ->
initialScreenLineCount = editSession.getScreenLineCount()
initialScreenLineCount = editor.getScreenLineCount()
languageMode.foldBufferRow(0)
languageMode.foldBufferRow(5)
expect(editSession.getScreenLineCount()).toBeLessThan initialScreenLineCount
expect(editor.getScreenLineCount()).toBeLessThan initialScreenLineCount
languageMode.unfoldAll()
expect(editSession.getScreenLineCount()).toBe initialScreenLineCount
expect(editor.getScreenLineCount()).toBe initialScreenLineCount
describe ".foldAll()", ->
it "folds every foldable line", ->
languageMode.foldAll()
fold1 = editSession.lineForScreenRow(0).fold
fold1 = editor.lineForScreenRow(0).fold
expect([fold1.getStartRow(), fold1.getEndRow()]).toEqual [0, 19]
fold1.destroy()
fold2 = editSession.lineForScreenRow(1).fold
fold2 = editor.lineForScreenRow(1).fold
expect([fold2.getStartRow(), fold2.getEndRow()]).toEqual [1, 4]
fold3 = editSession.lineForScreenRow(2).fold.destroy()
fold3 = editor.lineForScreenRow(2).fold.destroy()
fold4 = editSession.lineForScreenRow(3).fold
fold4 = editor.lineForScreenRow(3).fold
expect([fold4.getStartRow(), fold4.getEndRow()]).toEqual [6, 8]
describe ".foldAllAtIndentLevel()", ->
it "folds every foldable range at a given indentLevel", ->
languageMode.foldAllAtIndentLevel(2)
fold1 = editSession.lineForScreenRow(6).fold
fold1 = editor.lineForScreenRow(6).fold
expect([fold1.getStartRow(), fold1.getEndRow()]).toEqual [6, 8]
fold1.destroy()
fold2 = editSession.lineForScreenRow(11).fold
fold2 = editor.lineForScreenRow(11).fold
expect([fold2.getStartRow(), fold2.getEndRow()]).toEqual [11, 14]
fold2.destroy()
it "does not fold anything but the indentLevel", ->
languageMode.foldAllAtIndentLevel(0)
fold1 = editSession.lineForScreenRow(0).fold
fold1 = editor.lineForScreenRow(0).fold
expect([fold1.getStartRow(), fold1.getEndRow()]).toEqual [0, 19]
fold1.destroy()
fold2 = editSession.lineForScreenRow(5).fold
fold2 = editor.lineForScreenRow(5).fold
expect(fold2).toBeFalsy()
describe "css", ->
beforeEach ->
atom.activatePackage('language-source', sync: true)
atom.activatePackage('language-css', sync: true)
editSession = project.openSync('css.css', autoIndent: true)
atom.packages.activatePackage('language-source', sync: true)
atom.packages.activatePackage('language-css', sync: true)
editor = atom.project.openSync('css.css', autoIndent: true)
describe "suggestedIndentForBufferRow", ->
it "does not return negative values (regression)", ->
editSession.setText('.test {\npadding: 0;\n}')
expect(editSession.suggestedIndentForBufferRow(2)).toBe 0
editor.setText('.test {\npadding: 0;\n}')
expect(editor.suggestedIndentForBufferRow(2)).toBe 0
-110
Ver Arquivo
@@ -1,110 +0,0 @@
path = require 'path'
temp = require 'temp'
{Site} = require 'telepath'
{View} = require 'atom'
PaneContainer = require '../src/pane-container'
Pane = require '../src/pane'
Environment = require './environment'
describe "PaneContainer replication", ->
[env1, env2, envConnection, container1, container2, pane1a, pane1b, pane1c] = []
class TestView extends View
@deserialize: ({name}) -> new TestView(name)
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getState: -> @serialize()
getUri: -> path.join(temp.dir, @name)
isEqual: (other) -> @name is other.name
beforeEach ->
registerDeserializer(TestView)
env1 = new Environment(siteId: 1)
env2 = env1.clone(siteId: 2)
envConnection = env1.connect(env2)
doc2 = null
env1.run ->
container1 = new PaneContainer
pane1a = new Pane(new TestView('A'))
container1.setRoot(pane1a)
pane1b = pane1a.splitRight(new TestView('B'))
pane1c = pane1b.splitDown(new TestView('C'))
doc1 = container1.getState()
doc2 = doc1.clone(env2.site)
envConnection.connect(doc1, doc2)
env2.run ->
container2 = deserialize(doc2)
afterEach ->
env1.destroy()
env2.destroy()
unregisterDeserializer(TestView)
it "replicates the inital state of a pane container with splits", ->
expect(container1.find('.row > :eq(0):contains(A)')).toExist()
expect(container1.find('.row > :eq(1)')).toHaveClass 'column'
expect(container1.find('.row > :eq(1) > :eq(0):contains(B)')).toExist()
expect(container1.find('.row > :eq(1) > :eq(1):contains(C)')).toExist()
expect(container2.find('.row > :eq(0):contains(A)')).toExist()
expect(container2.find('.row > :eq(1)')).toHaveClass 'column'
expect(container2.find('.row > :eq(1) > :eq(0):contains(B)')).toExist()
expect(container2.find('.row > :eq(1) > :eq(1):contains(C)')).toExist()
it "replicates the splitting of panes", ->
container1.attachToDom().width(400).height(200)
container2.attachToDom().width(400).height(200)
pane1d = pane1a.splitRight(new TestView('D'))
expect(container1.find('.row > :eq(1):contains(D)')).toExist()
expect(container2.find('.row > :eq(1):contains(D)')).toExist()
expect(container2.find('.row > :eq(1):contains(D)').outerWidth()).toBe container1.find('.row > :eq(1):contains(D)').outerWidth()
pane1d.splitDown(new TestView('E'))
expect(container1.find('.row > :eq(1)')).toHaveClass('column')
expect(container1.find('.row > :eq(1) > :eq(0):contains(D)')).toExist()
expect(container1.find('.row > :eq(1) > :eq(1):contains(E)')).toExist()
expect(container2.find('.row > :eq(1)')).toHaveClass('column')
expect(container2.find('.row > :eq(1) > :eq(0):contains(D)')).toExist()
expect(container2.find('.row > :eq(1) > :eq(1):contains(E)')).toExist()
it "replicates removal of panes", ->
pane1c.remove()
expect(container1.find('.row > :eq(0):contains(A)')).toExist()
expect(container1.find('.row > :eq(1):contains(B)')).toExist()
expect(container2.find('.row > :eq(0):contains(A)')).toExist()
expect(container2.find('.row > :eq(1):contains(B)')).toExist()
pane1b.remove()
expect(container1.find('> :eq(0):contains(A)')).toExist()
expect(container2.find('> :eq(0):contains(A)')).toExist()
pane1a.remove()
expect(container1.children()).not.toExist()
expect(container2.children()).not.toExist()
# FIXME: We need to get this passing again on master
xit "replicates splitting of panes containing edit sessions", ->
env1.run ->
pane1a.showItem(project.openSync('dir/a'))
pane1a.splitDown()
expect(project.getBuffers().length).toBe 1
expect(container1.find('.row > :eq(0) > :eq(0)').view().activeItem.getRelativePath()).toBe 'dir/a'
expect(container1.find('.row > :eq(0) > :eq(1)').view().activeItem.getRelativePath()).toBe 'dir/a'
env2.run ->
expect(container2.find('.row > :eq(0) > :eq(0)').view().activeItem.getRelativePath()).toBe 'dir/a'
expect(container2.find('.row > :eq(0) > :eq(1)').view().activeItem.getRelativePath()).toBe 'dir/a'
+57 -321
Ver Arquivo
@@ -1,341 +1,77 @@
path = require 'path'
temp = require 'temp'
PaneContainer = require '../src/pane-container'
Pane = require '../src/pane'
{_, $, View, $$} = require 'atom'
describe "PaneContainer", ->
[TestView, container, pane1, pane2, pane3] = []
beforeEach ->
class TestView extends View
registerDeserializer(this)
@deserialize: ({name}) -> new TestView(name)
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other.name
container = new PaneContainer
pane1 = new Pane(new TestView('1'))
container.setRoot(pane1)
pane2 = pane1.splitRight(new TestView('2'))
pane3 = pane2.splitDown(new TestView('3'))
afterEach ->
unregisterDeserializer(TestView)
describe ".focusNextPane()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
describe ".focusPreviousPane()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
describe ".getActivePane()", ->
it "returns the most-recently focused pane", ->
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
focusStealer.attachToDom()
container.attachToDom()
pane2.focus()
expect(container.getFocusedPane()).toBe pane2
expect(container.getActivePane()).toBe pane2
focusStealer.focus()
expect(container.getFocusedPane()).toBeUndefined()
expect(container.getActivePane()).toBe pane2
pane3.focus()
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3
# returns the first pane if none have been set to active
container.find('.pane.active').removeClass('active')
expect(container.getActivePane()).toBe pane1
describe ".eachPane(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
panes = []
subscription = container.eachPane (pane) -> panes.push(pane)
expect(panes).toEqual [pane1, pane2, pane3]
panes = []
pane4 = pane3.splitRight()
expect(panes).toEqual [pane4]
panes = []
subscription.cancel()
pane4.splitDown()
expect(panes).toEqual []
describe ".reopenItem()", ->
describe "when there is an active pane", ->
it "reconstructs and shows the last-closed pane item", ->
expect(container.getActivePane()).toBe pane3
item3 = pane3.activeItem
item4 = new TestView('4')
pane3.showItem(item4)
pane3.destroyItem(item3)
pane3.destroyItem(item4)
expect(container.getActivePane()).toBe pane1
expect(container.reopenItem()).toBeTruthy()
expect(pane1.activeItem).toEqual item4
expect(container.reopenItem()).toBeTruthy()
expect(pane1.activeItem).toEqual item3
expect(container.reopenItem()).toBeFalsy()
expect(pane1.activeItem).toEqual item3
describe "when the last-closed pane item is an edit session", ->
it "reopens the edit session (regression)", ->
editSession = project.openSync('sample.js')
pane3.showItem(editSession)
pane3.destroyItem(editSession)
expect(container.reopenItem()).toBeTruthy()
expect(pane3.activeItem.getPath()).toBe editSession.getPath()
expect(container.reopenItem()).toBeFalsy()
describe "when there is no active pane", ->
it "attaches a new pane with the reconstructed last pane item and focuses it", ->
container.attachToDom()
pane1.remove()
pane2.remove()
item3 = pane3.activeItem
pane3.destroyItem(item3)
expect(container.getActivePane()).toBeUndefined()
container.reopenItem()
expect(container.getActivePane().activeItem).toEqual item3
expect(container.getActivePane().activeView).toMatchSelector ':focus'
it "does not reopen an item that is already open", ->
item3 = pane3.activeItem
item4 = new TestView('4')
pane3.showItem(item4)
pane3.destroyItem(item3)
pane3.destroyItem(item4)
expect(container.getActivePane()).toBe pane1
pane1.showItem(new TestView('4'))
expect(container.reopenItem()).toBeTruthy()
expect(_.pluck(pane1.getItems(), 'name')).toEqual ['1', '4', '3']
expect(pane1.activeItem).toEqual item3
expect(container.reopenItem()).toBeFalsy()
expect(pane1.activeItem).toEqual item3
pane1.destroyItem(item3)
container.setRoot(new Pane(item3))
expect(container.reopenItem()).toBeFalsy()
expect(container.getActivePane().getItems().length).toBe 1
expect(container.getActivePaneItem()).toEqual item3
describe ".saveAll()", ->
it "saves all open pane items", ->
pane1.showItem(new TestView('4'))
container.saveAll()
for pane in container.getPanes()
for item in pane.getItems()
expect(item.saved).toBeTruthy()
describe ".confirmClose()", ->
it "returns true after modified files are saved", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirmSync").andReturn(0)
saved = container.confirmClose()
runs ->
expect(saved).toBeTruthy()
expect(atom.confirmSync).toHaveBeenCalled()
it "returns false if the user cancels saving", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirmSync").andReturn(1)
saved = container.confirmClose()
runs ->
expect(saved).toBeFalsy()
expect(atom.confirmSync).toHaveBeenCalled()
describe "serialization", ->
it "can be serialized and deserialized, and correctly adjusts dimensions of deserialized panes after attach", ->
newContainer = deserialize(container.serialize())
expect(newContainer.find('.row > :contains(1)')).toExist()
expect(newContainer.find('.row > .column > :contains(2)')).toExist()
expect(newContainer.find('.row > .column > :contains(3)')).toExist()
[containerA, pane1A, pane2A, pane3A] = []
newContainer.height(200).width(300).attachToDom()
expect(newContainer.find('.row > :contains(1)').width()).toBe 150
expect(newContainer.find('.row > .column > :contains(2)').height()).toBe 100
xit "removes empty panes on deserialization", ->
# only deserialize pane 1's view successfully
TestView.deserialize = ({name}) -> new TestView(name) if name is '1'
newContainer = deserialize(container.serialize())
expect(newContainer.find('.row, .column')).not.toExist()
expect(newContainer.find('> :contains(1)')).toExist()
describe "pane-container:active-pane-item-changed", ->
[pane1, item1a, item1b, item2a, item2b, item3a, container, activeItemChangedHandler] = []
beforeEach ->
item1a = new TestView('1a')
item1b = new TestView('1b')
item2a = new TestView('2a')
item2b = new TestView('2b')
item3a = new TestView('3a')
# This is a dummy item to prevent panes from being empty on deserialization
class Item
atom.deserializers.add(this)
@deserialize: -> new this
serialize: -> deserializer: 'Item'
container = new PaneContainer
container.attachToDom()
pane1 = new Pane(item1a)
container.setRoot(pane1)
pane1A = new Pane(items: [new Item])
containerA = new PaneContainer(root: pane1A)
pane2A = pane1A.splitRight(items: [new Item])
pane3A = pane2A.splitDown(items: [new Item])
activeItemChangedHandler = jasmine.createSpy("activeItemChangedHandler")
container.on 'pane-container:active-pane-item-changed', activeItemChangedHandler
it "preserves the focused pane across serialization", ->
expect(pane3A.focused).toBe true
describe "when there are no panes", ->
it "is triggered when a new pane containing a pane item is added", ->
container.setRoot()
expect(container.getPanes().length).toBe 0
activeItemChangedHandler.reset()
containerB = containerA.testSerialization()
[pane1B, pane2B, pane3B] = containerB.getPanes()
expect(pane3B.focused).toBe true
pane = new Pane(item1a)
container.setRoot(pane)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "preserves the active pane across serialization, independent of focus", ->
pane3A.activate()
expect(containerA.activePane).toBe pane3A
describe "when there is one pane", ->
it "is triggered when a new pane item is added", ->
pane1.showItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1b
containerB = containerA.testSerialization()
[pane1B, pane2B, pane3B] = containerB.getPanes()
expect(containerB.activePane).toBe pane3B
it "is not triggered when the active pane item is shown again", ->
pane1.showItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
describe "::activePane", ->
[container, pane1, pane2] = []
it "is triggered when switching to an existing pane item", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
beforeEach ->
pane1 = new Pane
container = new PaneContainer(root: pane1)
pane1.showItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "references the first pane if no pane has been made active", ->
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
it "is triggered when the active pane item is removed", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
it "references the most pane on which ::activate was most recently called", ->
pane2 = pane1.splitRight()
pane2.activate()
expect(container.activePane).toBe pane2
expect(pane1.active).toBe false
expect(pane2.active).toBe true
pane1.activate()
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
expect(pane2.active).toBe false
pane1.removeItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is reassigned to the next pane if the current active pane is destroyed", ->
pane2 = pane1.splitRight()
pane2.activate()
pane2.destroy()
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
pane1.destroy()
expect(container.activePane).toBe null
it "is not triggered when an inactive pane item is removed", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
describe "when the last pane is removed", ->
[container, pane, surrenderedFocusHandler] = []
pane1.removeItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
beforeEach ->
pane = new Pane
container = new PaneContainer(root: pane)
container.on 'surrendered-focus', surrenderedFocusHandler = jasmine.createSpy("surrenderedFocusHandler")
it "is triggered when all pane items are removed", ->
pane1.removeItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
it "is triggered when the pane is removed", ->
pane1.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
describe "when there are two panes", ->
[pane2] = []
beforeEach ->
pane2 = pane1.splitLeft(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane item is added to the active pane", ->
pane2.showItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2b
it "is not triggered when a new pane item is added to an inactive pane", ->
pane1.showItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane item removed from the active pane", ->
pane2.showItem(item2b)
activeItemChangedHandler.reset()
pane2.removeItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2a
it "is not triggered when the active pane item removed from an inactive pane", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
pane1.removeItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is removed", ->
pane2.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane is removed", ->
pane1.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is changed", ->
pane1.makeActive()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
describe "when there are multiple panes", ->
beforeEach ->
pane2 = pane1.splitRight(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane is added", ->
pane2.splitDown(item3a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item3a
it "is not triggered when the non active pane is removed", ->
pane3 = pane2.splitDown(item3a)
activeItemChangedHandler.reset()
pane1.remove()
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "assigns null to the root and the activePane", ->
pane.destroy()
expect(container.root).toBe null
expect(container.activePane).toBe null
+272
Ver Arquivo
@@ -0,0 +1,272 @@
path = require 'path'
temp = require 'temp'
PaneContainerView = require '../src/pane-container-view'
PaneView = require '../src/pane-view'
{_, $, View, $$} = require 'atom'
describe "PaneContainerView", ->
[TestView, container, pane1, pane2, pane3] = []
beforeEach ->
class TestView extends View
atom.deserializers.add(this)
@deserialize: ({name}) -> new TestView(name)
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other?.name
container = new PaneContainerView
pane1 = new PaneView(new TestView('1'))
container.setRoot(pane1)
pane2 = pane1.splitRight(new TestView('2'))
pane3 = pane2.splitDown(new TestView('3'))
afterEach ->
atom.deserializers.remove(TestView)
describe ".focusNextPane()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
describe ".focusPreviousPane()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
$(document.body).focus() # clear focus
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
describe ".getActivePane()", ->
it "returns the most-recently focused pane", ->
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
focusStealer.attachToDom()
container.attachToDom()
pane2.focus()
expect(container.getFocusedPane()).toBe pane2
expect(container.getActivePane()).toBe pane2
focusStealer.focus()
expect(container.getFocusedPane()).toBeUndefined()
expect(container.getActivePane()).toBe pane2
pane3.focus()
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3
describe ".eachPane(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
panes = []
subscription = container.eachPane (pane) -> panes.push(pane)
expect(panes).toEqual [pane1, pane2, pane3]
panes = []
pane4 = pane3.splitRight(pane3.copyActiveItem())
expect(panes).toEqual [pane4]
panes = []
subscription.off()
pane4.splitDown()
expect(panes).toEqual []
describe ".saveAll()", ->
it "saves all open pane items", ->
pane1.activateItem(new TestView('4'))
container.saveAll()
for pane in container.getPanes()
for item in pane.getItems()
expect(item.saved).toBeTruthy()
describe ".confirmClose()", ->
it "returns true after modified files are saved", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(0)
saved = container.confirmClose()
runs ->
expect(saved).toBeTruthy()
expect(atom.confirm).toHaveBeenCalled()
it "returns false if the user cancels saving", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(1)
saved = container.confirmClose()
runs ->
expect(saved).toBeFalsy()
expect(atom.confirm).toHaveBeenCalled()
describe "serialization", ->
it "can be serialized and deserialized, and correctly adjusts dimensions of deserialized panes after attach", ->
newContainer = atom.deserializers.deserialize(container.serialize())
expect(newContainer.find('.pane-row > :contains(1)')).toExist()
expect(newContainer.find('.pane-row > .pane-column > :contains(2)')).toExist()
expect(newContainer.find('.pane-row > .pane-column > :contains(3)')).toExist()
newContainer.height(200).width(300).attachToDom()
expect(newContainer.find('.pane-row > :contains(1)').width()).toBe 150
expect(newContainer.find('.pane-row > .pane-column > :contains(2)').height()).toBe 100
it "removes empty panes on deserialization", ->
# only deserialize pane 1's view successfully
TestView.deserialize = ({name}) -> new TestView(name) if name is '1'
newContainer = atom.deserializers.deserialize(container.serialize())
expect(newContainer.find('.pane-row, .pane-column')).not.toExist()
expect(newContainer.find('> :contains(1)')).toExist()
describe "pane-container:active-pane-item-changed", ->
[pane1, item1a, item1b, item2a, item2b, item3a, container, activeItemChangedHandler] = []
beforeEach ->
item1a = new TestView('1a')
item1b = new TestView('1b')
item2a = new TestView('2a')
item2b = new TestView('2b')
item3a = new TestView('3a')
container = new PaneContainerView
container.attachToDom()
pane1 = new PaneView(item1a)
container.setRoot(pane1)
activeItemChangedHandler = jasmine.createSpy("activeItemChangedHandler")
container.on 'pane-container:active-pane-item-changed', activeItemChangedHandler
describe "when there are no panes", ->
it "is triggered when a new pane containing a pane item is added", ->
container.setRoot()
expect(container.getPanes().length).toBe 0
activeItemChangedHandler.reset()
pane = new PaneView(item1a)
container.setRoot(pane)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
describe "when there is one pane", ->
it "is triggered when a new pane item is added", ->
pane1.activateItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1b
it "is not triggered when the active pane item is shown again", ->
pane1.activateItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when switching to an existing pane item", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.activateItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is triggered when the active pane item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when all pane items are destroyed", ->
pane1.destroyItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
it "is triggered when the pane is destroyed", ->
pane1.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
describe "when there are two panes", ->
[pane2] = []
beforeEach ->
pane2 = pane1.splitLeft(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane item is added to the active pane", ->
pane2.activateItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2b
it "is not triggered when a new pane item is added to an inactive pane", ->
pane1.activateItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane's active item is destroyed", ->
pane2.activateItem(item2b)
activeItemChangedHandler.reset()
pane2.destroyItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2a
it "is not triggered when an inactive pane's active item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is destroyed", ->
pane2.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane is destroyed", ->
pane1.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is changed", ->
pane1.activate()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
describe "when there are multiple panes", ->
beforeEach ->
pane2 = pane1.splitRight(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane is added", ->
pane2.splitDown(item3a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item3a
it "is not triggered when an inactive pane is destroyed", ->
pane3 = pane2.splitDown(item3a)
activeItemChangedHandler.reset()
pane1.remove()
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
-40
Ver Arquivo
@@ -1,40 +0,0 @@
PaneContainer = require '../src/pane-container'
Pane = require '../src/pane'
{Site} = require 'telepath'
describe "Pane replication", ->
[editSession1a, editSession1b, container1, pane1, doc1] = []
[editSession2a, editSession2b, container2, pane2, doc2] = []
beforeEach ->
editSession1a = project.openSync('sample.js')
editSession1b = project.openSync('sample.txt')
container1 = new PaneContainer
pane1 = new Pane(editSession1a, editSession1b)
container1.setRoot(pane1)
doc1 = container1.getState()
doc2 = doc1.clone(new Site(2))
doc1.connect(doc2)
container2 = deserialize(doc2)
pane2 = container2.getRoot()
it "replicates the initial state of the panes", ->
expect(pane2.items).toEqual(pane1.items)
it "replicates addition and removal of pane items", ->
pane1.addItem(project.openSync('css.css'), 1)
expect(pane2.items).toEqual(pane1.items)
pane1.removeItemAtIndex(2)
expect(pane2.items).toEqual(pane1.items)
it "replicates the movement of pane items", ->
pane1.moveItem(editSession1a, 1)
expect(pane2.items).toEqual(pane1.items)
it "replicates which pane item is active", ->
pane1.showNextItem()
expect(pane2.activeItem).toEqual pane1.activeItem
pane1.showNextItem()
expect(pane2.activeItem).toEqual pane1.activeItem
+124 -696
Ver Arquivo
@@ -1,706 +1,134 @@
PaneContainer = require '../src/pane-container'
{Model} = require 'theorist'
Pane = require '../src/pane'
{$, View} = require 'atom'
path = require 'path'
temp = require 'temp'
PaneAxis = require '../src/pane-axis'
PaneContainer = require '../src/pane-container'
describe "Pane", ->
[container, view1, view2, editSession1, editSession2, pane] = []
class TestView extends View
@deserialize: ({id, text}) -> new TestView({id, text})
@content: ({id, text}) -> @div class: 'test-view', id: id, tabindex: -1, text
initialize: ({@id, @text}) ->
serialize: -> { deserializer: 'TestView', @id, @text }
getUri: -> @id
isEqual: (other) -> @id == other.id and @text == other.text
beforeEach ->
registerDeserializer(TestView)
container = new PaneContainer
view1 = new TestView(id: 'view-1', text: 'View 1')
view2 = new TestView(id: 'view-2', text: 'View 2')
editSession1 = project.openSync('sample.js')
editSession2 = project.openSync('sample.txt')
pane = new Pane(view1, editSession1, view2, editSession2)
container.setRoot(pane)
afterEach ->
unregisterDeserializer(TestView)
describe ".initialize(items...)", ->
it "displays the first item in the pane", ->
expect(pane.itemViews.find('#view-1')).toExist()
describe ".showItem(item)", ->
it "hides all item views except the one being shown and sets the activeItem", ->
expect(pane.activeItem).toBe view1
pane.showItem(view2)
expect(view1.css('display')).toBe 'none'
expect(view2.css('display')).not.toBe 'none'
expect(pane.activeItem).toBe view2
it "triggers 'pane:active-item-changed' if the item isn't already the activeItem", ->
pane.makeActive()
itemChangedHandler = jasmine.createSpy("itemChangedHandler")
container.on 'pane:active-item-changed', itemChangedHandler
expect(pane.activeItem).toBe view1
pane.showItem(view2)
pane.showItem(view2)
expect(itemChangedHandler.callCount).toBe 1
expect(itemChangedHandler.argsForCall[0][1]).toBe view2
itemChangedHandler.reset()
pane.showItem(editSession1)
expect(itemChangedHandler).toHaveBeenCalled()
expect(itemChangedHandler.argsForCall[0][1]).toBe editSession1
itemChangedHandler.reset()
describe "if the pane's active view is focused before calling showItem", ->
it "focuses the new active view", ->
container.attachToDom()
pane.focus()
expect(pane.activeView).not.toBe view2
expect(pane.activeView).toMatchSelector ':focus'
pane.showItem(view2)
expect(view2).toMatchSelector ':focus'
describe "when the given item isn't yet in the items list on the pane", ->
view3 = null
beforeEach ->
view3 = new TestView(id: 'view-3', text: "View 3")
pane.showItem(editSession1)
expect(pane.getActiveItemIndex()).toBe 1
it "adds it to the items list after the active item", ->
pane.showItem(view3)
expect(pane.getItems()).toEqual [view1, editSession1, view3, view2, editSession2]
expect(pane.activeItem).toBe view3
expect(pane.getActiveItemIndex()).toBe 2
it "triggers the 'item-added' event with the item and its index before the 'active-item-changed' event", ->
events = []
container.on 'pane:item-added', (e, item, index) -> events.push(['pane:item-added', item, index])
container.on 'pane:active-item-changed', (e, item) -> events.push(['pane:active-item-changed', item])
pane.showItem(view3)
expect(events).toEqual [['pane:item-added', view3, 2], ['pane:active-item-changed', view3]]
describe "when showing a model item", ->
describe "when no view has yet been appended for that item", ->
it "appends and shows a view to display the item based on its `.getViewClass` method", ->
pane.showItem(editSession1)
editor = pane.activeView
expect(editor.css('display')).not.toBe 'none'
expect(editor.activeEditSession).toBe editSession1
describe "when a valid view has already been appended for another item", ->
it "multiple views are created for multiple items", ->
pane.showItem(editSession1)
pane.showItem(editSession2)
expect(pane.itemViews.find('.editor').length).toBe 2
editor = pane.activeView
expect(editor.css('display')).not.toBe 'none'
expect(editor.activeEditSession).toBe editSession2
it "creates a new view with the item", ->
initialViewCount = pane.itemViews.find('.test-view').length
model1 =
id: 'test-model-1'
text: 'Test Model 1'
serialize: -> {@id, @text}
getViewClass: -> TestView
model2 =
id: 'test-model-2'
text: 'Test Model 2'
serialize: -> {@id, @text}
getViewClass: -> TestView
pane.showItem(model1)
pane.showItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
pane.showPreviousItem()
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
pane.removeItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 1
pane.removeItem(model1)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount
describe "when showing a view item", ->
it "appends it to the itemViews div if it hasn't already been appended and shows it", ->
expect(pane.itemViews.find('#view-2')).not.toExist()
pane.showItem(view2)
expect(pane.itemViews.find('#view-2')).toExist()
expect(pane.activeView).toBe view2
describe ".destroyItem(item)", ->
describe "if the item is not modified", ->
it "removes the item and tries to call destroy on it", ->
pane.destroyItem(editSession2)
expect(pane.getItems().indexOf(editSession2)).toBe -1
expect(editSession2.destroyed).toBeTruthy()
describe "if the item is modified", ->
beforeEach ->
spyOn(editSession2, 'save')
spyOn(editSession2, 'saveAs')
editSession2.insertText('a')
expect(editSession2.isModified()).toBeTruthy()
describe "if the [Save] option is selected", ->
describe "when the item has a uri", ->
it "saves the item before removing and destroying it", ->
spyOn(atom, 'confirmSync').andReturn(0)
pane.destroyItem(editSession2)
expect(editSession2.save).toHaveBeenCalled()
expect(pane.getItems().indexOf(editSession2)).toBe -1
expect(editSession2.destroyed).toBeTruthy()
describe "when the item has no uri", ->
it "presents a save-as dialog, then saves the item with the given uri before removing and destroying it", ->
editSession2.buffer.setPath(undefined)
spyOn(atom, 'showSaveDialogSync').andReturn("/selected/path")
spyOn(atom, 'confirmSync').andReturn(0)
pane.destroyItem(editSession2)
expect(atom.showSaveDialogSync).toHaveBeenCalled()
expect(editSession2.saveAs).toHaveBeenCalledWith("/selected/path")
expect(pane.getItems().indexOf(editSession2)).toBe -1
expect(editSession2.destroyed).toBeTruthy()
describe "if the [Don't Save] option is selected", ->
it "removes and destroys the item without saving it", ->
spyOn(atom, 'confirmSync').andReturn(2)
pane.destroyItem(editSession2)
expect(editSession2.save).not.toHaveBeenCalled()
expect(pane.getItems().indexOf(editSession2)).toBe -1
expect(editSession2.destroyed).toBeTruthy()
describe "if the [Cancel] option is selected", ->
it "does not save, remove, or destroy the item", ->
spyOn(atom, 'confirmSync').andReturn(1)
pane.destroyItem(editSession2)
expect(editSession2.save).not.toHaveBeenCalled()
expect(pane.getItems().indexOf(editSession2)).not.toBe -1
expect(editSession2.destroyed).toBeFalsy()
describe ".removeItem(item)", ->
it "removes the item from the items list and shows the next item if it was showing", ->
pane.removeItem(view1)
expect(pane.getItems()).toEqual [editSession1, view2, editSession2]
expect(pane.activeItem).toBe editSession1
pane.showItem(editSession2)
pane.removeItem(editSession2)
expect(pane.getItems()).toEqual [editSession1, view2]
expect(pane.activeItem).toBe editSession1
it "triggers 'pane:item-removed' with the item and its former index", ->
itemRemovedHandler = jasmine.createSpy("itemRemovedHandler")
pane.on 'pane:item-removed', itemRemovedHandler
pane.removeItem(editSession1)
expect(itemRemovedHandler).toHaveBeenCalled()
expect(itemRemovedHandler.argsForCall[0][1..2]).toEqual [editSession1, 1]
describe "when removing the last item", ->
it "removes the pane", ->
pane.removeItem(item) for item in pane.getItems()
expect(pane.hasParent()).toBeFalsy()
describe "when the pane is focused", ->
it "shifts focus to the next pane", ->
expect(container.getRoot()).toBe pane
container.attachToDom()
pane2 = pane.splitRight(new TestView(id: 'view-3', text: 'View 3'))
pane.focus()
expect(pane).toMatchSelector(':has(:focus)')
pane.removeItem(item) for item in pane.getItems()
expect(pane2).toMatchSelector ':has(:focus)'
describe "when the item is a view", ->
it "removes the item from the 'item-views' div", ->
expect(view1.parent()).toMatchSelector pane.itemViews
pane.removeItem(view1)
expect(view1.parent()).not.toMatchSelector pane.itemViews
describe "when the item is a model", ->
it "removes the associated view only when all items that require it have been removed", ->
pane.showItem(editSession1)
pane.showItem(editSession2)
pane.removeItem(editSession2)
expect(pane.itemViews.find('.editor')).toExist()
pane.removeItem(editSession1)
expect(pane.itemViews.find('.editor')).not.toExist()
describe ".moveItem(item, index)", ->
it "moves the item to the given index and emits a 'pane:item-moved' event with the item and the new index", ->
itemMovedHandler = jasmine.createSpy("itemMovedHandler")
pane.on 'pane:item-moved', itemMovedHandler
pane.moveItem(view1, 2)
expect(pane.getItems()).toEqual [editSession1, view2, view1, editSession2]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [view1, 2]
itemMovedHandler.reset()
pane.moveItem(editSession1, 3)
expect(pane.getItems()).toEqual [view2, view1, editSession2, editSession1]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [editSession1, 3]
itemMovedHandler.reset()
pane.moveItem(editSession1, 1)
expect(pane.getItems()).toEqual [view2, editSession1, view1, editSession2]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [editSession1, 1]
itemMovedHandler.reset()
describe ".moveItemToPane(item, pane, index)", ->
[pane2, view3] = []
beforeEach ->
view3 = new TestView(id: 'view-3', text: "View 3")
pane2 = pane.splitRight(view3)
it "moves the item to the given pane at the given index", ->
pane.moveItemToPane(view1, pane2, 1)
expect(pane.getItems()).toEqual [editSession1, view2, editSession2]
expect(pane2.getItems()).toEqual [view3, view1]
describe "when it is the last item on the source pane", ->
it "removes the source pane, but does not destroy the item", ->
pane.removeItem(view1)
pane.removeItem(view2)
pane.removeItem(editSession2)
expect(pane.getItems()).toEqual [editSession1]
pane.moveItemToPane(editSession1, pane2, 1)
expect(pane.hasParent()).toBeFalsy()
expect(pane2.getItems()).toEqual [view3, editSession1]
expect(editSession1.destroyed).toBeFalsy()
describe "when the item is a jQuery object", ->
it "preserves data by detaching instead of removing", ->
view1.data('preservative', 1234)
pane.moveItemToPane(view1, pane2, 1)
pane2.showItemAtIndex(1)
expect(pane2.activeView.data('preservative')).toBe 1234
describe "core:close", ->
it "destroys the active item and does not bubble the event", ->
containerCloseHandler = jasmine.createSpy("containerCloseHandler")
container.on 'core:close', containerCloseHandler
pane.showItem(editSession1)
initialItemCount = pane.getItems().length
pane.trigger 'core:close'
expect(pane.getItems().length).toBe initialItemCount - 1
expect(editSession1.destroyed).toBeTruthy()
expect(containerCloseHandler).not.toHaveBeenCalled()
describe "pane:close", ->
it "destroys all items and removes the pane", ->
pane.showItem(editSession1)
pane.trigger 'pane:close'
expect(pane.hasParent()).toBeFalsy()
expect(editSession2.destroyed).toBeTruthy()
expect(editSession1.destroyed).toBeTruthy()
describe "pane:close-other-items", ->
it "destroys all items except the current", ->
pane.showItem(editSession1)
pane.trigger 'pane:close-other-items'
expect(editSession2.destroyed).toBeTruthy()
expect(pane.getItems()).toEqual [editSession1]
describe "core:save", ->
describe "when the current item has a uri", ->
describe "when the current item has a save method", ->
it "saves the current item", ->
spyOn(editSession2, 'save')
pane.showItem(editSession2)
pane.trigger 'core:save'
expect(editSession2.save).toHaveBeenCalled()
describe "when the current item has no save method", ->
it "does nothing", ->
pane.activeItem.getUri = -> 'you are eye'
expect(pane.activeItem.save).toBeUndefined()
pane.trigger 'core:save'
describe "when the current item has no uri", ->
beforeEach ->
spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
describe "when the current item has a saveAs method", ->
it "opens a save dialog and saves the current item as the selected path", ->
spyOn(editSession2, 'saveAs')
editSession2.buffer.setPath(undefined)
pane.showItem(editSession2)
pane.trigger 'core:save'
expect(atom.showSaveDialogSync).toHaveBeenCalled()
expect(editSession2.saveAs).toHaveBeenCalledWith('/selected/path')
describe "when the current item has no saveAs method", ->
it "does nothing", ->
expect(pane.activeItem.saveAs).toBeUndefined()
pane.trigger 'core:save'
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "core:save-as", ->
beforeEach ->
spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
describe "when the current item has a saveAs method", ->
it "opens the save dialog and calls saveAs on the item with the selected path", ->
spyOn(editSession2, 'saveAs')
pane.showItem(editSession2)
pane.trigger 'core:save-as'
expect(atom.showSaveDialogSync).toHaveBeenCalledWith(path.dirname(editSession2.getPath()))
expect(editSession2.saveAs).toHaveBeenCalledWith('/selected/path')
describe "when the current item does not have a saveAs method", ->
it "does nothing", ->
expect(pane.activeItem.saveAs).toBeUndefined()
pane.trigger 'core:save-as'
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "pane:show-next-item and pane:show-previous-item", ->
it "advances forward/backward through the pane's items, looping around at either end", ->
expect(pane.activeItem).toBe view1
pane.trigger 'pane:show-previous-item'
expect(pane.activeItem).toBe editSession2
pane.trigger 'pane:show-previous-item'
expect(pane.activeItem).toBe view2
pane.trigger 'pane:show-next-item'
expect(pane.activeItem).toBe editSession2
pane.trigger 'pane:show-next-item'
expect(pane.activeItem).toBe view1
describe "pane:show-item-N events", ->
it "shows the (n-1)th item if it exists", ->
pane.trigger 'pane:show-item-2'
expect(pane.activeItem).toBe pane.itemAtIndex(1)
pane.trigger 'pane:show-item-1'
expect(pane.activeItem).toBe pane.itemAtIndex(0)
pane.trigger 'pane:show-item-9' # don't fail on out-of-bounds indices
expect(pane.activeItem).toBe pane.itemAtIndex(0)
describe "when the title of the active item changes", ->
it "emits pane:active-item-title-changed", ->
activeItemTitleChangedHandler = jasmine.createSpy("activeItemTitleChangedHandler")
pane.on 'pane:active-item-title-changed', activeItemTitleChangedHandler
expect(pane.activeItem).toBe view1
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).not.toHaveBeenCalled()
view1.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
activeItemTitleChangedHandler.reset()
pane.showItem(view2)
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
describe ".remove()", ->
it "destroys all the pane's items", ->
pane.remove()
expect(editSession1.destroyed).toBeTruthy()
expect(editSession2.destroyed).toBeTruthy()
it "triggers a 'pane:removed' event with the pane", ->
removedHandler = jasmine.createSpy("removedHandler")
container.on 'pane:removed', removedHandler
pane.remove()
expect(removedHandler).toHaveBeenCalled()
expect(removedHandler.argsForCall[0][1]).toBe pane
describe "when there are other panes", ->
[paneToLeft, paneToRight] = []
beforeEach ->
pane.showItem(editSession1)
paneToLeft = pane.splitLeft()
paneToRight = pane.splitRight()
container.attachToDom()
describe "when the removed pane is focused", ->
it "activates and focuses the next pane", ->
pane.focus()
pane.remove()
expect(paneToLeft.isActive()).toBeFalsy()
expect(paneToRight.isActive()).toBeTruthy()
expect(paneToRight).toMatchSelector ':has(:focus)'
describe "when the removed pane is active but not focused", ->
it "activates the next pane, but does not focus it", ->
$(document.activeElement).blur()
expect(pane).not.toMatchSelector ':has(:focus)'
pane.makeActive()
pane.remove()
expect(paneToLeft.isActive()).toBeFalsy()
expect(paneToRight.isActive()).toBeTruthy()
expect(paneToRight).not.toMatchSelector ':has(:focus)'
describe "when the removed pane is not active", ->
it "does not affect the active pane or the focus", ->
paneToLeft.focus()
expect(paneToLeft.isActive()).toBeTruthy()
expect(paneToRight.isActive()).toBeFalsy()
pane.remove()
expect(paneToLeft.isActive()).toBeTruthy()
expect(paneToRight.isActive()).toBeFalsy()
expect(paneToLeft).toMatchSelector ':has(:focus)'
describe "when it is the last pane", ->
beforeEach ->
expect(container.getPanes().length).toBe 1
window.rootView = focus: jasmine.createSpy("rootView.focus")
describe "when the removed pane is focused", ->
it "calls focus on rootView so we don't lose focus", ->
container.attachToDom()
pane.focus()
pane.remove()
expect(rootView.focus).toHaveBeenCalled()
describe "when the removed pane is not focused", ->
it "does not call focus on root view", ->
expect(pane).not.toMatchSelector ':has(:focus)'
pane.remove()
expect(rootView.focus).not.toHaveBeenCalled()
describe ".getNextPane()", ->
it "returns the next pane if one exists, wrapping around from the last pane to the first", ->
pane.showItem(editSession1)
expect(pane.getNextPane()).toBeUndefined
pane2 = pane.splitRight()
expect(pane.getNextPane()).toBe pane2
expect(pane2.getNextPane()).toBe pane
describe "when the pane is focused", ->
beforeEach ->
container.attachToDom()
it "focuses the active item view", ->
focusHandler = jasmine.createSpy("focusHandler")
pane.activeItem.on 'focus', focusHandler
pane.focus()
expect(focusHandler).toHaveBeenCalled()
it "triggers 'pane:became-active' if it was not previously active", ->
pane2 = pane.splitRight(view2) # Make pane inactive
becameActiveHandler = jasmine.createSpy("becameActiveHandler")
pane.on 'pane:became-active', becameActiveHandler
expect(pane.isActive()).toBeFalsy()
pane.focusin()
expect(pane.isActive()).toBeTruthy()
pane.focusin()
expect(becameActiveHandler.callCount).toBe 1
it "triggers 'pane:became-inactive' when it was previously active", ->
pane2 = pane.splitRight(view2) # Make pane inactive
becameInactiveHandler = jasmine.createSpy("becameInactiveHandler")
pane.on 'pane:became-inactive', becameInactiveHandler
expect(pane.isActive()).toBeFalsy()
pane.focusin()
expect(pane.isActive()).toBeTruthy()
pane.splitRight()
expect(pane.isActive()).toBeFalsy()
expect(becameInactiveHandler.callCount).toBe 1
describe "split methods", ->
[pane1, view3, view4] = []
[pane1, container] = []
beforeEach ->
pane1 = pane
pane.showItem(editSession1)
view3 = new TestView(id: 'view-3', text: 'View 3')
view4 = new TestView(id: 'view-4', text: 'View 4')
pane1 = new Pane(items: ["A"])
container = new PaneContainer(root: pane1)
describe "splitRight(items...)", ->
it "builds a row if needed, then appends a new pane after itself", ->
# creates the new pane with a copy of the active item if none are given
describe "::splitLeft(params)", ->
describe "when the parent is the container root", ->
it "replaces itself with a row and inserts a new pane to the left of itself", ->
pane2 = pane1.splitLeft(items: ["B"])
pane3 = pane1.splitLeft(items: ["C"])
expect(container.root.orientation).toBe 'horizontal'
expect(container.root.children).toEqual [pane2, pane3, pane1]
describe "when the parent is a column", ->
it "replaces itself with a row and inserts a new pane to the left of itself", ->
pane1.splitDown()
pane2 = pane1.splitLeft(items: ["B"])
pane3 = pane1.splitLeft(items: ["C"])
row = container.root.children[0]
expect(row.orientation).toBe 'horizontal'
expect(row.children).toEqual [pane2, pane3, pane1]
describe "::splitRight(params)", ->
describe "when the parent is the container root", ->
it "replaces itself with a row and inserts a new pane to the right of itself", ->
pane2 = pane1.splitRight(items: ["B"])
pane3 = pane1.splitRight(items: ["C"])
expect(container.root.orientation).toBe 'horizontal'
expect(container.root.children).toEqual [pane1, pane3, pane2]
describe "when the parent is a column", ->
it "replaces itself with a row and inserts a new pane to the right of itself", ->
pane1.splitDown()
pane2 = pane1.splitRight(items: ["B"])
pane3 = pane1.splitRight(items: ["C"])
row = container.root.children[0]
expect(row.orientation).toBe 'horizontal'
expect(row.children).toEqual [pane1, pane3, pane2]
describe "::splitUp(params)", ->
describe "when the parent is the container root", ->
it "replaces itself with a column and inserts a new pane above itself", ->
pane2 = pane1.splitUp(items: ["B"])
pane3 = pane1.splitUp(items: ["C"])
expect(container.root.orientation).toBe 'vertical'
expect(container.root.children).toEqual [pane2, pane3, pane1]
describe "when the parent is a row", ->
it "replaces itself with a column and inserts a new pane above itself", ->
pane1.splitRight()
pane2 = pane1.splitUp(items: ["B"])
pane3 = pane1.splitUp(items: ["C"])
column = container.root.children[0]
expect(column.orientation).toBe 'vertical'
expect(column.children).toEqual [pane2, pane3, pane1]
describe "::splitDown(params)", ->
describe "when the parent is the container root", ->
it "replaces itself with a column and inserts a new pane below itself", ->
pane2 = pane1.splitDown(items: ["B"])
pane3 = pane1.splitDown(items: ["C"])
expect(container.root.orientation).toBe 'vertical'
expect(container.root.children).toEqual [pane1, pane3, pane2]
describe "when the parent is a row", ->
it "replaces itself with a column and inserts a new pane below itself", ->
pane1.splitRight()
pane2 = pane1.splitDown(items: ["B"])
pane3 = pane1.splitDown(items: ["C"])
column = container.root.children[0]
expect(column.orientation).toBe 'vertical'
expect(column.children).toEqual [pane1, pane3, pane2]
it "sets up the new pane to be focused", ->
expect(pane1.focused).toBe false
pane2 = pane1.splitRight()
expect(pane2.focused).toBe true
describe "::destroyItem(item)", ->
describe "when the last item is destroyed", ->
it "destroys the pane", ->
pane = new Pane(items: ["A", "B"])
pane.destroyItem("A")
pane.destroyItem("B")
expect(pane.isDestroyed()).toBe true
describe "when an item emits a destroyed event", ->
it "removes it from the list of items", ->
pane = new Pane(items: [new Model, new Model, new Model])
[item1, item2, item3] = pane.items
pane.items[1].destroy()
expect(pane.items).toEqual [item1, item3]
describe "::destroy()", ->
[pane1, container] = []
beforeEach ->
pane1 = new Pane(items: [new Model, new Model])
container = new PaneContainer(root: pane1)
it "destroys the pane's destroyable items", ->
[item1, item2] = pane1.items
pane1.destroy()
expect(item1.isDestroyed()).toBe true
expect(item2.isDestroyed()).toBe true
describe "if the pane's parent has more than two children", ->
it "removes the pane from its parent", ->
pane2 = pane1.splitRight()
expect(container.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
expect(pane2.items).toEqual [editSession1]
expect(pane2.activeItem).not.toBe editSession1 # it's a copy
pane3 = pane2.splitRight()
pane3 = pane2.splitRight(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.row .pane').toArray()).toEqual [pane[0], pane2[0], pane3[0]]
expect(container.root.children).toEqual [pane1, pane2, pane3]
pane2.destroy()
expect(container.root.children).toEqual [pane1, pane3]
describe "splitRight(items...)", ->
it "builds a row if needed, then appends a new pane before itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitLeft()
expect(container.find('.row .pane').toArray()).toEqual [pane2[0], pane[0]]
expect(pane2.items).toEqual [editSession1]
expect(pane2.activeItem).not.toBe editSession1 # it's a copy
describe "if the pane's parent has two children", ->
it "replaces the parent with its last remaining child", ->
pane2 = pane1.splitRight()
pane3 = pane2.splitDown()
pane3 = pane2.splitLeft(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.row .pane').toArray()).toEqual [pane3[0], pane2[0], pane[0]]
describe "splitDown(items...)", ->
it "builds a column if needed, then appends a new pane after itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitDown()
expect(container.find('.column .pane').toArray()).toEqual [pane[0], pane2[0]]
expect(pane2.items).toEqual [editSession1]
expect(pane2.activeItem).not.toBe editSession1 # it's a copy
pane3 = pane2.splitDown(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.column .pane').toArray()).toEqual [pane[0], pane2[0], pane3[0]]
describe "splitUp(items...)", ->
it "builds a column if needed, then appends a new pane before itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitUp()
expect(container.find('.column .pane').toArray()).toEqual [pane2[0], pane[0]]
expect(pane2.items).toEqual [editSession1]
expect(pane2.activeItem).not.toBe editSession1 # it's a copy
pane3 = pane2.splitUp(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.column .pane').toArray()).toEqual [pane3[0], pane2[0], pane[0]]
it "lays out nested panes by equally dividing their containing row / column", ->
container.width(520).height(240).attachToDom()
pane1.showItem($("1"))
pane1
.splitLeft($("2"))
.splitUp($("3"))
.splitLeft($("4"))
.splitDown($("5"))
row1 = container.children(':eq(0)')
expect(row1.children().length).toBe 2
column1 = row1.children(':eq(0)').view()
pane1 = row1.children(':eq(1)').view()
expect(column1.outerWidth()).toBe Math.round(2/3 * container.width())
expect(column1.outerHeight()).toBe container.height()
expect(pane1.outerWidth()).toBe Math.round(1/3 * container.width())
expect(pane1.outerHeight()).toBe container.height()
expect(Math.round(pane1.position().left)).toBe column1.outerWidth()
expect(column1.children().length).toBe 2
row2 = column1.children(':eq(0)').view()
pane2 = column1.children(':eq(1)').view()
expect(row2.outerWidth()).toBe column1.outerWidth()
expect(row2.height()).toBe 2/3 * container.height()
expect(pane2.outerWidth()).toBe column1.outerWidth()
expect(pane2.outerHeight()).toBe 1/3 * container.height()
expect(Math.round(pane2.position().top)).toBe row2.height()
expect(row2.children().length).toBe 2
column3 = row2.children(':eq(0)').view()
pane3 = row2.children(':eq(1)').view()
expect(column3.outerWidth()).toBe Math.round(1/3 * container.width())
expect(column3.outerHeight()).toBe row2.outerHeight()
# the built in rounding seems to be rounding x.5 down, but we need to go up. this sucks.
expect(Math.round(pane3.trueWidth())).toBe Math.round(1/3 * container.width())
expect(pane3.height()).toBe row2.outerHeight()
expect(Math.round(pane3.position().left)).toBe column3.width()
expect(column3.children().length).toBe 2
pane4 = column3.children(':eq(0)').view()
pane5 = column3.children(':eq(1)').view()
expect(pane4.outerWidth()).toBe column3.width()
expect(pane4.outerHeight()).toBe 1/3 * container.height()
expect(pane5.outerWidth()).toBe column3.width()
expect(Math.round(pane5.position().top)).toBe pane4.outerHeight()
expect(pane5.outerHeight()).toBe 1/3 * container.height()
pane5.remove()
expect(column3.parent()).not.toExist()
expect(pane2.outerHeight()).toBe Math.floor(1/2 * container.height())
expect(pane3.outerHeight()).toBe Math.floor(1/2 * container.height())
expect(pane4.outerHeight()).toBe Math.floor(1/2 * container.height())
pane4.remove()
expect(row2.parent()).not.toExist()
expect(pane1.outerWidth()).toBe Math.floor(1/2 * container.width())
expect(pane2.outerWidth()).toBe Math.floor(1/2 * container.width())
expect(pane3.outerWidth()).toBe Math.floor(1/2 * container.width())
pane3.remove()
expect(column1.parent()).not.toExist()
expect(pane2.outerHeight()).toBe container.height()
pane2.remove()
expect(row1.parent()).not.toExist()
expect(container.children().length).toBe 1
expect(container.children('.pane').length).toBe 1
expect(pane1.outerWidth()).toBe container.width()
describe ".itemForUri(uri)", ->
it "returns the item for which a call to .getUri() returns the given uri", ->
expect(pane.itemForUri(editSession1.getUri())).toBe editSession1
expect(pane.itemForUri(editSession2.getUri())).toBe editSession2
describe "serialization", ->
it "can serialize and deserialize the pane and all its items", ->
newPane = deserialize(pane.serialize())
expect(newPane.getItems()).toEqual [view1, editSession1, view2, editSession2]
it "restores the active item on deserialization", ->
pane.showItem(editSession2)
newPane = deserialize(pane.serialize())
expect(newPane.activeItem).toEqual editSession2
it "does not show items that cannot be deserialized", ->
spyOn(console, 'warn')
pane.showItem(view2)
paneState = pane.serialize()
paneState.get('items').set(pane.items.indexOf(view2), {deserializer: 'Bogus'}) # nuke serialized state of active item
newPane = deserialize(paneState)
expect(newPane.activeItem).toEqual pane.items[0]
expect(newPane.items.length).toBe pane.items.length - 1
it "focuses the pane after attach only if had focus when serialized", ->
reloadContainer = ->
projectState = project.serialize()
containerState = container.serialize()
container.remove()
project.destroy()
window.project = deserialize(projectState)
container = deserialize(containerState)
pane = container.getRoot()
container.attachToDom()
container.attachToDom()
pane.focus()
reloadContainer()
expect(pane).toMatchSelector(':has(:focus)')
$(document.activeElement).blur()
reloadContainer()
expect(pane).not.toMatchSelector(':has(:focus)')
expect(container.root.children[0]).toBe pane1
expect(container.root.children[1].children).toEqual [pane2, pane3]
pane3.destroy()
expect(container.root.children).toEqual [pane1, pane2]
pane2.destroy()
expect(container.root).toBe pane1
+638
Ver Arquivo
@@ -0,0 +1,638 @@
PaneContainerView = require '../src/pane-container-view'
PaneView = require '../src/pane-view'
{fs, $, View} = require 'atom'
path = require 'path'
temp = require 'temp'
describe "PaneView", ->
[container, view1, view2, editor1, editor2, pane] = []
class TestView extends View
@deserialize: ({id, text}) -> new TestView({id, text})
@content: ({id, text}) -> @div class: 'test-view', id: id, tabindex: -1, text
initialize: ({@id, @text}) ->
serialize: -> { deserializer: 'TestView', @id, @text }
getUri: -> @id
isEqual: (other) -> other? and @id == other.id and @text == other.text
beforeEach ->
atom.deserializers.add(TestView)
container = new PaneContainerView
view1 = new TestView(id: 'view-1', text: 'View 1')
view2 = new TestView(id: 'view-2', text: 'View 2')
editor1 = atom.project.openSync('sample.js')
editor2 = atom.project.openSync('sample.txt')
pane = new PaneView(view1, editor1, view2, editor2)
container.setRoot(pane)
afterEach ->
atom.deserializers.remove(TestView)
describe "::initialize(items...)", ->
it "displays the first item in the pane", ->
expect(pane.itemViews.find('#view-1')).toExist()
describe "::activateItem(item)", ->
it "hides all item views except the one being shown and sets the activeItem", ->
expect(pane.activeItem).toBe view1
pane.activateItem(view2)
expect(view1.css('display')).toBe 'none'
expect(view2.css('display')).not.toBe 'none'
expect(pane.activeItem).toBe view2
it "triggers 'pane:active-item-changed' if the item isn't already the activeItem", ->
pane.activate()
itemChangedHandler = jasmine.createSpy("itemChangedHandler")
container.on 'pane:active-item-changed', itemChangedHandler
expect(pane.activeItem).toBe view1
pane.activateItem(view2)
pane.activateItem(view2)
expect(itemChangedHandler.callCount).toBe 1
expect(itemChangedHandler.argsForCall[0][1]).toBe view2
itemChangedHandler.reset()
pane.activateItem(editor1)
expect(itemChangedHandler).toHaveBeenCalled()
expect(itemChangedHandler.argsForCall[0][1]).toBe editor1
itemChangedHandler.reset()
describe "if the pane's active view is focused before calling activateItem", ->
it "focuses the new active view", ->
container.attachToDom()
pane.focus()
expect(pane.activeView).not.toBe view2
expect(pane.activeView).toMatchSelector ':focus'
pane.activateItem(view2)
expect(view2).toMatchSelector ':focus'
describe "when the given item isn't yet in the items list on the pane", ->
view3 = null
beforeEach ->
view3 = new TestView(id: 'view-3', text: "View 3")
pane.activateItem(editor1)
expect(pane.getActiveItemIndex()).toBe 1
it "adds it to the items list after the active item", ->
pane.activateItem(view3)
expect(pane.getItems()).toEqual [view1, editor1, view3, view2, editor2]
expect(pane.activeItem).toBe view3
expect(pane.getActiveItemIndex()).toBe 2
it "triggers the 'item-added' event with the item and its index before the 'active-item-changed' event", ->
events = []
container.on 'pane:item-added', (e, item, index) -> events.push(['pane:item-added', item, index])
container.on 'pane:active-item-changed', (e, item) -> events.push(['pane:active-item-changed', item])
pane.activateItem(view3)
expect(events).toEqual [['pane:item-added', view3, 2], ['pane:active-item-changed', view3]]
describe "when showing a model item", ->
describe "when no view has yet been appended for that item", ->
it "appends and shows a view to display the item based on its `.getViewClass` method", ->
pane.activateItem(editor1)
editorView = pane.activeView
expect(editorView.css('display')).not.toBe 'none'
expect(editorView.editor).toBe editor1
describe "when a valid view has already been appended for another item", ->
it "multiple views are created for multiple items", ->
pane.activateItem(editor1)
pane.activateItem(editor2)
expect(pane.itemViews.find('.editor').length).toBe 2
editorView = pane.activeView
expect(editorView.css('display')).not.toBe 'none'
expect(editorView.editor).toBe editor2
it "creates a new view with the item", ->
initialViewCount = pane.itemViews.find('.test-view').length
model1 =
id: 'test-model-1'
text: 'Test Model 1'
serialize: -> {@id, @text}
getViewClass: -> TestView
model2 =
id: 'test-model-2'
text: 'Test Model 2'
serialize: -> {@id, @text}
getViewClass: -> TestView
pane.activateItem(model1)
pane.activateItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
pane.activatePreviousItem()
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
pane.destroyItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 1
pane.destroyItem(model1)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount
describe "when showing a view item", ->
it "appends it to the itemViews div if it hasn't already been appended and shows it", ->
expect(pane.itemViews.find('#view-2')).not.toExist()
pane.activateItem(view2)
expect(pane.itemViews.find('#view-2')).toExist()
expect(pane.activeView).toBe view2
describe "::destroyItem(item)", ->
describe "if the item is not modified", ->
it "removes the item and tries to call destroy on it", ->
pane.destroyItem(editor2)
expect(pane.getItems().indexOf(editor2)).toBe -1
expect(editor2.isDestroyed()).toBe true
describe "if the item is modified", ->
beforeEach ->
jasmine.unspy(editor2, 'shouldPromptToSave')
spyOn(editor2, 'save')
spyOn(editor2, 'saveAs')
editor2.insertText('a')
expect(editor2.isModified()).toBeTruthy()
describe "if the [Save] option is selected", ->
describe "when the item has a uri", ->
it "saves the item before removing and destroying it", ->
spyOn(atom, 'confirm').andReturn(0)
pane.destroyItem(editor2)
expect(editor2.save).toHaveBeenCalled()
expect(pane.getItems().indexOf(editor2)).toBe -1
expect(editor2.isDestroyed()).toBe true
describe "when the item has no uri", ->
it "presents a save-as dialog, then saves the item with the given uri before removing and destroying it", ->
editor2.buffer.setPath(undefined)
spyOn(atom, 'showSaveDialogSync').andReturn("/selected/path")
spyOn(atom, 'confirm').andReturn(0)
pane.destroyItem(editor2)
expect(atom.showSaveDialogSync).toHaveBeenCalled()
expect(editor2.saveAs).toHaveBeenCalledWith("/selected/path")
expect(pane.getItems().indexOf(editor2)).toBe -1
expect(editor2.isDestroyed()).toBe true
describe "if the [Don't Save] option is selected", ->
it "removes and destroys the item without saving it", ->
spyOn(atom, 'confirm').andReturn(2)
pane.destroyItem(editor2)
expect(editor2.save).not.toHaveBeenCalled()
expect(pane.getItems().indexOf(editor2)).toBe -1
expect(editor2.isDestroyed()).toBe true
describe "if the [Cancel] option is selected", ->
it "does not save, remove, or destroy the item", ->
spyOn(atom, 'confirm').andReturn(1)
pane.destroyItem(editor2)
expect(editor2.save).not.toHaveBeenCalled()
expect(pane.getItems().indexOf(editor2)).not.toBe -1
expect(editor2.isDestroyed()).toBe false
it "removes the item's associated view", ->
view1.remove = (selector, keepData) -> @wasRemoved = not keepData
pane.destroyItem(view1)
expect(view1.wasRemoved).toBe true
it "removes the item from the items list and shows the next item if it was showing", ->
pane.destroyItem(view1)
expect(pane.getItems()).toEqual [editor1, view2, editor2]
expect(pane.activeItem).toBe editor1
pane.activateItem(editor2)
pane.destroyItem(editor2)
expect(pane.getItems()).toEqual [editor1, view2]
expect(pane.activeItem).toBe editor1
it "triggers 'pane:item-removed' with the item and its former index", ->
itemRemovedHandler = jasmine.createSpy("itemRemovedHandler")
pane.on 'pane:item-removed', itemRemovedHandler
pane.destroyItem(editor1)
expect(itemRemovedHandler).toHaveBeenCalled()
expect(itemRemovedHandler.argsForCall[0][1..2]).toEqual [editor1, 1]
describe "when removing the last item", ->
it "removes the pane", ->
pane.destroyItem(item) for item in pane.getItems()
expect(pane.hasParent()).toBeFalsy()
describe "when the pane is focused", ->
it "shifts focus to the next pane", ->
expect(container.getRoot()).toBe pane
container.attachToDom()
pane2 = pane.splitRight(new TestView(id: 'view-3', text: 'View 3'))
pane.focus()
expect(pane).toMatchSelector(':has(:focus)')
pane.destroyItem(item) for item in pane.getItems()
expect(pane2).toMatchSelector ':has(:focus)'
describe "when the item is a view", ->
it "removes the item from the 'item-views' div", ->
expect(view1.parent()).toMatchSelector pane.itemViews
pane.destroyItem(view1)
expect(view1.parent()).not.toMatchSelector pane.itemViews
describe "when the item is a model", ->
it "removes the associated view only when all items that require it have been removed", ->
pane.activateItem(editor1)
pane.activateItem(editor2)
pane.destroyItem(editor2)
expect(pane.itemViews.find('.editor')).toExist()
pane.destroyItem(editor1)
expect(pane.itemViews.find('.editor')).not.toExist()
describe "::moveItem(item, index)", ->
it "moves the item to the given index and emits a 'pane:item-moved' event with the item and the new index", ->
itemMovedHandler = jasmine.createSpy("itemMovedHandler")
pane.on 'pane:item-moved', itemMovedHandler
pane.moveItem(view1, 2)
expect(pane.getItems()).toEqual [editor1, view2, view1, editor2]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [view1, 2]
itemMovedHandler.reset()
pane.moveItem(editor1, 3)
expect(pane.getItems()).toEqual [view2, view1, editor2, editor1]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [editor1, 3]
itemMovedHandler.reset()
pane.moveItem(editor1, 1)
expect(pane.getItems()).toEqual [view2, editor1, view1, editor2]
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [editor1, 1]
itemMovedHandler.reset()
describe "::moveItemToPane(item, pane, index)", ->
[pane2, view3] = []
beforeEach ->
view3 = new TestView(id: 'view-3', text: "View 3")
pane2 = pane.splitRight(view3)
it "moves the item to the given pane at the given index", ->
pane.moveItemToPane(view1, pane2, 1)
expect(pane.getItems()).toEqual [editor1, view2, editor2]
expect(pane2.getItems()).toEqual [view3, view1]
describe "when it is the last item on the source pane", ->
it "removes the source pane, but does not destroy the item", ->
pane.destroyItem(view1)
pane.destroyItem(view2)
pane.destroyItem(editor2)
expect(pane.getItems()).toEqual [editor1]
pane.moveItemToPane(editor1, pane2, 1)
expect(pane.hasParent()).toBeFalsy()
expect(pane2.getItems()).toEqual [view3, editor1]
expect(editor1.isDestroyed()).toBe false
describe "when the item is a jQuery object", ->
it "preserves data by detaching instead of removing", ->
view1.data('preservative', 1234)
pane.moveItemToPane(view1, pane2, 1)
pane2.activateItemAtIndex(1)
expect(pane2.activeView.data('preservative')).toBe 1234
describe "pane:close", ->
it "destroys all items and removes the pane", ->
pane.activateItem(editor1)
pane.trigger 'pane:close'
expect(pane.hasParent()).toBeFalsy()
expect(editor2.isDestroyed()).toBe true
expect(editor1.isDestroyed()).toBe true
describe "pane:close-other-items", ->
it "destroys all items except the current", ->
pane.activateItem(editor1)
pane.trigger 'pane:close-other-items'
expect(editor2.isDestroyed()).toBe true
expect(pane.getItems()).toEqual [editor1]
describe "::saveActiveItem()", ->
describe "when the current item has a uri", ->
describe "when the current item has a save method", ->
it "saves the current item", ->
spyOn(editor2, 'save')
pane.activateItem(editor2)
pane.saveActiveItem()
expect(editor2.save).toHaveBeenCalled()
describe "when the current item has no save method", ->
it "does nothing", ->
pane.activeItem.getUri = -> 'you are eye'
expect(pane.activeItem.save).toBeUndefined()
pane.saveActiveItem()
describe "when the current item has no uri", ->
beforeEach ->
spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
describe "when the current item has a saveAs method", ->
it "opens a save dialog and saves the current item as the selected path", ->
newEditor = atom.project.openSync()
spyOn(newEditor, 'saveAs')
pane.activateItem(newEditor)
pane.saveActiveItem()
expect(atom.showSaveDialogSync).toHaveBeenCalled()
expect(newEditor.saveAs).toHaveBeenCalledWith('/selected/path')
describe "when the current item has no saveAs method", ->
it "does nothing", ->
expect(pane.activeItem.saveAs).toBeUndefined()
pane.saveActiveItem()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "::saveActiveItemAs()", ->
beforeEach ->
spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
describe "when the current item has a saveAs method", ->
it "opens the save dialog and calls saveAs on the item with the selected path", ->
spyOn(editor2, 'saveAs')
pane.activateItem(editor2)
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).toHaveBeenCalledWith(path.dirname(editor2.getPath()))
expect(editor2.saveAs).toHaveBeenCalledWith('/selected/path')
describe "when the current item does not have a saveAs method", ->
it "does nothing", ->
expect(pane.activeItem.saveAs).toBeUndefined()
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "pane:show-next-item and pane:show-previous-item", ->
it "advances forward/backward through the pane's items, looping around at either end", ->
expect(pane.activeItem).toBe view1
pane.trigger 'pane:show-previous-item'
expect(pane.activeItem).toBe editor2
pane.trigger 'pane:show-previous-item'
expect(pane.activeItem).toBe view2
pane.trigger 'pane:show-next-item'
expect(pane.activeItem).toBe editor2
pane.trigger 'pane:show-next-item'
expect(pane.activeItem).toBe view1
describe "pane:show-item-N events", ->
it "shows the (n-1)th item if it exists", ->
pane.trigger 'pane:show-item-2'
expect(pane.activeItem).toBe pane.itemAtIndex(1)
pane.trigger 'pane:show-item-1'
expect(pane.activeItem).toBe pane.itemAtIndex(0)
pane.trigger 'pane:show-item-9' # don't fail on out-of-bounds indices
expect(pane.activeItem).toBe pane.itemAtIndex(0)
describe "when the title of the active item changes", ->
it "emits pane:active-item-title-changed", ->
activeItemTitleChangedHandler = jasmine.createSpy("activeItemTitleChangedHandler")
pane.on 'pane:active-item-title-changed', activeItemTitleChangedHandler
expect(pane.activeItem).toBe view1
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).not.toHaveBeenCalled()
view1.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
activeItemTitleChangedHandler.reset()
pane.activateItem(view2)
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
describe "when an unmodifed buffer's path is deleted", ->
it "removes the pane item", ->
filePath = temp.openSync('atom').path
editor = atom.project.openSync(filePath)
pane.activateItem(editor)
expect(pane.items).toHaveLength(5)
fs.removeSync(filePath)
waitsFor ->
pane.items.length == 4
describe "::remove()", ->
it "destroys all the pane's items", ->
pane.remove()
expect(editor1.isDestroyed()).toBe true
expect(editor2.isDestroyed()).toBe true
it "triggers a 'pane:removed' event with the pane", ->
removedHandler = jasmine.createSpy("removedHandler")
container.on 'pane:removed', removedHandler
pane.remove()
expect(removedHandler).toHaveBeenCalled()
expect(removedHandler.argsForCall[0][1]).toBe pane
describe "when there are other panes", ->
[paneToLeft, paneToRight] = []
beforeEach ->
pane.activateItem(editor1)
paneToLeft = pane.splitLeft(pane.copyActiveItem())
paneToRight = pane.splitRight(pane.copyActiveItem())
container.attachToDom()
describe "when the removed pane is active", ->
it "makes the next the next pane active and focuses it", ->
pane.activate()
pane.remove()
expect(paneToLeft.isActive()).toBeFalsy()
expect(paneToRight.isActive()).toBeTruthy()
expect(paneToRight).toMatchSelector ':has(:focus)'
describe "when the removed pane is not active", ->
it "does not affect the active pane or the focus", ->
paneToLeft.focus()
expect(paneToLeft.isActive()).toBeTruthy()
expect(paneToRight.isActive()).toBeFalsy()
pane.remove()
expect(paneToLeft.isActive()).toBeTruthy()
expect(paneToRight.isActive()).toBeFalsy()
expect(paneToLeft).toMatchSelector ':has(:focus)'
describe "when it is the last pane", ->
beforeEach ->
expect(container.getPanes().length).toBe 1
atom.workspaceView = focus: jasmine.createSpy("workspaceView.focus")
describe "when the removed pane is focused", ->
it "calls focus on workspaceView so we don't lose focus", ->
container.attachToDom()
pane.focus()
pane.remove()
expect(atom.workspaceView.focus).toHaveBeenCalled()
describe "when the removed pane is not focused", ->
it "does not call focus on root view", ->
expect(pane).not.toMatchSelector ':has(:focus)'
pane.remove()
expect(atom.workspaceView.focus).not.toHaveBeenCalled()
describe "::getNextPane()", ->
it "returns the next pane if one exists, wrapping around from the last pane to the first", ->
pane.activateItem(editor1)
expect(pane.getNextPane()).toBeUndefined
pane2 = pane.splitRight(pane.copyActiveItem())
expect(pane.getNextPane()).toBe pane2
expect(pane2.getNextPane()).toBe pane
describe "when the pane is focused", ->
beforeEach ->
container.attachToDom()
it "focuses the active item view", ->
focusHandler = jasmine.createSpy("focusHandler")
pane.activeItem.on 'focus', focusHandler
pane.focus()
expect(focusHandler).toHaveBeenCalled()
it "triggers 'pane:became-active' if it was not previously active", ->
pane2 = pane.splitRight(view2) # Make pane inactive
becameActiveHandler = jasmine.createSpy("becameActiveHandler")
pane.on 'pane:became-active', becameActiveHandler
expect(pane.isActive()).toBeFalsy()
pane.focusin()
expect(pane.isActive()).toBeTruthy()
pane.focusin()
expect(becameActiveHandler.callCount).toBe 1
it "triggers 'pane:became-inactive' when it was previously active", ->
pane2 = pane.splitRight(view2) # Make pane inactive
becameInactiveHandler = jasmine.createSpy("becameInactiveHandler")
pane.on 'pane:became-inactive', becameInactiveHandler
expect(pane.isActive()).toBeFalsy()
pane.focusin()
expect(pane.isActive()).toBeTruthy()
pane.splitRight(pane.copyActiveItem())
expect(pane.isActive()).toBeFalsy()
expect(becameInactiveHandler.callCount).toBe 1
describe "split methods", ->
[pane1, view3, view4] = []
beforeEach ->
pane1 = pane
pane.activateItem(editor1)
view3 = new TestView(id: 'view-3', text: 'View 3')
view4 = new TestView(id: 'view-4', text: 'View 4')
describe "splitRight(items...)", ->
it "builds a row if needed, then appends a new pane after itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane1.splitRight(pane1.copyActiveItem())
expect(container.find('.pane-row .pane').toArray()).toEqual [pane1[0], pane2[0]]
expect(pane2.items).toEqual [editor1]
expect(pane2.activeItem).not.toBe editor1 # it's a copy
pane3 = pane2.splitRight(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.pane-row .pane').toArray()).toEqual [pane[0], pane2[0], pane3[0]]
it "builds a row if needed, then appends a new pane after itself ", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane1.splitRight()
expect(container.find('.pane-row .pane').toArray()).toEqual [pane1[0], pane2[0]]
expect(pane2.items).toEqual []
expect(pane2.activeItem).toBeUndefined()
pane3 = pane2.splitRight()
expect(container.find('.pane-row .pane').toArray()).toEqual [pane1[0], pane2[0], pane3[0]]
expect(pane3.items).toEqual []
expect(pane3.activeItem).toBeUndefined()
describe "splitLeft(items...)", ->
it "builds a row if needed, then appends a new pane before itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitLeft(pane1.copyActiveItem())
expect(container.find('.pane-row .pane').toArray()).toEqual [pane2[0], pane[0]]
expect(pane2.items).toEqual [editor1]
expect(pane2.activeItem).not.toBe editor1 # it's a copy
pane3 = pane2.splitLeft(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.pane-row .pane').toArray()).toEqual [pane3[0], pane2[0], pane[0]]
describe "splitDown(items...)", ->
it "builds a column if needed, then appends a new pane after itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitDown(pane1.copyActiveItem())
expect(container.find('.pane-column .pane').toArray()).toEqual [pane[0], pane2[0]]
expect(pane2.items).toEqual [editor1]
expect(pane2.activeItem).not.toBe editor1 # it's a copy
pane3 = pane2.splitDown(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.pane-column .pane').toArray()).toEqual [pane[0], pane2[0], pane3[0]]
describe "splitUp(items...)", ->
it "builds a column if needed, then appends a new pane before itself", ->
# creates the new pane with a copy of the active item if none are given
pane2 = pane.splitUp(pane1.copyActiveItem())
expect(container.find('.pane-column .pane').toArray()).toEqual [pane2[0], pane[0]]
expect(pane2.items).toEqual [editor1]
expect(pane2.activeItem).not.toBe editor1 # it's a copy
pane3 = pane2.splitUp(view3, view4)
expect(pane3.getItems()).toEqual [view3, view4]
expect(container.find('.pane-column .pane').toArray()).toEqual [pane3[0], pane2[0], pane[0]]
describe "::itemForUri(uri)", ->
it "returns the item for which a call to .getUri() returns the given uri", ->
expect(pane.itemForUri(editor1.getUri())).toBe editor1
expect(pane.itemForUri(editor2.getUri())).toBe editor2
describe "serialization", ->
it "can serialize and deserialize the pane and all its items", ->
newPane = pane.testSerialization()
expect(newPane.getItems()).toEqual [view1, editor1, view2, editor2]
it "restores the active item on deserialization", ->
pane.activateItem(editor2)
newPane = pane.testSerialization()
expect(newPane.activeItem).toEqual editor2
it "does not show items that cannot be deserialized", ->
spyOn(console, 'warn')
class Unserializable
getViewClass: -> TestView
pane.activateItem(new Unserializable)
newPane = pane.testSerialization()
expect(newPane.activeItem).toEqual pane.items[0]
expect(newPane.items.length).toBe pane.items.length - 1
it "focuses the pane after attach only if had focus when serialized", ->
container.attachToDom()
pane.focus()
container2 = container.testSerialization()
pane2 = container2.getRoot()
container2.attachToDom()
expect(pane2).toMatchSelector(':has(:focus)')
$(document.activeElement).blur()
container3 = container.testSerialization()
pane3 = container3.getRoot()
container3.attachToDom()
expect(pane3).not.toMatchSelector(':has(:focus)')
+5 -5
Ver Arquivo
@@ -1,10 +1,10 @@
describe "Pasteboard", ->
describe "write(text, metadata) and read()", ->
it "writes and reads text to/from the native pasteboard", ->
expect(pasteboard.read()).toEqual ['initial pasteboard content']
pasteboard.write('next')
expect(pasteboard.read()[0]).toBe 'next'
expect(atom.pasteboard.read()).toEqual ['initial pasteboard content']
atom.pasteboard.write('next')
expect(atom.pasteboard.read()[0]).toBe 'next'
it "returns metadata if the item on the native pasteboard matches the last written item", ->
pasteboard.write('next', {meta: 'data'})
expect(pasteboard.read()).toEqual ['next', {meta: 'data'}]
atom.pasteboard.write('next', {meta: 'data'})
expect(atom.pasteboard.read()).toEqual ['next', {meta: 'data'}]
-51
Ver Arquivo
@@ -1,51 +0,0 @@
path = require 'path'
{Site} = require 'telepath'
Project = require '../src/project'
Git = require '../src/git'
describe "Project replication", ->
[doc1, doc2, project1, project2] = []
beforeEach ->
# pretend that home-1/project and home-2/project map to the same git repository url
spyOn(Git, 'open').andReturn
getOriginUrl: -> 'git://server/project.git'
destroy: ->
projectHome1 = path.join(__dirname, 'fixtures', 'replication', 'home-1')
projectHome2 = path.join(__dirname, 'fixtures', 'replication', 'home-2')
config.set('core.projectHome', projectHome1)
project1 = new Project(path.join(projectHome1, 'project'))
project1.bufferForPathSync('file-1.txt')
project1.bufferForPathSync('file-1.txt')
expect(project1.getBuffers().length).toBe 1
doc1 = project1.getState()
doc2 = doc1.clone(new Site(2))
connection = doc1.connect(doc2)
# pretend we're bootstrapping a joining window
config.set('core.projectHome', projectHome2)
project2 = deserialize(doc2)
afterEach ->
project1.destroy()
project2.destroy()
it "replicates the initial path and open buffers of the project", ->
expect(project2.getPath()).not.toBe project1.getPath()
expect(project2.getBuffers().length).toBe 1
expect(project2.getBuffers()[0].getRelativePath()).toBe project1.getBuffers()[0].getRelativePath()
expect(project2.getBuffers()[0].getPath()).not.toBe project1.getBuffers()[0].getPath()
it "replicates insertion and removal of open buffers", ->
project2.bufferForPathSync('file-2.txt')
expect(project1.getBuffers().length).toBe 2
expect(project2.getBuffers()[0].getRelativePath()).toBe project1.getBuffers()[0].getRelativePath()
expect(project2.getBuffers()[1].getRelativePath()).toBe project1.getBuffers()[1].getRelativePath()
expect(project2.getBuffers()[0].getRelativePath()).not.toBe project1.getBuffers()[0].getPath()
expect(project2.getBuffers()[1].getRelativePath()).not.toBe project1.getBuffers()[1].getPath()
project1.removeBuffer(project1.bufferForPathSync('file-2.txt'))
expect(project1.getBuffers().length).toBe 1
expect(project2.getBuffers()[0].getRelativePath()).toBe project1.getBuffers()[0].getRelativePath()
+257 -144
Ver Arquivo
@@ -8,7 +8,7 @@ BufferedProcess = require '../src/buffered-process'
describe "Project", ->
beforeEach ->
project.setPath(project.resolve('dir'))
atom.project.setPath(atom.project.resolve('dir'))
describe "serialization", ->
deserializedProject = null
@@ -16,188 +16,197 @@ describe "Project", ->
afterEach ->
deserializedProject?.destroy()
it "destroys unretained buffers and does not include them in the serialized state", ->
project.bufferForPathSync('a')
expect(project.getBuffers().length).toBe 1
deserializedProject = deserialize(project.serialize())
it "does not include unretained buffers in the serialized state", ->
atom.project.bufferForPathSync('a')
expect(atom.project.getBuffers().length).toBe 1
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
it "listens for destroyed events on deserialized buffers and removes them when they are destroyed", ->
atom.project.openSync('a')
expect(atom.project.getBuffers().length).toBe 1
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 1
deserializedProject.getBuffers()[0].destroy()
expect(deserializedProject.getBuffers().length).toBe 0
expect(project.getBuffers().length).toBe 0
describe "when an edit session is destroyed", ->
it "removes edit session and calls destroy on buffer (if buffer is not referenced by other edit sessions)", ->
editSession = project.openSync("a")
anotherEditSession = project.openSync("a")
editor = atom.project.openSync("a")
anotherEditor = atom.project.openSync("a")
expect(project.editSessions.length).toBe 2
expect(editSession.buffer).toBe anotherEditSession.buffer
expect(atom.project.editors.length).toBe 2
expect(editor.buffer).toBe anotherEditor.buffer
editSession.destroy()
expect(project.editSessions.length).toBe 1
editor.destroy()
expect(atom.project.editors.length).toBe 1
anotherEditSession.destroy()
expect(project.editSessions.length).toBe 0
anotherEditor.destroy()
expect(atom.project.editors.length).toBe 0
describe "when an edit session is saved and the project has no path", ->
it "sets the project's path to the saved file's parent directory", ->
tempFile = temp.openSync().path
project.setPath(undefined)
expect(project.getPath()).toBeUndefined()
editSession = project.openSync()
editSession.saveAs(tempFile)
expect(project.getPath()).toBe path.dirname(tempFile)
atom.project.setPath(undefined)
expect(atom.project.getPath()).toBeUndefined()
editor = atom.project.openSync()
editor.saveAs(tempFile)
expect(atom.project.getPath()).toBe path.dirname(tempFile)
describe "when an edit session is deserialized", ->
it "emits an 'edit-session-created' event and stores the edit session", ->
handler = jasmine.createSpy('editSessionCreatedHandler')
project.on 'edit-session-created', handler
describe "when an edit session is copied", ->
it "emits an 'editor-created' event and stores the edit session", ->
handler = jasmine.createSpy('editorCreatedHandler')
atom.project.on 'editor-created', handler
editSession1 = project.openSync("a")
editor1 = atom.project.openSync("a")
expect(handler.callCount).toBe 1
expect(project.getEditSessions().length).toBe 1
expect(project.getEditSessions()[0]).toBe editSession1
expect(atom.project.getEditors().length).toBe 1
expect(atom.project.getEditors()[0]).toBe editor1
editSession2 = deserialize(editSession1.serialize())
editor2 = editor1.copy()
expect(handler.callCount).toBe 2
expect(project.getEditSessions().length).toBe 2
expect(project.getEditSessions()[0]).toBe editSession1
expect(project.getEditSessions()[1]).toBe editSession2
expect(atom.project.getEditors().length).toBe 2
expect(atom.project.getEditors()[0]).toBe editor1
expect(atom.project.getEditors()[1]).toBe editor2
describe ".openSync(path)", ->
[fooOpener, barOpener, absolutePath, newBufferHandler, newEditSessionHandler] = []
[fooOpener, barOpener, absolutePath, newBufferHandler, newEditorHandler] = []
beforeEach ->
absolutePath = require.resolve('./fixtures/dir/a')
newBufferHandler = jasmine.createSpy('newBufferHandler')
project.on 'buffer-created', newBufferHandler
newEditSessionHandler = jasmine.createSpy('newEditSessionHandler')
project.on 'edit-session-created', newEditSessionHandler
atom.project.on 'buffer-created', newBufferHandler
newEditorHandler = jasmine.createSpy('newEditorHandler')
atom.project.on 'editor-created', newEditorHandler
fooOpener = (pathToOpen, options) -> { foo: pathToOpen, options } if pathToOpen?.match(/\.foo/)
barOpener = (pathToOpen) -> { bar: pathToOpen } if pathToOpen?.match(/^bar:\/\//)
project.registerOpener(fooOpener)
project.registerOpener(barOpener)
atom.project.registerOpener(fooOpener)
atom.project.registerOpener(barOpener)
afterEach ->
project.unregisterOpener(fooOpener)
project.unregisterOpener(barOpener)
atom.project.unregisterOpener(fooOpener)
atom.project.unregisterOpener(barOpener)
describe "when passed a path that doesn't match a custom opener", ->
describe "when given an absolute path that hasn't been opened previously", ->
it "returns a new edit session for the given path and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = project.openSync(absolutePath)
expect(editSession.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editSession.buffer
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
it "returns a new edit session for the given path and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync(absolutePath)
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when given a relative path that hasn't been opened previously", ->
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = project.openSync('a')
expect(editSession.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editSession.buffer
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync('a')
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed the path to a buffer that has already been opened", ->
it "returns a new edit session containing previously opened buffer and emits a 'edit-session-created' event", ->
editSession = project.openSync(absolutePath)
it "returns a new edit session containing previously opened buffer and emits a 'editor-created' event", ->
editor = atom.project.openSync(absolutePath)
newBufferHandler.reset()
expect(project.openSync(absolutePath).buffer).toBe editSession.buffer
expect(project.openSync('a').buffer).toBe editSession.buffer
expect(atom.project.openSync(absolutePath).buffer).toBe editor.buffer
expect(atom.project.openSync('a').buffer).toBe editor.buffer
expect(newBufferHandler).not.toHaveBeenCalled()
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when not passed a path", ->
it "returns a new edit session and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = project.openSync()
expect(editSession.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editSession.buffer)
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
it "returns a new edit session and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync()
expect(editor.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed a path that matches a custom opener", ->
it "returns the resource returned by the custom opener", ->
pathToOpen = project.resolve('a.foo')
expect(project.openSync(pathToOpen, hey: "there")).toEqual { foo: pathToOpen, options: {hey: "there"} }
expect(project.openSync("bar://baz")).toEqual { bar: "bar://baz" }
pathToOpen = atom.project.resolve('a.foo')
expect(atom.project.openSync(pathToOpen, hey: "there")).toEqual { foo: pathToOpen, options: {hey: "there"} }
expect(atom.project.openSync("bar://baz")).toEqual { bar: "bar://baz" }
describe ".open(path)", ->
[fooOpener, barOpener, absolutePath, newBufferHandler, newEditSessionHandler] = []
[fooOpener, barOpener, absolutePath, newBufferHandler, newEditorHandler] = []
beforeEach ->
absolutePath = require.resolve('./fixtures/dir/a')
newBufferHandler = jasmine.createSpy('newBufferHandler')
project.on 'buffer-created', newBufferHandler
newEditSessionHandler = jasmine.createSpy('newEditSessionHandler')
project.on 'edit-session-created', newEditSessionHandler
atom.project.on 'buffer-created', newBufferHandler
newEditorHandler = jasmine.createSpy('newEditorHandler')
atom.project.on 'editor-created', newEditorHandler
fooOpener = (pathToOpen, options) -> { foo: pathToOpen, options } if pathToOpen?.match(/\.foo/)
barOpener = (pathToOpen) -> { bar: pathToOpen } if pathToOpen?.match(/^bar:\/\//)
project.registerOpener(fooOpener)
project.registerOpener(barOpener)
atom.project.registerOpener(fooOpener)
atom.project.registerOpener(barOpener)
afterEach ->
project.unregisterOpener(fooOpener)
project.unregisterOpener(barOpener)
atom.project.unregisterOpener(fooOpener)
atom.project.unregisterOpener(barOpener)
describe "when passed a path that doesn't match a custom opener", ->
describe "when given an absolute path that isn't currently open", ->
it "returns a new edit session for the given path and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = null
it "returns a new edit session for the given path and emits 'buffer-created' and 'editor-created' events", ->
editor = null
waitsForPromise ->
project.open(absolutePath).then (o) -> editSession = o
atom.project.open(absolutePath).then (o) -> editor = o
runs ->
expect(editSession.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editSession.buffer
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when given a relative path that isn't currently opened", ->
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = null
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'editor-created' events", ->
editor = null
waitsForPromise ->
project.open(absolutePath).then (o) -> editSession = o
atom.project.open(absolutePath).then (o) -> editor = o
runs ->
expect(editSession.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editSession.buffer
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed the path to a buffer that is currently opened", ->
it "returns a new edit session containing currently opened buffer and emits a 'edit-session-created' event", ->
editSession = null
it "returns a new edit session containing currently opened buffer and emits a 'editor-created' event", ->
editor = null
waitsForPromise ->
project.open(absolutePath).then (o) -> editSession = o
atom.project.open(absolutePath).then (o) -> editor = o
runs ->
newBufferHandler.reset()
expect(project.openSync(absolutePath).buffer).toBe editSession.buffer
expect(project.openSync('a').buffer).toBe editSession.buffer
expect(atom.project.openSync(absolutePath).buffer).toBe editor.buffer
expect(atom.project.openSync('a').buffer).toBe editor.buffer
expect(newBufferHandler).not.toHaveBeenCalled()
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when not passed a path", ->
it "returns a new edit session and emits 'buffer-created' and 'edit-session-created' events", ->
editSession = null
it "returns a new edit session and emits 'buffer-created' and 'editor-created' events", ->
editor = null
waitsForPromise ->
project.open().then (o) -> editSession = o
atom.project.open().then (o) -> editor = o
runs ->
expect(editSession.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editSession.buffer)
expect(newEditSessionHandler).toHaveBeenCalledWith editSession
expect(editor.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed a path that matches a custom opener", ->
it "returns the resource returned by the custom opener", ->
waitsForPromise ->
pathToOpen = project.resolve('a.foo')
project.open(pathToOpen, hey: "there").then (item) ->
pathToOpen = atom.project.resolve('a.foo')
atom.project.open(pathToOpen, hey: "there").then (item) ->
expect(item).toEqual { foo: pathToOpen, options: {hey: "there"} }
waitsForPromise ->
project.open("bar://baz").then (item) ->
atom.project.open("bar://baz").then (item) ->
expect(item).toEqual { bar: "bar://baz" }
it "returns number of read bytes as progress indicator", ->
filePath = project.resolve 'a'
filePath = atom.project.resolve 'a'
totalBytes = 0
promise = project.open(filePath)
promise = atom.project.open(filePath)
promise.progress (bytesRead) -> totalBytes = bytesRead
waitsForPromise ->
@@ -209,22 +218,22 @@ describe "Project", ->
describe ".bufferForPathSync(path)", ->
describe "when opening a previously opened path", ->
it "does not create a new buffer", ->
buffer = project.bufferForPathSync("a").retain()
expect(project.bufferForPathSync("a")).toBe buffer
buffer = atom.project.bufferForPathSync("a").retain()
expect(atom.project.bufferForPathSync("a")).toBe buffer
alternativeBuffer = project.bufferForPathSync("b").retain().release()
alternativeBuffer = atom.project.bufferForPathSync("b").retain().release()
expect(alternativeBuffer).not.toBe buffer
buffer.release()
it "creates a new buffer if the previous buffer was destroyed", ->
buffer = project.bufferForPathSync("a").retain().release()
expect(project.bufferForPathSync("a").retain().release()).not.toBe buffer
buffer = atom.project.bufferForPathSync("a").retain().release()
expect(atom.project.bufferForPathSync("a").retain().release()).not.toBe buffer
describe ".bufferForPath(path)", ->
[buffer] = []
beforeEach ->
waitsForPromise ->
project.bufferForPath("a").then (o) ->
atom.project.bufferForPath("a").then (o) ->
buffer = o
buffer.retain()
@@ -234,63 +243,137 @@ describe "Project", ->
describe "when opening a previously opened path", ->
it "does not create a new buffer", ->
waitsForPromise ->
project.bufferForPath("a").then (anotherBuffer) ->
atom.project.bufferForPath("a").then (anotherBuffer) ->
expect(anotherBuffer).toBe buffer
waitsForPromise ->
project.bufferForPath("b").then (anotherBuffer) ->
atom.project.bufferForPath("b").then (anotherBuffer) ->
expect(anotherBuffer).not.toBe buffer
it "creates a new buffer if the previous buffer was destroyed", ->
buffer.release()
waitsForPromise ->
project.bufferForPath("b").then (anotherBuffer) ->
atom.project.bufferForPath("b").then (anotherBuffer) ->
expect(anotherBuffer).not.toBe buffer
describe ".resolve(uri)", ->
describe "when passed an absolute or relative path", ->
it "returns an absolute path based on the project's root", ->
it "returns an absolute path based on the atom.project's root", ->
absolutePath = require.resolve('./fixtures/dir/a')
expect(project.resolve('a')).toBe absolutePath
expect(project.resolve(absolutePath + '/../a')).toBe absolutePath
expect(project.resolve('a/../a')).toBe absolutePath
expect(atom.project.resolve('a')).toBe absolutePath
expect(atom.project.resolve(absolutePath + '/../a')).toBe absolutePath
expect(atom.project.resolve('a/../a')).toBe absolutePath
describe "when passed a uri with a scheme", ->
it "does not modify uris that begin with a scheme", ->
expect(project.resolve('http://zombo.com')).toBe 'http://zombo.com'
expect(atom.project.resolve('http://zombo.com')).toBe 'http://zombo.com'
describe ".setPath(path)", ->
describe "when path is a file", ->
it "sets its path to the files parent directory and updates the root directory", ->
project.setPath(require.resolve('./fixtures/dir/a'))
expect(project.getPath()).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
expect(project.getRootDirectory().path).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
atom.project.setPath(require.resolve('./fixtures/dir/a'))
expect(atom.project.getPath()).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
expect(atom.project.getRootDirectory().path).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
describe "when path is a directory", ->
it "sets its path to the directory and updates the root directory", ->
directory = fs.absolute(path.join(__dirname, 'fixtures', 'dir', 'a-dir'))
project.setPath(directory)
expect(project.getPath()).toEqual directory
expect(project.getRootDirectory().path).toEqual directory
atom.project.setPath(directory)
expect(atom.project.getPath()).toEqual directory
expect(atom.project.getRootDirectory().path).toEqual directory
describe "when path is null", ->
it "sets its path and root directory to null", ->
project.setPath(null)
expect(project.getPath()?).toBeFalsy()
expect(project.getRootDirectory()?).toBeFalsy()
atom.project.setPath(null)
expect(atom.project.getPath()?).toBeFalsy()
expect(atom.project.getRootDirectory()?).toBeFalsy()
describe ".replace()", ->
[filePath, commentFilePath, sampleContent, sampleCommentContent] = []
beforeEach ->
atom.project.setPath(atom.project.resolve('../'))
filePath = atom.project.resolve('sample.js')
commentFilePath = atom.project.resolve('sample-with-comments.js')
sampleContent = fs.readFileSync(filePath).toString()
sampleCommentContent = fs.readFileSync(commentFilePath).toString()
afterEach ->
fs.writeFileSync(filePath, sampleContent)
fs.writeFileSync(commentFilePath, sampleCommentContent)
describe "when called with unopened files", ->
it "replaces properly", ->
results = []
waitsForPromise ->
atom.project.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
describe "when a buffer is already open", ->
it "replaces properly and saves when not modified", ->
editor = atom.project.openSync('sample.js')
expect(editor.isModified()).toBeFalsy()
results = []
waitsForPromise ->
atom.project.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeFalsy()
it "does not replace when the path is not specified", ->
editor = atom.project.openSync('sample.js')
editor = atom.project.openSync('sample-with-comments.js')
results = []
waitsForPromise ->
atom.project.replace /items/gi, 'items', [commentFilePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe commentFilePath
it "does NOT save when modified", ->
editor = atom.project.openSync('sample.js')
editor.buffer.change([[0,0],[0,0]], 'omg')
expect(editor.isModified()).toBeTruthy()
results = []
waitsForPromise ->
atom.project.replace /items/gi, 'okthen', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeTruthy()
describe ".scan(options, callback)", ->
describe "when called with a regex", ->
it "calls the callback with all regex results in all files in the project", ->
results = []
waitsForPromise ->
project.scan /(a)+/, (result) ->
atom.project.scan /(a)+/, (result) ->
results.push(result)
runs ->
expect(results).toHaveLength(3)
expect(results[0].filePath).toBe project.resolve('a')
expect(results[0].filePath).toBe atom.project.resolve('a')
expect(results[0].matches).toHaveLength(3)
expect(results[0].matches[0]).toEqual
matchText: 'aaa'
@@ -301,13 +384,13 @@ describe "Project", ->
it "works with with escaped literals (like $ and ^)", ->
results = []
waitsForPromise ->
project.scan /\$\w+/, (result) -> results.push(result)
atom.project.scan /\$\w+/, (result) -> results.push(result)
runs ->
expect(results.length).toBe 1
{filePath, matches} = results[0]
expect(filePath).toBe project.resolve('a')
expect(filePath).toBe atom.project.resolve('a')
expect(matches).toHaveLength 1
expect(matches[0]).toEqual
matchText: '$bill'
@@ -316,11 +399,12 @@ describe "Project", ->
range: [[2, 6], [2, 11]]
it "works on evil filenames", ->
project.setPath(path.join(__dirname, 'fixtures', 'evil-files'))
platform.generateEvilFiles()
atom.project.setPath(path.join(__dirname, 'fixtures', 'evil-files'))
paths = []
matches = []
waitsForPromise ->
project.scan /evil/, (result) ->
atom.project.scan /evil/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
@@ -343,7 +427,7 @@ describe "Project", ->
it "ignores case if the regex includes the `i` flag", ->
results = []
waitsForPromise ->
project.scan /DOLLAR/i, (result) -> results.push(result)
atom.project.scan /DOLLAR/i, (result) -> results.push(result)
runs ->
expect(results).toHaveLength 1
@@ -365,17 +449,17 @@ describe "Project", ->
runs ->
fs.rename(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
ignoredPath = path.join(projectPath, 'ignored.txt')
fs.writeSync(ignoredPath, 'this match should not be included')
fs.writeFileSync(ignoredPath, 'this match should not be included')
afterEach ->
fs.remove(projectPath) if fs.exists(projectPath)
fs.removeSync(projectPath) if fs.existsSync(projectPath)
it "excludes ignored files", ->
project.setPath(projectPath)
config.set('core.excludeVcsIgnoredPaths', true)
atom.project.setPath(projectPath)
atom.config.set('core.excludeVcsIgnoredPaths', true)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
project.scan /match/, (results) ->
atom.project.scan /match/, (results) ->
resultHandler()
runs ->
@@ -383,14 +467,14 @@ describe "Project", ->
it "includes only files when a directory filter is specified", ->
projectPath = path.join(path.join(__dirname, 'fixtures', 'dir'))
project.setPath(projectPath)
atom.project.setPath(projectPath)
filePath = path.join(projectPath, 'a-dir', 'oh-git')
paths = []
matches = []
waitsForPromise ->
project.scan /aaa/, paths: ['a-dir/'], (result) ->
atom.project.scan /aaa/, paths: ["a-dir#{path.sep}"], (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
@@ -402,12 +486,12 @@ describe "Project", ->
it "includes files and folders that begin with a '.'", ->
projectPath = temp.mkdirSync()
filePath = path.join(projectPath, '.text')
fs.writeSync(filePath, 'match this')
project.setPath(projectPath)
fs.writeFileSync(filePath, 'match this')
atom.project.setPath(projectPath)
paths = []
matches = []
waitsForPromise ->
project.scan /match this/, (result) ->
atom.project.scan /match this/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
@@ -418,27 +502,56 @@ describe "Project", ->
it "excludes values in core.ignoredNames", ->
projectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
ignoredNames = config.get("core.ignoredNames")
ignoredNames = atom.config.get("core.ignoredNames")
ignoredNames.push("a")
config.set("core.ignoredNames", ignoredNames)
atom.config.set("core.ignoredNames", ignoredNames)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
project.scan /dollar/, (results) ->
atom.project.scan /dollar/, (results) ->
resultHandler()
runs ->
expect(resultHandler).not.toHaveBeenCalled()
it "scans buffer contents if the buffer is modified", ->
editSession = project.openSync("a")
editSession.setText("Elephant")
editor = atom.project.openSync("a")
editor.setText("Elephant")
results = []
waitsForPromise ->
project.scan /a|Elephant/, (result) -> results.push result
atom.project.scan /a|Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 3
resultForA = _.find results, ({filePath}) -> path.basename(filePath) == 'a'
expect(resultForA.matches).toHaveLength 1
expect(resultForA.matches[0].matchText).toBe 'Elephant'
describe ".eachBuffer(callback)", ->
beforeEach ->
atom.project.bufferForPathSync('a')
it "invokes the callback for existing buffer", ->
count = 0
count = 0
callbackBuffer = null
callback = (buffer) ->
callbackBuffer = buffer
count++
atom.project.eachBuffer(callback)
expect(count).toBe 1
expect(callbackBuffer).toBe atom.project.getBuffers()[0]
it "invokes the callback for new buffers", ->
count = 0
callbackBuffer = null
callback = (buffer) ->
callbackBuffer = buffer
count++
atom.project.eachBuffer(callback)
count = 0
callbackBuffer = null
atom.project.bufferForPathSync(require.resolve('./fixtures/sample.txt'))
expect(count).toBe 1
expect(callbackBuffer).toBe atom.project.getBuffers()[1]

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais