Comparar commits

...

182 Commits

Autor SHA1 Mensagem Data
Nathan Sobo aa180e1498 Display package name correctly for ::getUri deprecation warnings
We capture the package name during the call to ::addOpener and use it
if any open items have the deprecated ::getUri method.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-14 12:44:26 -07:00
Nathan Sobo 3093a35554 ⬆️ status-bar for deprecation fixes 2015-01-14 11:45:15 -07:00
Kevin Sawicki 3839432654 Merge pull request #5059 from atom/ks-squirrel-zero-point-eight
Upgrade to Squirrel for Windows 0.8
2015-01-14 10:42:00 -08:00
Nathan Sobo 0a66e9d21e Centralize deprecation warnings about getUri in Pane::addItem 2015-01-14 11:36:28 -07:00
Kevin Sawicki 3dbdfe54ad Use Atom icon in AtomSetup.exe 2015-01-14 10:32:50 -08:00
Kevin Sawicki 485fc62d22 ⬆️ grunt-atom-shell-installer@0.19 2015-01-14 10:32:50 -08:00
Kevin Sawicki a0f8405457 ⬆️ grunt-atom-shell-installer@0.18 2015-01-14 10:32:49 -08:00
Nathan Sobo 56da4f49d4 Avoid spurious deprecation warnings when editor URIs are undefined
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-14 11:21:08 -07:00
Kevin Sawicki 76b7a8cec9 Merge pull request #5051 from tony612/fix-marker-doc
📝 fix setHead & setTail docs in Marker
2015-01-14 09:10:26 -08:00
Nathan Sobo de987d3fd2 ⬆️ deprecation-cop 2015-01-14 10:04:03 -07:00
Tony Han 1a09ec6b92 📝 fix setHead & setTail docs in Marker
Change range -> position
2015-01-14 20:42:13 +08:00
simurai 149cfdf0c2 Let headers inherit the theme font-family
Issue https://github.com/atom/settings-view/issues/340
2015-01-14 10:37:06 +09:00
Kevin Sawicki d522438876 📝 💄 2015-01-13 17:23:15 -08:00
Kevin Sawicki 8fe72cd469 📝 Remove extra s in essential 2015-01-13 17:23:15 -08:00
Nathan Sobo 51a950c419 ⬆️ deprecation-cop 2015-01-13 18:03:38 -07:00
Kevin Sawicki e693254913 Prevent form submits from changing the window URL
Refs atom/settings-view#341
2015-01-13 16:01:24 -08:00
Kevin Sawicki 170a71f416 ⬆️ apm@0.120 2015-01-13 14:52:11 -08:00
Kevin Sawicki e8c19300b5 Use access token when downloading atom shell 2015-01-13 14:37:21 -08:00
Kevin Sawicki 045850ba06 Prepare 0.173 2015-01-13 14:29:26 -08:00
Kevin Sawicki 366ded2f5e ⬆️ season@5.0.5 2015-01-13 14:11:44 -08:00
Kevin Sawicki 716682f072 Defer require until a Color is parsed 2015-01-13 13:40:42 -08:00
Kevin Sawicki 29ee7cc76b Prepare 0.172 2015-01-13 13:27:07 -08:00
Max Brunsfeld 98fe40546e ⬆️ autocomplete@0.42
For inclusion of completions from all matching scopes
2015-01-13 13:04:24 -08:00
Kevin Sawicki 6765eeba1a ⬆️ settings-view@0.172 2015-01-13 12:22:26 -08:00
Kevin Sawicki 1c638129be ⬆️ season@5.0.4 2015-01-13 12:11:50 -08:00
Kevin Sawicki ae2ce9a1f9 Log raw load settings when parsing fails 2015-01-13 12:06:08 -08:00
Ben Ogle b3de4a593d Upgrade notifications to render notifications posted before activation 2015-01-13 11:57:42 -08:00
Ben Ogle dc22592512 Update deprecation-cop for new selector deprecations 2015-01-13 11:51:06 -08:00
Ben Ogle 85208d197d Upgrade tabs to have use custom elements 2015-01-13 11:27:07 -08:00
Kevin Sawicki 277d3ea4ff ⬆️ grunt-cson@0.14 2015-01-13 11:00:23 -08:00
Kevin Sawicki 6d661692df ⬆️ grunt-cson@0.13 2015-01-13 10:55:49 -08:00
Kevin Sawicki 14a75b8605 ⬆️ atom-keymap@2.5.2 2015-01-13 10:47:28 -08:00
Kevin Sawicki 9564fdb48f ⬆️ grunt-cson@0.12 2015-01-13 10:27:39 -08:00
Kevin Sawicki d5e4f051be ⬆️ react-atom-fork@0.11.4 2015-01-13 10:27:18 -08:00
Kevin Sawicki 8c1ee8a759 ⬆️ language-go@0.21 2015-01-13 10:06:48 -08:00
Kevin Sawicki ad64017b7a Merge pull request #5031 from tony612/fix-text-editor-observeCursors-doc
📝 fix ::observeCursors doc
2015-01-13 09:55:49 -08:00
Tony Han 4ebf748fd7 📝 fix ::observeCursors doc
Change selection -> cursor
2015-01-14 01:53:25 +08:00
Kevin Sawicki f0b9b9eb6c ⬆️ season@5.0.3 2015-01-13 09:49:32 -08:00
Nathan Sobo 49cd3eb5da Clear window.setTimeout mock before each spec
This fixes a failure in the keymap spec where we assert that setTimeout
hasn’t been called.
2015-01-13 10:17:48 -07:00
Nathan Sobo ab4588571d Update default style sheet with ::shadow selector 2015-01-13 10:07:03 -07:00
Kevin Sawicki 0097e6246e ⬆️ settings-view@0.171 2015-01-13 09:02:55 -08:00
Nathan Sobo 296409d9d0 Update style guide
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Nathan Sobo 7f8ab72f53 Capitalize initialisms
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Kevin Sawicki 7f2e118abc ⬆️ settings-view@0.170 2015-01-12 18:13:57 -08:00
Kevin Sawicki 415a7e3214 Merge pull request #4930 from atom/ks-add-colors-to-config-schema
Add color support to config schema
2015-01-12 17:54:14 -08:00
Kevin Sawicki 1f3708115e 💄 2015-01-12 17:34:44 -08:00
Kevin Sawicki 55c8b37395 📝 Link to config method 2015-01-12 17:34:44 -08:00
Kevin Sawicki 9d3e9d19e1 📝 Link to Color 2015-01-12 17:34:44 -08:00
Kevin Sawicki 432c31c4dc 💄 2015-01-12 17:34:44 -08:00
Kevin Sawicki e257395f7d Always use settings for parsing 2015-01-12 17:34:44 -08:00
Kevin Sawicki 3f224716a1 💄 2015-01-12 17:34:43 -08:00
Kevin Sawicki 640f8920fb Fix bounds checking of alpha 2015-01-12 17:34:43 -08:00
Kevin Sawicki c015a5c03b 📝 Add period 2015-01-12 17:34:43 -08:00
Kevin Sawicki 88f489715f 📝 Add period 2015-01-12 17:34:43 -08:00
Kevin Sawicki f48a7ac210 Mark methods as essential 2015-01-12 17:34:43 -08:00
Kevin Sawicki 44939a12a0 Validate color properties when set 2015-01-12 17:34:43 -08:00
Kevin Sawicki b256d30bc7 Mark Color as public 2015-01-12 17:34:43 -08:00
Kevin Sawicki 574c56713c Add Color class with string helpers 2015-01-12 17:34:43 -08:00
Kevin Sawicki b8822b32db Only coerce strings and plain objects 2015-01-12 17:34:43 -08:00
Kevin Sawicki 8c39818670 Don't blow up when asking for schema at non-existent path 2015-01-12 17:34:43 -08:00
Kevin Sawicki 5a2c208804 Add specs with invalid objects 2015-01-12 17:34:43 -08:00
Kevin Sawicki fc899f54cf Add specs for setting with an object 2015-01-12 17:34:42 -08:00
Kevin Sawicki c480080dd2 Add fallback values when NaN is parsed 2015-01-12 17:34:42 -08:00
Kevin Sawicki b923b57bcc Add specs for hsl and hsla colors 2015-01-12 17:34:42 -08:00
Kevin Sawicki 1609b6c51b ⬆️ legal-eagle@0.8 2015-01-12 17:34:42 -08:00
Kevin Sawicki 66e30dd38a ⬆️ legal-eagle@0.7 2015-01-12 17:34:42 -08:00
Kevin Sawicki ec96c5f1fc 📝 Add color docs 2015-01-12 17:34:42 -08:00
Kevin Sawicki 319ec244e1 Add spec for invalid values 2015-01-12 17:34:42 -08:00
Kevin Sawicki 1267a1e14e Add spec for default color value 2015-01-12 17:34:42 -08:00
Kevin Sawicki 0411f1584c Add color schema type 2015-01-12 17:34:42 -08:00
Kevin Sawicki 9dc9359e7c ⬆️ apm@0.119 2015-01-12 17:32:27 -08:00
Kevin Sawicki 47668306bd ⬆️ styleguide@0.41 2015-01-12 17:30:48 -08:00
Kevin Sawicki 09920548e8 ⬆️ styleguide@0.40 2015-01-12 17:25:29 -08:00
Kevin Sawicki dea4e4dc19 ⬆️ markdown-preview@0.117 2015-01-12 17:25:29 -08:00
Kevin Sawicki 95ae4a704e ⬆️ snippets@0.67 2015-01-12 17:25:29 -08:00
Kevin Sawicki 903df93933 ⬆️ settings-view@0.169 2015-01-12 17:25:29 -08:00
Kevin Sawicki 4bc6906bdc ⬆️ language-gfm@0.62 2015-01-12 17:25:29 -08:00
Kevin Sawicki f6f71db9ee ⬆️ first-mate@2.2.4 2015-01-12 17:25:29 -08:00
Kevin Sawicki aca8dc3dfb ⬆️ atom-keymap@2.5.1 2015-01-12 17:25:28 -08:00
Nathan Sobo 8e0e6f5508 Merge pull request #5017 from atom/ns-per-editor-gutter-visibility
Add gutter-hidden attribute to atom-text-editor elements
2015-01-12 18:11:50 -07:00
Kevin Sawicki c4d38a738b Merge pull request #4971 from atom/ks-four-season
Stop eval'ing .cson files
2015-01-12 17:06:39 -08:00
Nathan Sobo eee31c3e8c Don’t use component property for TextEditorView::mini shim
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 17:56:47 -07:00
Kevin Sawicki f40d2fb1cc ⬆️ season@5.0.2 2015-01-12 16:55:58 -08:00
Kevin Sawicki 8c30f5fe3f ⬆️ season@5.0.1 2015-01-12 16:55:58 -08:00
Kevin Sawicki e69bd77ef2 ⬆️ coffeestack@0.8 2015-01-12 16:55:58 -08:00
Kevin Sawicki 1c57a48287 ⬆️ coffee-script@1.8 2015-01-12 16:55:58 -08:00
Kevin Sawicki e5a1f15833 Unfocus spec 2015-01-12 16:55:58 -08:00
Kevin Sawicki 8a13c4b959 ⬆️ season@5 2015-01-12 16:55:58 -08:00
Kevin Sawicki 36c0d214f0 ⬆️ season@4.0.3 2015-01-12 16:55:58 -08:00
Kevin Sawicki ae859bad46 ⬆️ season@4.0.2 2015-01-12 16:55:58 -08:00
Kevin Sawicki 1207a432eb ⬆️ season@4.0.1 2015-01-12 16:55:58 -08:00
Kevin Sawicki 2f31822942 ⬆️ grunt-cson@0.11 2015-01-12 16:55:57 -08:00
Kevin Sawicki dea75513b5 Add missing colon 2015-01-12 16:55:57 -08:00
Kevin Sawicki c3a2b3d321 Add cson-safe license override 2015-01-12 16:55:57 -08:00
Kevin Sawicki 97dd53cbdb ⬆️ season@4 2015-01-12 16:55:57 -08:00
Nathan Sobo dd80226c23 Revert "Handle addition/removal of ‘gutter-hidden’ attribute"
This reverts commit 6926236268.

There seems to be some bug or timing issue that prevents the
attachedCallback from being called in all cases when the
attributeChangedCallback is defined. We can figure this out at
a later time.
2015-01-12 17:39:07 -07:00
Nathan Sobo 6926236268 Handle addition/removal of ‘gutter-hidden’ attribute
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo 43f57347d7 Add ‘gutter-hidden’ attribute to TextEditorElement
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo c0b78db159 💄
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo 002918049d 🐎 Cache gutterVisible state in React component
This avoids a config read on every render.
2015-01-12 16:21:31 -07:00
Nathan Sobo f00b0b7f7a Add TextEditor::set/isGutterVisible
Controls gutter visibility on individual editors.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Daniel Hengeveld 6ef8c21977 Merge pull request #5015 from atom/dh-bump-settings-view
⬆️ settings-view@0.168
2015-01-12 12:51:26 -08:00
Daniel Hengeveld 9b2ec09bf1 ⬆️ settings-view@0.168 2015-01-12 12:17:30 -08:00
Ben Ogle 52e91932e0 Merge pull request #5013 from kant/patch-1
Little fix
2015-01-12 11:27:42 -08:00
Darío Hereñú acd34ffaf8 Little fix 2015-01-12 16:27:01 -03:00
Kevin Sawicki 2f62346c58 Link to Windows CI post as well 2015-01-12 11:15:50 -08:00
Ben Ogle f59ffc2485 Merge pull request #4979 from DinisCruz/patch-1
Adding link to blog post with Travis CI instructions
2015-01-12 10:54:32 -08:00
Kevin Sawicki 3090a24957 Prepare 0.171 2015-01-12 10:02:15 -08:00
Kevin Sawicki b39cee3997 ⬆️ language-python@0.30 2015-01-12 09:18:15 -08:00
Kevin Sawicki 8c6e782bd4 ⬆️ language-javascript@0.54 2015-01-12 09:17:13 -08:00
Kevin Sawicki 31106874ed ⬆️ language-xml@0.27 2015-01-12 09:16:23 -08:00
Max Brunsfeld ee73d2cf2a 📝 fix ::onDidChangeActivePaneItem docs
Refs #4946
2015-01-12 08:24:44 -08:00
Dinis Cruz f946061b6c Adding link to blog post with Travis CI instructions 2015-01-10 12:27:32 +00:00
Kevin Sawicki 29f95b88db deprecatedStart is an index 2015-01-09 18:40:57 -08:00
Ben Ogle 48e6cd533d Add wasDisplayed to Notification 2015-01-09 17:35:26 -08:00
Max Brunsfeld 6cc1ffa793 ⬆️ atom-keymap@2.5.0 2015-01-09 17:11:52 -08:00
Max Brunsfeld ee7587e024 Update task docs 2015-01-09 16:59:13 -08:00
Max Brunsfeld fb0769783f Don't use Emitter::off in Task
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 16:59:13 -08:00
Max Brunsfeld 174b7072b7 Add specs for Task events
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 16:59:13 -08:00
Kevin Sawicki f5cd8d107f Merge pull request #4973 from atom/ld-scope-notification
Log scopes to notification instead of console
2015-01-09 16:43:50 -08:00
Lee Dohm ef97197681 Use list.map instead of _.map list 2015-01-09 16:42:16 -08:00
Lee Dohm acb19c1fe1 Log scopes to notification instead of console
Fixes #4969
2015-01-09 16:33:48 -08:00
Kevin Sawicki 495a45e723 ⬆️ language-gfm@0.61 2015-01-09 15:48:17 -08:00
Max Brunsfeld 02a6ed554d Make ContextMenuManager::showForEvent private
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 15:47:30 -08:00
Max Brunsfeld dde5e6123c Make Cursor::updateVisibility private 2015-01-09 15:41:08 -08:00
Nathan Sobo d26c19a0ec Deprecate Project::resolve
It’s not something that will make sense once we add the ability to have
multiple directories in a project. This adds a new private method on
Project, ::resolvePath, with the original implementation for convenience
until we actually implement multi-folder projects.
2015-01-09 15:03:07 -08:00
Max Brunsfeld f9bde050b4 Handle TextEditorElement::focus() while parent is being attached
Fixes atom/autocomplete#61
2015-01-09 15:00:35 -08:00
Nathan Sobo 19bf64f3cd Revert "Deprecate Project::resolve"
This reverts commit 3c5bd9f10a.
2015-01-09 13:58:01 -08:00
Nathan Sobo 3c5bd9f10a Deprecate Project::resolve
It’s not something that will make sense once we add the ability to have
multiple directories in a project.
2015-01-09 13:40:35 -08:00
Ben Ogle a47782ddd8 Fix context menu docs Closes #4963 2015-01-09 13:28:57 -08:00
Nathan Sobo f21dc22803 Merge pull request #4955 from atom/ns-style-sheet-is-2-words
"Style sheet" is two words – Treat it that way in the API
2015-01-09 11:36:16 -08:00
Kevin Sawicki efe9102060 ⬆️ apm@0.118 2015-01-09 11:16:18 -08:00
Nathan Sobo 2c72c1522a ⬆️ open-on-github 2015-01-09 09:28:15 -08:00
Nathan Sobo 0a5b4f9b33 Make “style sheet” two words in package.json metadata
Rename `stylesheets` -> `styleSheets`
Rename `stylesheetsMain` -> `mainStyleSheet`
2015-01-09 09:04:04 -08:00
Nathan Sobo 932d3755ce Rename stylesheets/ directory in fixture packages 2015-01-09 08:56:12 -08:00
Nathan Sobo a2e855f087 Update docs to refer to styles/ instead of stylesheets/ 2015-01-09 08:42:28 -08:00
Nathan Sobo c078f64293 Rename package stylesheets/ directory to styles/ 2015-01-09 08:42:15 -08:00
Nathan Sobo 37ba67728b Fix core deprecations 2015-01-09 08:24:48 -08:00
Nathan Sobo 7f9d06f55b Move TextEditor::pixelPositionForScreen/BufferPosition to view layer
It doesn’t make sense to talk about pixels at the model layer long-term,
even though we currently store view dimension information in the model
so we don’t have to read from the DOM for optimization purposes. This
information is only available if the view is attached, however, making
these methods a liability on the model layer.
2015-01-09 08:22:45 -08:00
Nathan Sobo f151697c4c ⬆️ packages to remove deprecations 2015-01-08 18:29:38 -08:00
Max Brunsfeld d47efdb2f1 Merge pull request #4937 from atom/ns-clean-up-package-manager
Address issues with PackageManager
2015-01-08 18:21:51 -08:00
Nathan Sobo c3efed0a2c Update deprecation messages 2015-01-08 18:21:07 -08:00
Nathan Sobo a945725a2f Add shims for tests that manually dispatch deprecated events 2015-01-08 17:51:11 -08:00
Nathan Sobo 723b4d2787 Fix undefined Grim references 2015-01-08 17:51:11 -08:00
Nathan Sobo 4ab33890fc Add PackageManager::onDidLoad/UnloadPackage
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 7acf3d4d6b Add PackageManager::onDidDeactivatePackage 2015-01-08 17:51:11 -08:00
Nathan Sobo 6dd9834ae1 Remove defunct text-mate package specs 2015-01-08 17:51:11 -08:00
Nathan Sobo a6c9244c77 Add PackageManager::onDidActivatePackage
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo dbc88bde18 Remove special case in spec for packages converted from text-mate
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 18ac0091a8 Don’t call onDidActivateInitialPackages listeners until the right time
We wait until all packages without activation commands actually
activate.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 010bd643c0 Rename onDidActivateAll -> onDidActivateInitialPackages
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 15fa19efa3 Rename onDidLoadAll -> onDidLoadInitialPackages
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 30513cfde0 Rename ThemeManager methods for clarity/consistency
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:09 -08:00
Nathan Sobo d999b4eca0 Deprecate ThemeManager::setEnabledThemes
Suggest direct config write instead.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:48:32 -08:00
Nathan Sobo 4ebd9bc775 ⬆️ deprecation-cop
Closes atom/deprecation-cop#16

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:46:14 -08:00
Nathan Sobo caf613e7c8 Associate packageName metadata with scoped-properties/ deprecation
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:41:50 -08:00
Kevin Sawicki c2da368463 ⬆️ atom-light-ui@0.37 2015-01-08 15:36:47 -08:00
Kevin Sawicki 61f44c9399 ⬆️ language-gfm@0.60 2015-01-08 13:25:07 -08:00
Kevin Sawicki 0a249f776b ⬆️ settings-view@0.167 2015-01-08 13:20:18 -08:00
Kevin Sawicki 00831775dd Merge pull request #4907 from atom/ks-use-different-sudo-compile-cache
Use special compile cache when sudo-ing as root
2015-01-08 11:09:19 -08:00
Ben Ogle 72743235fb Upgrade toatom-dark-ui@0.43.0 2015-01-08 10:47:09 -08:00
Kevin Sawicki 453a44dde3 Use special compile cache when sudo-ing as root 2015-01-08 10:18:54 -08:00
Kevin Sawicki d7158a2ced ⬆️ language-sass@0.31 2015-01-08 10:18:18 -08:00
Kevin Sawicki 4e7a9edefd Prepare 0.170 release 2015-01-08 09:55:06 -08:00
Kevin Sawicki 8fa6fdb90c Merge pull request #4807 from atom/sm-icons
Icon refresh
2015-01-08 09:42:08 -08:00
Kevin Sawicki a57df59cb8 Merge pull request #4911 from postcasio/patch-3
📝 Fix PackageManager::onDidLoadAll description
2015-01-08 09:32:57 -08:00
Kevin Sawicki 99d01b5d0e ⬆️ settings-view@0.166 2015-01-08 09:22:06 -08:00
dominic c806fcf9e7 📝 Fix PackageManager::onDidLoadAll description 2015-01-08 09:42:49 +00:00
Cheng Zhao 1bc9c2eb4b ⬆️ atom-shell@0.20.5 2015-01-08 00:11:59 -08:00
simurai bd08e36d2d Replace Win icons 2015-01-08 14:14:12 +09:00
Kevin Sawicki 76a2b8c54a Add sample list item 2015-01-07 17:57:11 -08:00
Kevin Sawicki 131d2ab3ad 📝 Drop the parens 2015-01-07 17:35:25 -08:00
Kevin Sawicki 0e0c508756 Merge pull request #4901 from danfuzz/fix-url-markdown
📝 Fix URL references for LESS.
2015-01-07 17:34:33 -08:00
Dan Bornstein 325d95ed35 📝 Un-parenthesize the recommendation about LESS.
Per suggestion from @kevinsawicki.
2015-01-07 17:32:07 -08:00
Kevin Sawicki 081fc0e1ae Use icon from resources directory 2015-01-07 16:22:11 -08:00
Kevin Sawicki a6cc6afb16 Don't bundle resources/linux 2015-01-07 16:20:57 -08:00
Nathan Sobo f330e58b4f Prepare 0.169.0 release 2015-01-07 16:35:29 -07:00
Dan Bornstein 34d41efd9a 📝 Fix URL references for LESS. 2015-01-07 14:17:23 -08:00
simurai 13cf51f835 Replace file icon 2015-01-07 23:06:08 +09:00
simurai dc06173f2f Replace main icon 2015-01-07 17:13:34 +09:00
simurai 358799285e Increse icon line thickness 2015-01-07 16:49:31 +09:00
simurai 6b34a18bd9 Replace Mac icons
with Yosemite version
2014-12-30 23:04:49 +09:00
93 arquivos alterados com 1371 adições e 843 exclusões
+4
Ver Arquivo
@@ -99,6 +99,10 @@ For more information on how to work with Atom's official packages, see
* Avoid spaces inside the curly-braces of hash literals:
* `{a: 1, b: 2}` instead of `{ a: 1, b: 2 }`
* Include a single line of whitespace between methods.
* Capitalize initialisms and acronyms in names, except for the first word, which
should be lower-case:
* `getURI` instead of `getUri`
* `uriToOpen` instead of `URIToOpen`
## Documentation Styleguide
+1 -1
Ver Arquivo
@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.117.0"
"atom-package-manager": "0.120.0"
}
}
+2
Ver Arquivo
@@ -198,6 +198,7 @@ module.exports = (grunt) ->
outputDir: 'atom-shell'
downloadDir: atomShellDownloadDir
rebuild: true # rebuild native modules after atom-shell is updated
token: process.env.ATOM_ACCESS_TOKEN
'create-windows-installer':
appDirectory: shellAppDir
@@ -205,6 +206,7 @@ module.exports = (grunt) ->
authors: 'GitHub Inc.'
loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'
setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
shell:
'kill-atom':
+5 -5
Ver Arquivo
@@ -12,19 +12,19 @@
"fs-plus": "2.x",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-atom-shell-installer": "^0.16.0",
"grunt-atom-shell-installer": "^0.19.0",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
"grunt-contrib-coffee": "~0.9.0",
"grunt-contrib-coffee": "~0.12.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.10.0",
"grunt-download-atom-shell": "~0.10.0",
"grunt-cson": "0.14.0",
"grunt-download-atom-shell": "~0.11.0",
"grunt-lesslint": "0.13.0",
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"legal-eagle": "~0.6.0",
"legal-eagle": "~0.8.0",
"minidump": "~0.8",
"npm": "~1.4.5",
"rcedit": "~0.3.0",
+1 -1
Ver Arquivo
@@ -25,7 +25,6 @@ module.exports = (grunt) ->
cp 'atom.sh', path.join(appDir, 'atom.sh')
cp 'package.json', path.join(appDir, 'package.json')
cp path.join('resources', 'atom.png'), path.join(appDir, 'atom.png')
packageDirectories = []
nonPackageDirectories = [
@@ -72,6 +71,7 @@ module.exports = (grunt) ->
path.join('build', 'Release', 'obj')
path.join('build', 'Release', '.deps')
path.join('vendor', 'apm')
path.join('resources', 'linux')
path.join('resources', 'mac')
path.join('resources', 'win')
+1 -1
Ver Arquivo
@@ -157,7 +157,7 @@ createAtomDraftRelease = (callback) ->
body: """
### Notable Changes
*
* Something new
"""
request options, (error, response, body='') ->
+1 -1
Ver Arquivo
@@ -15,7 +15,7 @@ module.exports = (grunt) ->
return unless process.env.JANKY_SHA1
stderr ?= ''
deprecatedStart = stderr.indexOf('Calls to deprecated functions')
return if deprecatedStart.length is -1
return if deprecatedStart is -1
grunt.log.error(label)
stderr = stderr.substring(deprecatedStart)
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
## Structure of a Keymap File
Keymap files are encoded as JSON or CSON files containing nested hashes. They
work much like stylesheets, but instead of applying style properties to elements
work much like style sheets, but instead of applying style properties to elements
matching the selector, they specify the meaning of keystrokes on elements
matching the selector. Here is an example of some bindings that apply when
keystrokes pass through `atom-text-editor` elements:
+10 -10
Ver Arquivo
@@ -15,7 +15,7 @@ my-package/
menus/
spec/
snippets/
stylesheets/
styles/
index.coffee
package.json
```
@@ -38,10 +38,10 @@ In addition to the regular [npm package.json keys][npm-keys] available, Atom
package.json files have their own additions.
- `main` (**Required**): the path to the CoffeeScript file that's the entry point
to your package
- `stylesheets` (**Optional**): an Array of Strings identifying the order of the
to your package.
- `styles` (**Optional**): an Array of Strings identifying the order of the
style sheets your package needs to load. If not specified, style sheets in the
_stylesheets_ directory are added alphabetically.
_styles_ directory are added alphabetically.
- `keymaps`(**Optional**): an Array of Strings identifying the order of the
key mappings your package needs to load. If not specified, mappings in the
_keymaps_ directory are added alphabetically.
@@ -121,10 +121,10 @@ like you.
## Style Sheets
Style sheets for your package should be placed in the _stylesheets_ directory.
Style sheets for your package should be placed in the _styles_ directory.
Any style sheets in this directory will be loaded and attached to the DOM when
your package is activated. Style sheets can be written as CSS or [LESS] (but
LESS is recommended).
your package is activated. Style sheets can be written as CSS or [LESS], but
LESS is recommended.
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
@@ -138,7 +138,7 @@ 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 style sheets
An optional `styleSheets` array in your _package.json_ can list the style sheets
by name to specify a loading order; otherwise, style sheets are loaded
alphabetically.
@@ -418,8 +418,8 @@ all the other available commands.
[underscore]: http://underscorejs.org/
[jasmine]: http://jasmine.github.io
[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
[LESS]: http://lesscss.org
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
[first-package]: your-first-package.html
[convert-bundle]: converting-a-text-mate-bundle.html
[convert-theme]: converting-a-text-mate-theme.html
+6 -6
Ver Arquivo
@@ -1,8 +1,8 @@
# 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 with a few handy extensions.
Atom's interface is rendered using HTML, and it's styled via [LESS] which is 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.
Atom supports two types of themes: _UI_ and _syntax_. UI themes style
elements such as the tree view, the tabs, drop-down lists, and the status bar.
@@ -42,10 +42,10 @@ _Motif_ theme listed in the _Syntax Theme_ drop-down. Select it from the menu to
activate it, now when you open an editor you should see that your new
_motif-syntax_ theme in action.
Open up _stylesheets/colors.less_ to change the various colors variables which
Open up _styles/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 selectors that have
Then open _styles/base.less_ and modify the various selectors that have
been already been defined. These selectors style different parts of code in the
editor such as comments, strings and the line numbers in the gutter.
@@ -131,7 +131,7 @@ _styleguide_, or use the shortcut `cmd-ctrl-shift-g`.
![styleguide-img]
[atomio]: http://atom.io/packages
[less]: http://lesscss.org/
[LESS]: http://lesscss.org/
[git]: http://git-scm.com/
[atom]: https://atom.io/
[package.json]: ./creating-a-package.html#package-json
+1 -1
Ver Arquivo
@@ -54,7 +54,7 @@ You can also use `apm` to find new packages to install:
## Customizing Key Bindings
Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
Atom keymaps work similarly to style sheets. Just as style sheets use selectors
to apply styles to elements, Atom keymaps use selectors to associate keystrokes
with events in specific contexts. Here's a small example, excerpted from Atom's
built-in keymaps:
+4 -4
Ver Arquivo
@@ -1,6 +1,6 @@
# Upgrading Your UI Theme Or Package Selectors
In addition to changes in Atom's scripting API, we'll also be making some breaking changes to Atom's DOM structure, requiring stylesheets and keymaps in both packages and themes to be updated.
In addition to changes in Atom's scripting API, we'll also be making some breaking changes to Atom's DOM structure, requiring style sheets and keymaps in both packages and themes to be updated.
## Deprecation Cop
@@ -121,12 +121,12 @@ The selector features discussed above allow you to target shadow DOM content wit
```
my-ui-theme/
stylesheets/
styles/
index.less # loaded globally
index.atom-text-editor.less # loaded in the text editor shadow DOM
```
Check out this [style sheet](https://github.com/atom/decoration-example/blob/master/stylesheets/decoration-example.atom-text-editor.less) from the decoration-example package for an example of context-targeting.
Check out this [style sheet](https://github.com/atom/decoration-example/blob/master/styles/decoration-example.atom-text-editor.less) from the decoration-example package for an example of context-targeting.
Inside a context-targeted style sheet, there's no need to use the `::shadow` or `/deep/` expressions. If you want to refer to the element containing the shadow root, you can use the `::host` pseudo-element.
@@ -134,4 +134,4 @@ During the transition phase, style sheets targeting the `atom-text-editor` conte
[shadow-dom-101]: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom
[shadow-dom-201]: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201#toc-style-cat-hat
[find-and-replace]: https://github.com/atom/find-and-replace/blob/95351f261bc384960a69b66bf12eae8002da63f9/stylesheets/find-and-replace.less#L10
[find-and-replace]: https://github.com/atom/find-and-replace/blob/95351f261bc384960a69b66bf12eae8002da63f9/styles/find-and-replace.less#L10
+7
Ver Arquivo
@@ -127,3 +127,10 @@ describe "when a test is written", ->
expect("apples").toEqual("apples")
expect("oranges").not.toEqual("apples")
```
### Running on CI
It is now easy to run the specs in a CI environment like Travis and AppVeyor. See the
[Travis CI For Your Packages](http://blog.atom.io/2014/04/25/ci-for-your-packages.html)
and [AppVeyor CI For Your Packages](http://blog.atom.io/2014/07/28/windows-ci-for-your-packages.html)
posts for more details.
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
# Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
+5 -1
Ver Arquivo
@@ -12,10 +12,14 @@
}
// style the background and foreground colors on the atom-text-editor-element
// itself
atom-text-editor {
}
atom-text-editor .cursor {
// To style other content in the text editor's shadow DOM, use the ::shadow
// expression
atom-text-editor::shadow .cursor {
}
+31 -29
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.168.0",
"version": "0.173.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -17,23 +17,24 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.20.4",
"atomShellVersion": "0.20.5",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^2.3.3",
"atom-keymap": "^2.5.2",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
"coffee-script": "1.8.0",
"coffeestack": "0.8.0",
"color": "^0.7.3",
"delegato": "^1",
"emissary": "^1.3.1",
"event-kit": "^1.0.1",
"first-mate": "^2.2.3",
"first-mate": "^2.2.4",
"fs-plus": "^2.3.2",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^2.2",
"grim": "1.0.0",
"grim": "1.1.0",
"guid": "0.0.10",
"jasmine-json": "~0.0",
"jasmine-tagged": "^1.1.2",
@@ -45,21 +46,22 @@
"nslog": "^1.0.1",
"oniguruma": "^3.0.4",
"optimist": "0.4.0",
"pathwatcher": "^2.3.7",
"pathwatcher": "^2.5.0",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"react-atom-fork": "^0.11.1",
"react-atom-fork": "^0.11.4",
"reactionary-atom-fork": "^1.0.0",
"runas": "1.0.1",
"scandal": "1.0.3",
"scoped-property-store": "^0.16.2",
"scrollbar-style": "^1.0.2",
"season": "^1.0.2",
"season": "^5.0.5",
"semver": "2.2.1",
"serializable": "^1",
"service-hub": "^0.1.0",
"space-pen": "3.8.2",
"stacktrace-parser": "0.1.1",
"temp": "0.7.0",
"text-buffer": "^3.8.4",
"theorist": "^1.0.2",
@@ -68,22 +70,22 @@
},
"packageDependencies": {
"atom-dark-syntax": "0.23.0",
"atom-dark-ui": "0.42.0",
"atom-dark-ui": "0.43.0",
"atom-light-syntax": "0.24.0",
"atom-light-ui": "0.36.0",
"atom-light-ui": "0.37.0",
"base16-tomorrow-dark-theme": "0.23.0",
"base16-tomorrow-light-theme": "0.6.0",
"solarized-dark-syntax": "0.30.0",
"solarized-light-syntax": "0.17.0",
"archive-view": "0.43.0",
"autocomplete": "0.40.0",
"autocomplete": "0.42.0",
"autoflow": "0.20.0",
"autosave": "0.19.0",
"background-tips": "0.20.0",
"bookmarks": "0.33.0",
"bracket-matcher": "0.67.0",
"command-palette": "0.32.0",
"deprecation-cop": "0.22.0",
"deprecation-cop": "0.28.0",
"dev-live-reload": "0.36.0",
"encoding-selector": "0.14.0",
"exception-reporting": "0.21.0",
@@ -95,20 +97,20 @@
"image-view": "0.46.0",
"incompatible-packages": "0.19.0",
"keybinding-resolver": "0.25.0",
"link": "0.28.0",
"markdown-preview": "0.116.0",
"link": "0.29.0",
"markdown-preview": "0.117.0",
"metrics": "0.40.0",
"notifications": "0.23.0",
"open-on-github": "0.31.0",
"notifications": "0.24.0",
"open-on-github": "0.32.0",
"package-generator": "0.36.0",
"release-notes": "0.45.0",
"settings-view": "0.165.0",
"snippets": "0.66.0",
"settings-view": "0.172.0",
"snippets": "0.67.0",
"spell-check": "0.49.0",
"status-bar": "0.56.0",
"styleguide": "0.39.0",
"status-bar": "0.57.0",
"styleguide": "0.41.0",
"symbols-view": "0.77.0",
"tabs": "0.61.0",
"tabs": "0.62.0",
"timecop": "0.26.0",
"tree-view": "0.147.0",
"update-package-dependencies": "0.7.0",
@@ -119,13 +121,13 @@
"language-clojure": "0.10.0",
"language-coffee-script": "0.39.0",
"language-css": "0.26.0",
"language-gfm": "0.59.0",
"language-gfm": "0.62.0",
"language-git": "0.10.0",
"language-go": "0.20.0",
"language-go": "0.21.0",
"language-html": "0.28.0",
"language-hyperlink": "0.12.2",
"language-java": "0.14.0",
"language-javascript": "0.53.0",
"language-javascript": "0.54.0",
"language-json": "0.11.0",
"language-less": "0.24.0",
"language-make": "0.13.0",
@@ -134,17 +136,17 @@
"language-perl": "0.10.0",
"language-php": "0.20.0",
"language-property-list": "0.8.0",
"language-python": "0.29.0",
"language-python": "0.30.0",
"language-ruby": "0.47.0",
"language-ruby-on-rails": "0.18.0",
"language-sass": "0.30.0",
"language-sass": "0.31.0",
"language-shellscript": "0.12.0",
"language-source": "0.9.0",
"language-sql": "0.13.0",
"language-text": "0.6.0",
"language-todo": "0.15.0",
"language-toml": "0.15.0",
"language-xml": "0.26.0",
"language-xml": "0.27.0",
"language-yaml": "0.22.0"
},
"private": true,
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 284 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 628 KiB

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

Antes

Largura:  |  Altura:  |  Tamanho: 141 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 182 KiB

+76
Ver Arquivo
@@ -1060,6 +1060,9 @@ describe "Config", ->
type: 'integer'
default: 12
expect(atom.config.getSchema('foo.baz')).toBeUndefined()
expect(atom.config.getSchema('foo.bar.anInt.baz')).toBeUndefined()
it "respects the schema for scoped settings", ->
schema =
type: 'string'
@@ -1287,6 +1290,79 @@ describe "Config", ->
atom.config.set 'foo.bar', ['2', '3', '4']
expect(atom.config.get('foo.bar')).toEqual [2, 3, 4]
describe 'when the value has a "color" type', ->
beforeEach ->
schema =
type: 'color'
default: 'white'
atom.config.setSchema('foo.bar.aColor', schema)
it 'returns a Color object', ->
color = atom.config.get('foo.bar.aColor')
expect(color.toHexString()).toBe '#ffffff'
expect(color.toRGBAString()).toBe 'rgba(255, 255, 255, 1)'
color.red = 0
color.green = 0
color.blue = 0
color.alpha = 0
atom.config.set('foo.bar.aColor', color)
color = atom.config.get('foo.bar.aColor')
expect(color.toHexString()).toBe '#000000'
expect(color.toRGBAString()).toBe 'rgba(0, 0, 0, 0)'
color.red = 300
color.green = -200
color.blue = -1
color.alpha = 'not see through'
atom.config.set('foo.bar.aColor', color)
color = atom.config.get('foo.bar.aColor')
expect(color.toHexString()).toBe '#ff0000'
expect(color.toRGBAString()).toBe 'rgba(255, 0, 0, 1)'
it 'coerces various types to a color object', ->
atom.config.set('foo.bar.aColor', 'red')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 0, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', '#020')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 34, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', '#abcdef')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 171, green: 205, blue: 239, alpha: 1}
atom.config.set('foo.bar.aColor', 'rgb(1,2,3)')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 1, green: 2, blue: 3, alpha: 1}
atom.config.set('foo.bar.aColor', 'rgba(4,5,6,.7)')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 4, green: 5, blue: 6, alpha: .7}
atom.config.set('foo.bar.aColor', 'hsl(120,100%,50%)')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 255, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', 'hsla(120,100%,50%,0.3)')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 255, blue: 0, alpha: .3}
atom.config.set('foo.bar.aColor', {red: 100, green: 255, blue: 2, alpha: .5})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 100, green: 255, blue: 2, alpha: .5}
atom.config.set('foo.bar.aColor', {red: 255})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 0, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', {red: 1000})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 0, blue: 0, alpha: 1}
atom.config.set('foo.bar.aColor', {red: 'dark'})
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 0, green: 0, blue: 0, alpha: 1}
it 'reverts back to the default value when undefined is passed to set', ->
atom.config.set('foo.bar.aColor', undefined)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
it 'will not set non-colors', ->
atom.config.set('foo.bar.aColor', null)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
atom.config.set('foo.bar.aColor', 'nope')
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
atom.config.set('foo.bar.aColor', 30)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
atom.config.set('foo.bar.aColor', false)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
describe 'when the `enum` key is used', ->
beforeEach ->
schema =
@@ -0,0 +1,5 @@
class TestItem
getUri: -> "test"
exports.activate = ->
atom.workspace.addOpener -> new TestItem
@@ -0,0 +1 @@
styleSheets: ['2', '1']
@@ -1 +1 @@
stylesheets: ['2', '1']
styleSheets: ['2', '1']
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["first.css", "second.less", "last.css"]
"styleSheets": ["first.css", "second.less", "last.css"]
}
+1
Ver Arquivo
@@ -1,2 +1,3 @@
module.exports = ->
emit("some-event", 1, 2, 3)
'hello'
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+8 -8
Ver Arquivo
@@ -9,14 +9,14 @@ describe "Package", ->
spyOn(atom, 'inDevMode').andReturn(false)
it "does not activate it", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module')
pack = new Package(packagePath)
expect(pack.isCompatible()).toBe false
expect(pack.incompatibleModules[0].name).toBe 'native-module'
expect(pack.incompatibleModules[0].path).toBe path.join(packagePath, 'node_modules', 'native-module')
it "caches the incompatible native modules in local storage", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module')
cacheKey = null
cacheItem = null
@@ -46,14 +46,14 @@ describe "Package", ->
describe "when the theme contains a single style file", ->
it "loads and applies css", ->
expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px"
themePath = atom.project.resolve('packages/theme-with-index-css')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-css')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "1234px"
it "parses, loads and applies less", ->
expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px"
themePath = atom.project.resolve('packages/theme-with-index-less')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-less')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "4321px"
@@ -64,7 +64,7 @@ describe "Package", ->
expect($("atom-text-editor").css("padding-right")).not.toBe("102px")
expect($("atom-text-editor").css("padding-bottom")).not.toBe("103px")
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe("101px")
@@ -77,7 +77,7 @@ describe "Package", ->
expect($("atom-text-editor").css("padding-right")).not.toBe "20px"
expect($("atom-text-editor").css("padding-bottom")).not.toBe "30px"
themePath = atom.project.resolve('packages/theme-without-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-without-package-file')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "10px"
@@ -86,7 +86,7 @@ describe "Package", ->
describe "reloading a theme", ->
beforeEach ->
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
@@ -97,7 +97,7 @@ describe "Package", ->
describe "events", ->
beforeEach ->
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
+1 -1
Ver Arquivo
@@ -129,7 +129,7 @@ describe "PaneContainer", ->
beforeEach ->
class TestItem
shouldPromptToSave: -> true
getUri: -> 'test'
getURI: -> 'test'
container = new PaneContainer
container.getRoot().splitRight()
+1 -1
Ver Arquivo
@@ -16,7 +16,7 @@ describe "PaneContainerView", ->
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
getURI: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other?.name
onDidChangeTitle: -> new Disposable(->)
+12 -12
Ver Arquivo
@@ -9,7 +9,7 @@ describe "Pane", ->
class Item extends Model
@deserialize: ({name, uri}) -> new this(name, uri)
constructor: (@name, @uri) ->
getUri: -> @uri
getURI: -> @uri
getPath: -> @path
serialize: -> {deserializer: 'Item', @name, @uri}
isEqual: (other) -> @name is other?.name
@@ -231,18 +231,18 @@ describe "Pane", ->
expect(pane.getActiveItem()).toBe item1
describe "if the item is modified", ->
itemUri = null
itemURI = null
beforeEach ->
item1.shouldPromptToSave = -> true
item1.save = jasmine.createSpy("save")
item1.saveAs = jasmine.createSpy("saveAs")
item1.getUri = -> itemUri
item1.getURI = -> itemURI
describe "if the [Save] option is selected", ->
describe "when the item has a uri", ->
it "saves the item before destroying it", ->
itemUri = "test"
itemURI = "test"
spyOn(atom, 'confirm').andReturn(0)
pane.destroyItem(item1)
@@ -252,7 +252,7 @@ describe "Pane", ->
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", ->
itemUri = null
itemURI = null
spyOn(atom, 'showSaveDialogSync').andReturn("/selected/path")
spyOn(atom, 'confirm').andReturn(0)
@@ -404,15 +404,15 @@ describe "Pane", ->
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "::itemForUri(uri)", ->
it "returns the item for which a call to .getUri() returns the given uri", ->
describe "::itemForURI(uri)", ->
it "returns the item for which a call to .getURI() returns the given uri", ->
pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C"), new Item("D")])
[item1, item2, item3] = pane.getItems()
item1.uri = "a"
item2.uri = "b"
expect(pane.itemForUri("a")).toBe item1
expect(pane.itemForUri("b")).toBe item2
expect(pane.itemForUri("bogus")).toBeUndefined()
expect(pane.itemForURI("a")).toBe item1
expect(pane.itemForURI("b")).toBe item2
expect(pane.itemForURI("bogus")).toBeUndefined()
describe "::moveItem(item, index)", ->
[pane, item1, item2, item3, item4] = []
@@ -589,7 +589,7 @@ describe "Pane", ->
[item1, item2] = pane.getItems()
item1.shouldPromptToSave = -> true
item1.getUri = -> "/test/path"
item1.getURI = -> "/test/path"
item1.save = jasmine.createSpy("save")
spyOn(atom, 'confirm').andReturn(0)
@@ -604,7 +604,7 @@ describe "Pane", ->
[item1, item2] = pane.getItems()
item1.shouldPromptToSave = -> true
item1.getUri = -> "/test/path"
item1.getURI = -> "/test/path"
item1.save = jasmine.createSpy("save")
spyOn(atom, 'confirm').andReturn(1)
+1 -1
Ver Arquivo
@@ -15,7 +15,7 @@ describe "PaneView", ->
initialize: ({@id, @text}) ->
@emitter = new Emitter
serialize: -> { deserializer: 'TestView', @id, @text }
getUri: -> @id
getURI: -> @id
isEqual: (other) -> other? and @id == other.id and @text == other.text
changeTitle: ->
@emitter.emit 'did-change-title', 'title'
+2 -23
Ver Arquivo
@@ -8,7 +8,7 @@ BufferedProcess = require '../src/buffered-process'
describe "Project", ->
beforeEach ->
atom.project.setPaths([atom.project.resolve('dir')])
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
describe "serialization", ->
deserializedProject = null
@@ -109,7 +109,7 @@ describe "Project", ->
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
it "returns number of read bytes as progress indicator", ->
filePath = atom.project.resolve 'a'
filePath = atom.project.getDirectories()[0]?.resolve 'a'
totalBytes = 0
promise = atom.project.open(filePath)
promise.progress (bytesRead) -> totalBytes = bytesRead
@@ -148,27 +148,6 @@ describe "Project", ->
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 atom.project's root", ->
absolutePath = require.resolve('./fixtures/dir/a')
expect(atom.project.resolve('a')).toBe absolutePath
expect(atom.project.resolve(absolutePath + '/../a')).toBe absolutePath
expect(atom.project.resolve('a/../a')).toBe absolutePath
expect(atom.project.resolve()).toBeUndefined()
describe "when passed a uri with a scheme", ->
it "does not modify uris that begin with a scheme", ->
expect(atom.project.resolve('http://zombo.com')).toBe 'http://zombo.com'
describe "when the project has no path", ->
it "returns undefined for relative URIs", ->
atom.project.setPaths([])
expect(atom.project.resolve('test.txt')).toBeUndefined()
expect(atom.project.resolve('http://github.com')).toBe 'http://github.com'
absolutePath = fs.absolute(__dirname)
expect(atom.project.resolve(absolutePath)).toBe absolutePath
describe ".setPaths(path)", ->
describe "when path is a file", ->
it "sets its path to the files parent directory and updates the root directory", ->
+1
Ver Arquivo
@@ -119,6 +119,7 @@ beforeEach ->
"package-with-broken-package-json", "package-with-broken-keymap"]
config.set "editor.useShadowDOM", true
advanceClock(1000)
window.setTimeout.reset()
config.load.reset()
config.save.reset()
+23
Ver Arquivo
@@ -20,3 +20,26 @@ describe "Task", ->
expect(handlerResult).toBe 'hello'
expect(childProcess.kill).toHaveBeenCalled()
expect(processErrored).toBe false
it "calls listeners registered with ::on when events are emitted in the task", ->
task = new Task(require.resolve('./fixtures/task-spec-handler'))
eventSpy = jasmine.createSpy('eventSpy')
task.on("some-event", eventSpy)
waitsFor (done) -> task.start(done)
runs ->
expect(eventSpy).toHaveBeenCalledWith(1, 2, 3)
it "unregisters listeners when the Disposable returned by ::on is disposed", ->
task = new Task(require.resolve('./fixtures/task-spec-handler'))
eventSpy = jasmine.createSpy('eventSpy')
disposable = task.on("some-event", eventSpy)
disposable.dispose()
waitsFor (done) -> task.start(done)
runs ->
expect(eventSpy).not.toHaveBeenCalled()
+47 -31
Ver Arquivo
@@ -429,7 +429,7 @@ describe "TextEditorComponent", ->
it "excludes the null byte from character measurement", ->
editor.setText("a\0b")
nextAnimationFrame()
expect(editor.pixelPositionForScreenPosition([0, Infinity]).left).toEqual 2 * charWidth
expect(wrapperNode.pixelPositionForScreenPosition([0, Infinity]).left).toEqual 2 * charWidth
describe "when there is a fold", ->
it "renders a fold marker on the folded line", ->
@@ -552,14 +552,29 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
expect(lineNumbersNode.style.backgroundColor).toBe 'rgb(255, 0, 0)'
describe "when the editor.showLineNumbers config is false", ->
it "doesn't render any line numbers", ->
expect(component.refs.gutter).toBeDefined()
atom.config.set("editor.showLineNumbers", false)
expect(component.refs.gutter).not.toBeDefined()
atom.config.set("editor.showLineNumbers", true)
expect(component.refs.gutter).toBeDefined()
expect(component.lineNumberNodeForScreenRow(3)).toBeDefined()
it "hides or shows the gutter based on the '::isGutterVisible' property on the model and the global 'editor.showLineNumbers' config setting", ->
expect(component.refs.gutter?).toBe true
editor.setGutterVisible(false)
nextAnimationFrame()
expect(component.refs.gutter?).toBe false
atom.config.set("editor.showLineNumbers", false)
expect(nextAnimationFrame).toBe noAnimationFrame
expect(component.refs.gutter?).toBe false
editor.setGutterVisible(true)
expect(nextAnimationFrame).toBe noAnimationFrame
expect(component.refs.gutter?).toBe false
atom.config.set("editor.showLineNumbers", true)
nextAnimationFrame()
expect(component.refs.gutter?).toBe true
expect(component.lineNumberNodeForScreenRow(3)?).toBe true
describe "fold decorations", ->
describe "rendering fold decorations", ->
@@ -801,7 +816,7 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
cursorNode = componentNode.querySelector('.cursor')
{left} = editor.pixelPositionForScreenPosition([1, 10])
{left} = wrapperNode.pixelPositionForScreenPosition([1, 10])
expect(cursorNode.style['-webkit-transform']).toBe "translate(#{left}px, #{editor.getLineHeightInPixels()}px)"
describe "selection rendering", ->
@@ -895,7 +910,7 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
selectionNode = componentNode.querySelector('.region')
expect(selectionNode.offsetTop).toBe editor.getLineHeightInPixels()
expect(selectionNode.offsetLeft).toBe editor.pixelPositionForScreenPosition([1, 6]).left
expect(selectionNode.offsetLeft).toBe wrapperNode.pixelPositionForScreenPosition([1, 6]).left
it "will flash the selection when flash:true is passed to editor::setSelectedBufferRange", ->
editor.setSelectedBufferRange([[1, 6], [1, 10]], flash: true)
@@ -1230,7 +1245,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1240,7 +1255,7 @@ describe "TextEditorComponent", ->
editor.moveRight()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 7])
position = wrapperNode.pixelPositionForBufferPosition([2, 7])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1251,7 +1266,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 10])
position = wrapperNode.pixelPositionForBufferPosition([2, 10])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1262,7 +1277,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1273,7 +1288,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', position: 'tail', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1303,7 +1318,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 26])
position = wrapperNode.pixelPositionForBufferPosition([0, 26])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1312,7 +1327,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 27])
position = wrapperNode.pixelPositionForBufferPosition([0, 27])
expect(overlay.style.left).toBe position.left - itemWidth + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1322,7 +1337,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([4, 0])
position = wrapperNode.pixelPositionForBufferPosition([4, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1331,7 +1346,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([5, 0])
position = wrapperNode.pixelPositionForBufferPosition([5, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top - itemHeight + 'px'
@@ -1353,7 +1368,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 2])
position = wrapperNode.pixelPositionForBufferPosition([0, 2])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1362,7 +1377,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 3])
position = wrapperNode.pixelPositionForBufferPosition([0, 3])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1372,7 +1387,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([1, 0])
position = wrapperNode.pixelPositionForBufferPosition([1, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1381,7 +1396,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 0])
position = wrapperNode.pixelPositionForBufferPosition([2, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1394,7 +1409,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 28])
position = wrapperNode.pixelPositionForBufferPosition([0, 28])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1403,7 +1418,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 29])
position = wrapperNode.pixelPositionForBufferPosition([0, 29])
expect(overlay.style.left).toBe position.left - itemWidth + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1414,7 +1429,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([6, 0])
position = wrapperNode.pixelPositionForBufferPosition([6, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1423,7 +1438,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([7, 0])
position = wrapperNode.pixelPositionForBufferPosition([7, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top - itemHeight + 'px'
@@ -2502,7 +2517,8 @@ describe "TextEditorComponent", ->
describe "when the 'mini' property is true", ->
beforeEach ->
component.setProps(mini: true)
editor.setMini(true)
nextAnimationFrame()
it "does not render the gutter", ->
expect(componentNode.querySelector('.gutter')).toBeNull()
@@ -2751,14 +2767,14 @@ describe "TextEditorComponent", ->
event
clientCoordinatesForScreenPosition = (screenPosition) ->
positionOffset = editor.pixelPositionForScreenPosition(screenPosition)
positionOffset = wrapperNode.pixelPositionForScreenPosition(screenPosition)
scrollViewClientRect = componentNode.querySelector('.scroll-view').getBoundingClientRect()
clientX = scrollViewClientRect.left + positionOffset.left - editor.getScrollLeft()
clientY = scrollViewClientRect.top + positionOffset.top - editor.getScrollTop()
{clientX, clientY}
clientCoordinatesForScreenRowInGutter = (screenRow) ->
positionOffset = editor.pixelPositionForScreenPosition([screenRow, 1])
positionOffset = wrapperNode.pixelPositionForScreenPosition([screenRow, 1])
gutterClientRect = componentNode.querySelector('.gutter').getBoundingClientRect()
clientX = gutterClientRect.left + positionOffset.left - editor.getScrollLeft()
clientY = gutterClientRect.top + positionOffset.top - editor.getScrollTop()
+24 -3
Ver Arquivo
@@ -10,16 +10,21 @@ describe "TextEditorElement", ->
jasmineContent = document.body.querySelector('#jasmine-content')
describe "instantiation", ->
it "honors the mini attribute", ->
it "honors the 'mini' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor mini>"
element = jasmineContent.firstChild
expect(element.getModel().isMini()).toBe true
it "honors the placeholder-text attribute", ->
it "honors the 'placeholder-text' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor placeholder-text='testing'>"
element = jasmineContent.firstChild
expect(element.getModel().getPlaceholderText()).toBe 'testing'
it "honors the 'gutter-hidden' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor gutter-hidden>"
element = jasmineContent.firstChild
expect(element.getModel().isGutterVisible()).toBe false
it "honors the text content", ->
jasmineContent.innerHTML = "<atom-text-editor>testing</atom-text-editor>"
element = jasmineContent.firstChild
@@ -98,6 +103,22 @@ describe "TextEditorElement", ->
document.body.focus()
expect(blurCalled).toBe true
describe "when focused while a parent node is being attached to the DOM", ->
class ElementThatFocusesChild extends HTMLDivElement
attachedCallback: ->
@firstChild.focus()
document.registerElement("element-that-focuses-child",
prototype: ElementThatFocusesChild.prototype
)
it "proxies the focus event to the hidden input", ->
element = new TextEditorElement
parentElement = document.createElement("element-that-focuses-child")
parentElement.appendChild(element)
jasmineContent.appendChild(parentElement)
expect(element.shadowRoot.activeElement).toBe element.shadowRoot.querySelector('input')
describe "when the themes finish loading", ->
[themeReloadCallback, initialThemeLoadComplete, element] = []
@@ -107,7 +128,7 @@ describe "TextEditorElement", ->
spyOn(atom.themes, 'isInitialLoadComplete').andCallFake ->
initialThemeLoadComplete
spyOn(atom.themes, 'onDidReloadAll').andCallFake (fn) ->
spyOn(atom.themes, 'onDidChangeActiveThemes').andCallFake (fn) ->
themeReloadCallback = fn
atom.config.set("editor.useShadowDOM", false)
+9
Ver Arquivo
@@ -944,6 +944,15 @@ describe "TextEditor", ->
editor.undo()
expect(editor.getScrollTop()).toBe 0
describe '.logCursorScope()', ->
beforeEach ->
spyOn(atom.notifications, 'addInfo')
it 'opens a notification', ->
editor.logCursorScope()
expect(atom.notifications.addInfo).toHaveBeenCalled()
describe "selection", ->
selection = null
+27 -27
Ver Arquivo
@@ -73,54 +73,54 @@ describe "ThemeManager", ->
describe "when the core.themes config value changes", ->
it "add/removes stylesheets to reflect the new config value", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
spyOn(atom.styles, 'getUserStyleSheetPath').andCallFake -> null
waitsForPromise ->
themeManager.activateThemes()
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
atom.config.set('core.themes', [])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
expect($('style.theme')).toHaveLength 0
atom.config.set('core.themes', ['atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
atom.config.set('core.themes', ['atom-light-ui', 'atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
expect($('style[priority=1]:eq(1)').attr('source-path')).toMatch /atom-light-ui/
atom.config.set('core.themes', [])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
# atom-dark-ui has an directory path, the syntax one doesn't
atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
expect($('style[priority=1]')).toHaveLength 2
@@ -130,7 +130,7 @@ describe "ThemeManager", ->
it 'adds theme-* classes to the workspace for each active theme', ->
workspaceElement = atom.views.getView(atom.workspace)
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
waitsForPromise ->
themeManager.activateThemes()
@@ -138,11 +138,11 @@ describe "ThemeManager", ->
runs ->
expect(workspaceElement).toHaveClass 'theme-atom-dark-ui'
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
didChangeActiveThemesHandler.callCount > 0
runs ->
# `theme-` twice as it prefixes the name with `theme-`
@@ -170,7 +170,7 @@ describe "ThemeManager", ->
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
cssPath = atom.project.resolve('css.css')
cssPath = atom.project.getDirectories()[0]?.resolve('css.css')
lengthBefore = $('head style').length
themeManager.requireStylesheet(cssPath)
@@ -194,7 +194,7 @@ describe "ThemeManager", ->
$('head style[id*="css.css"]').remove()
it "synchronously loads and parses less files at the given path and installs a style tag for it in the head", ->
lessPath = atom.project.resolve('sample.less')
lessPath = atom.project.getDirectories()[0]?.resolve('sample.less')
lengthBefore = $('head style').length
themeManager.requireStylesheet(lessPath)
expect($('head style').length).toBe lengthBefore + 1
@@ -218,9 +218,9 @@ describe "ThemeManager", ->
it "supports requiring css and less stylesheets without an explicit extension", ->
themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'css')
expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(atom.project.resolve('css.css'))
expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('css.css'))
themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'sample')
expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(atom.project.resolve('sample.less'))
expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('sample.less'))
$('head style[id*="css.css"]').remove()
$('head style[id*="sample.less"]').remove()
@@ -259,11 +259,11 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it "loads the correct values from the theme's ui-variables file", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
didChangeActiveThemesHandler.callCount > 0
runs ->
# an override loaded in the base css
@@ -276,11 +276,11 @@ describe "ThemeManager", ->
describe "when there is a theme with incomplete variables", ->
it "loads the correct values from the fallback ui-variables", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-incomplete-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
didChangeActiveThemesHandler.callCount > 0
runs ->
# an override loaded in the base css
@@ -362,7 +362,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI and syntax themes and logs a warning', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(console.warn.callCount).toBe 2
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
@@ -380,7 +380,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the enabled themes', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-light-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
@@ -393,7 +393,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI and syntax themes', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
@@ -406,7 +406,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI theme', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
expect(activeThemeNames).toContain('atom-light-syntax')
@@ -419,7 +419,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark syntax theme', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-light-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
+8
Ver Arquivo
@@ -169,6 +169,14 @@ describe "Window", ->
$("<a href='#scroll-me'>link</a>").appendTo(document.body).click().remove()
expect(shell.openExternal).not.toHaveBeenCalled()
describe "when a form is submitted", ->
it "prevents the default so that the window's URL isn't changed", ->
submitSpy = jasmine.createSpy('submit')
$(document).on('submit', 'form', submitSpy)
$("<form>foo</form>").appendTo(document.body).submit().remove()
expect(submitSpy.callCount).toBe 1
expect(submitSpy.argsForCall[0][0].isDefaultPrevented()).toBe true
describe "core:focus-next and core:focus-previous", ->
describe "when there is no currently focused element", ->
it "focuses the element with the lowest/highest tabindex", ->
+35 -19
Ver Arquivo
@@ -6,12 +6,13 @@ platform = require './spec-helper-platform'
_ = require 'underscore-plus'
fstream = require 'fstream'
fs = require 'fs-plus'
Grim = require 'grim'
describe "Workspace", ->
workspace = null
beforeEach ->
atom.project.setPaths([atom.project.resolve('dir')])
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
atom.workspace = workspace = new Workspace
describe "::open(uri, options)", ->
@@ -70,19 +71,19 @@ describe "Workspace", ->
expect(openEvents).toEqual [
{
uri: atom.project.resolve('a')
uri: atom.project.getDirectories()[0]?.resolve('a')
item: editor1
pane: atom.workspace.getActivePane()
index: 0
}
{
uri: atom.project.resolve('b')
uri: atom.project.getDirectories()[0]?.resolve('b')
item: editor2
pane: atom.workspace.getActivePane()
index: 1
}
{
uri: atom.project.resolve('a')
uri: atom.project.getDirectories()[0]?.resolve('a')
item: editor1
pane: atom.workspace.getActivePane()
index: 0
@@ -96,7 +97,7 @@ describe "Workspace", ->
workspace.open('a').then (o) -> editor = o
runs ->
expect(editor.getUri()).toBe atom.project.resolve('a')
expect(editor.getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(workspace.getActivePaneItem()).toBe editor
expect(workspace.getActivePane().items).toEqual [editor]
expect(workspace.getActivePane().activate).toHaveBeenCalled()
@@ -230,7 +231,7 @@ describe "Workspace", ->
workspace.addOpener(barOpener)
waitsForPromise ->
pathToOpen = atom.project.resolve('a.foo')
pathToOpen = atom.project.getDirectories()[0]?.resolve('a.foo')
workspace.open(pathToOpen, hey: "there").then (item) ->
expect(item).toEqual { foo: pathToOpen, options: {hey: "there"} }
@@ -250,6 +251,21 @@ describe "Workspace", ->
runs ->
expect(newEditorHandler.argsForCall[0][0].textEditor).toBe editor
it "records a deprecation warning on the appropriate package if the item has a ::getUri method instead of ::getURI", ->
jasmine.snapshotDeprecations()
waitsForPromise -> atom.packages.activatePackage('package-with-deprecated-pane-item-method')
waitsForPromise ->
atom.workspace.open("test")
runs ->
deprecations = Grim.getDeprecations()
expect(deprecations.length).toBe 1
expect(deprecations[0].message).toBe "Pane item with class `TestItem` should implement `::getURI` instead of `::getUri`."
expect(deprecations[0].getStacks()[0].metadata.packageName).toBe "package-with-deprecated-pane-item-method"
jasmine.restoreDeprecationsSnapshot()
describe "::reopenItem()", ->
it "opens the uri associated with the last closed pane that isn't currently open", ->
pane = workspace.getActivePane()
@@ -261,21 +277,21 @@ describe "Workspace", ->
runs ->
# does not reopen items with no uri
expect(workspace.getActivePaneItem().getUri()).toBeUndefined()
expect(workspace.getActivePaneItem().getURI()).toBeUndefined()
pane.destroyActiveItem()
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).not.toBeUndefined()
expect(workspace.getActivePaneItem().getURI()).not.toBeUndefined()
# destroy all items
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('file1')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('file1')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('a')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
pane.destroyActiveItem()
# reopens items with uris
@@ -285,20 +301,20 @@ describe "Workspace", ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('a')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
# does not reopen items that are already open
waitsForPromise ->
workspace.open('b')
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('file1')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('file1')
describe "::increase/decreaseFontSize()", ->
it "increases/decreases the font size without going below 1", ->
@@ -568,7 +584,7 @@ describe "Workspace", ->
runs ->
expect(results).toHaveLength(3)
expect(results[0].filePath).toBe atom.project.resolve('a')
expect(results[0].filePath).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(results[0].matches).toHaveLength(3)
expect(results[0].matches[0]).toEqual
matchText: 'aaa'
@@ -585,7 +601,7 @@ describe "Workspace", ->
expect(results.length).toBe 1
{filePath, matches} = results[0]
expect(filePath).toBe atom.project.resolve('a')
expect(filePath).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(matches).toHaveLength 1
expect(matches[0]).toEqual
matchText: '$bill'
@@ -746,10 +762,10 @@ describe "Workspace", ->
[filePath, commentFilePath, sampleContent, sampleCommentContent] = []
beforeEach ->
atom.project.setPaths([atom.project.resolve('../')])
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('../')])
filePath = atom.project.resolve('sample.js')
commentFilePath = atom.project.resolve('sample-with-comments.js')
filePath = atom.project.getDirectories()[0]?.resolve('sample.js')
commentFilePath = atom.project.getDirectories()[0]?.resolve('sample-with-comments.js')
sampleContent = fs.readFileSync(filePath).toString()
sampleCommentContent = fs.readFileSync(commentFilePath).toString()
+6 -6
Ver Arquivo
@@ -13,8 +13,8 @@ describe "WorkspaceView", ->
beforeEach ->
jasmine.snapshotDeprecations()
atom.project.setPaths([atom.project.resolve('dir')])
pathToOpen = atom.project.resolve('a')
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
pathToOpen = atom.project.getDirectories()[0]?.resolve('a')
atom.workspace = new Workspace
atom.workspaceView = atom.views.getView(atom.workspace).__spacePenView
atom.workspaceView.enableKeymap()
@@ -93,11 +93,11 @@ describe "WorkspaceView", ->
editorView2 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(0)').view()
editorView4 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(1)').view()
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
expect(editorView1.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('../sample.js')
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
expect(editorView4.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('../sample.txt')
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
# ensure adjust pane dimensions is called
+2 -2
Ver Arquivo
@@ -280,7 +280,7 @@ class Atom extends Model
deprecate "The atom.syntax global is deprecated. Use atom.grammars instead."
@grammars
@subscribe @packages.onDidActivateAll => @watchThemes()
@subscribe @packages.onDidActivateInitialPackages => @watchThemes()
Project = require './project'
TextBuffer = require 'text-buffer'
@@ -721,7 +721,7 @@ class Atom extends Model
@themes.load()
watchThemes: ->
@themes.onDidReloadAll =>
@themes.onDidChangeActiveThemes =>
# Only reload stylesheets from non-theme packages
for pack in @packages.getActivePackages() when pack.getType() isnt 'theme'
pack.reloadStylesheets?()
+2 -2
Ver Arquivo
@@ -89,7 +89,7 @@ class AutoUpdateManager
dialog.showMessageBox
type: 'info'
buttons: ['OK']
icon: path.join(process.resourcesPath, 'app', 'atom.png')
icon: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
message: 'No update available.'
title: 'No Update Available'
detail: "Version #{@version} is the latest version."
@@ -100,7 +100,7 @@ class AutoUpdateManager
dialog.showMessageBox
type: 'warning'
buttons: ['OK']
icon: path.join(process.resourcesPath, 'app', 'atom.png')
icon: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
message: 'There was an error checking for updates.'
title: 'Update Error'
detail: message
+7
Ver Arquivo
@@ -6,6 +6,11 @@ CSON = require 'season'
fs = require 'fs-plus'
cacheDir = path.join(fs.absolute('~/.atom'), 'compile-cache')
# Use separate compile cache when sudo'ing as root to avoid permission issues
if process.env.USER is 'root' and process.env.SUDO_USER and process.env.SUDO_USER isnt process.env.USER
cacheDir = path.join(cacheDir, 'root')
coffeeCacheDir = path.join(cacheDir, 'coffee')
CSON.setCacheDir(path.join(cacheDir, 'cson'))
@@ -40,11 +45,13 @@ requireCoffeeScript = (module, filePath) ->
module.exports =
cacheDir: cacheDir
register: ->
Object.defineProperty(require.extensions, '.coffee', {
writable: false
value: requireCoffeeScript
})
addPathToCache: (filePath) ->
extension = path.extname(filePath)
if extension is '.coffee'
+89
Ver Arquivo
@@ -0,0 +1,89 @@
_ = require 'underscore-plus'
ParsedColor = null
# Essential: A simple color class returned from {Config::get} when the value
# at the key path is of type 'color'.
module.exports =
class Color
# Essential: Parse a {String} or {Object} into a {Color}.
#
# * `value` A {String} such as `'white'`, `#ff00ff`, or
# `'rgba(255, 15, 60, .75)'` or an {Object} with `red`, `green`, `blue`,
# and `alpha` properties.
#
# Returns a {Color} or `null` if it cannot be parsed.
@parse: (value) ->
return null if _.isArray(value) or _.isFunction(value)
return null unless _.isObject(value) or _.isString(value)
ParsedColor ?= require 'color'
try
parsedColor = new ParsedColor(value)
catch error
return null
new Color(parsedColor.red(), parsedColor.green(), parsedColor.blue(), parsedColor.alpha())
constructor: (red, green, blue, alpha) ->
Object.defineProperties this,
red:
set: (newRed) -> red = parseColor(newRed)
get: -> red
enumerable: true
configurable: false
green:
set: (newGreen) -> green = parseColor(newGreen)
get: -> green
enumerable: true
configurable: false
blue:
set: (newBlue) -> blue = parseColor(newBlue)
get: -> blue
enumerable: true
configurable: false
alpha:
set: (newAlpha) -> alpha = parseAlpha(newAlpha)
get: -> alpha
enumerable: true
configurable: false
@red = red
@green = green
@blue = blue
@alpha = alpha
# Essential: Returns a {String} in the form `'#abcdef'`.
toHexString: ->
"##{numberToHexString(@red)}#{numberToHexString(@green)}#{numberToHexString(@blue)}"
# Essential: Returns a {String} in the form `'rgba(25, 50, 75, .9)'`.
toRGBAString: ->
"rgba(#{@red}, #{@green}, #{@blue}, #{@alpha})"
isEqual: (color) ->
return true if this is color
color = Color.parse(color) unless color instanceof Color
return false unless color?
color.red is @red and color.blue is @blue and color.green is @green and color.alpha is @alpha
clone: -> new Color(@red, @green, @blue, @alpha)
parseColor = (color) ->
color = parseInt(color)
color = 0 if isNaN(color)
color = Math.max(color, 0)
color = Math.min(color, 255)
color
parseAlpha = (alpha) ->
alpha = parseFloat(alpha)
alpha = 1 if isNaN(alpha)
alpha = Math.max(alpha, 0)
alpha = Math.min(alpha, 1)
alpha
numberToHexString = (number) ->
hex = number.toString(16)
hex = "0#{hex}" if number < 10
hex
+33 -4
Ver Arquivo
@@ -8,6 +8,7 @@ async = require 'async'
pathWatcher = require 'pathwatcher'
Grim = require 'grim'
Color = require './color'
ScopedPropertyStore = require 'scoped-property-store'
ScopeDescriptor = require './scope-descriptor'
@@ -216,6 +217,21 @@ ScopeDescriptor = require './scope-descriptor'
# maximum: 11.5
# ```
#
# #### color
#
# Values will be coerced into a {Color} with `red`, `green`, `blue`, and `alpha`
# properties that all have numeric values. `red`, `green`, `blue` will be in
# the range 0 to 255 and `value` will be in the range 0 to 1. Values can be any
# valid CSS color format such as `#abc`, `#abcdef`, `white`,
# `rgb(50, 100, 150)`, and `rgba(25, 75, 125, .75)`.
#
# ```coffee
# config:
# someSetting:
# type: 'color'
# default: 'white'
# ```
#
# ### Other Supported Keys
#
# #### enum
@@ -687,7 +703,7 @@ class Config
schema = @schema
for key in keys
break unless schema?
schema = schema.properties[key]
schema = schema.properties?[key]
schema
# Deprecated: Returns a new {Object} containing all of the global settings and
@@ -872,10 +888,16 @@ class Config
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
if value?
value = _.deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
if value instanceof Color
value = value.clone()
else
value = _.deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
else
value = _.deepClone(defaultValue)
if defaultValue instanceof Color
value = defaultValue.clone()
else
value = _.deepClone(defaultValue)
value
@@ -1103,6 +1125,13 @@ Config.addSchemaEnforcers
else
value
'color':
coerce: (keyPath, value, schema) ->
color = Color.parse(value)
unless color?
throw new Error("Validation failed at #{keyPath}, #{JSON.stringify(value)} cannot be coerced into a color")
color
'*':
coerceMinimumAndMaximum: (keyPath, value, schema) ->
return value unless typeof value is 'number'
+1 -4
Ver Arquivo
@@ -19,7 +19,7 @@ SpecificityCache = {}
#
# ## Context Menu CSON Format
#
# # ```coffee
# ```coffee
# 'atom-workspace': [{label: 'Help', command: 'application:open-documentation'}]
# 'atom-text-editor': [{
# label: 'History',
@@ -180,9 +180,6 @@ class ContextMenuManager
items
# Public: Request a context menu to be displayed.
#
# * `event` A DOM event.
showForEvent: (event) ->
@activeElement = event.target
menuTemplate = @templateForEvent(event)
+3 -4
Ver Arquivo
@@ -594,10 +594,6 @@ class Cursor extends Model
Section: Visibility
###
# Public: If the marker range is empty, the cursor is marked as being visible.
updateVisibility: ->
@setVisible(@marker.getBufferRange().isEmpty())
# Public: Sets whether the cursor is visible.
setVisible: (visible) ->
if @visible != visible
@@ -609,6 +605,9 @@ class Cursor extends Model
# Public: Returns the visibility of the cursor.
isVisible: -> @visible
updateVisibility: ->
@setVisible(@marker.getBufferRange().isEmpty())
###
Section: Comparing to another cursor
###
+4 -1
Ver Arquivo
@@ -232,7 +232,10 @@ class GitRepository
#
# * `path` (optional) {String} path in the repository to get this information
# for, only needed if the repository has submodules.
getOriginUrl: (path) -> @getConfigValue('remote.origin.url', path)
getOriginURL: (path) -> @getConfigValue('remote.origin.url', path)
getOriginUrl: (path) ->
deprecate("Use ::getOriginURL instead.")
@getOriginUrl()
# Public: Returns the upstream branch for the current HEAD, or null if there
# is no upstream branch for the current HEAD.
+1 -1
Ver Arquivo
@@ -8,7 +8,7 @@ module.exports =
class LessCompileCache
Subscriber.includeInto(this)
@cacheDir: path.join(atom.getConfigDirPath(), 'compile-cache', 'less')
@cacheDir: path.join(require('./coffee-cache').cacheDir, 'less')
constructor: ({resourcePath, importPaths}) ->
@lessSearchPaths = [
+5 -5
Ver Arquivo
@@ -23,12 +23,12 @@ LinesComponent = React.createClass
if performedInitialMeasurement
{editor, overlayDecorations, highlightDecorations, scrollHeight, scrollWidth, placeholderText, backgroundColor} = @props
{lineHeightInPixels, defaultCharWidth, scrollViewHeight, scopedCharacterWidthsChangeCount} = @props
{scrollTop, scrollLeft, cursorPixelRects, mini} = @props
{scrollTop, scrollLeft, cursorPixelRects} = @props
style =
height: Math.max(scrollHeight, scrollViewHeight)
width: scrollWidth
WebkitTransform: @getTransform()
backgroundColor: if mini then null else backgroundColor
backgroundColor: if editor.isMini() then null else backgroundColor
div {className: 'lines', style},
div className: 'placeholder-text', placeholderText if placeholderText?
@@ -162,7 +162,7 @@ LinesComponent = React.createClass
@lineNodesByLineId.hasOwnProperty(lineId)
buildLineHTML: (line, screenRow) ->
{mini, showIndentGuide, lineHeightInPixels, lineDecorations, lineWidth} = @props
{showIndentGuide, lineHeightInPixels, lineDecorations, lineWidth} = @props
{tokens, text, lineEnding, fold, isSoftWrapped, indentLevel} = line
classes = ''
@@ -208,7 +208,7 @@ LinesComponent = React.createClass
@buildEndOfLineHTML(line) or '&nbsp;'
buildLineInnerHTML: (line) ->
{mini, showIndentGuide} = @props
{editor, showIndentGuide} = @props
{tokens, text} = line
innerHTML = ""
@@ -217,7 +217,7 @@ LinesComponent = React.createClass
lineIsWhitespaceOnly = firstTrailingWhitespacePosition is 0
for token in tokens
innerHTML += @updateScopeStack(scopeStack, token.scopes)
hasIndentGuide = not mini and showIndentGuide and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly))
hasIndentGuide = not editor.isMini() and showIndentGuide and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly))
innerHTML += token.getValueAsHtml({hasIndentGuide})
innerHTML += @popScope(scopeStack) while scopeStack.length > 0
+4 -4
Ver Arquivo
@@ -268,7 +268,7 @@ class Marker
# Extended: Sets the buffer position of the marker's head.
#
# * `screenRange` The new {Point} to use
# * `bufferPosition` The new {Point} to use
# * `properties` (optional) {Object} properties to associate with the marker.
setHeadBufferPosition: (bufferPosition, properties) ->
@bufferMarker.setHeadPosition(bufferPosition, properties)
@@ -281,7 +281,7 @@ class Marker
# Extended: Sets the screen position of the marker's head.
#
# * `screenRange` The new {Point} to use
# * `screenPosition` The new {Point} to use
# * `properties` (optional) {Object} properties to associate with the marker.
setHeadScreenPosition: (screenPosition, properties) ->
screenPosition = @displayBuffer.clipScreenPosition(screenPosition, properties)
@@ -295,7 +295,7 @@ class Marker
# Extended: Sets the buffer position of the marker's tail.
#
# * `screenRange` The new {Point} to use
# * `bufferPosition` The new {Point} to use
# * `properties` (optional) {Object} properties to associate with the marker.
setTailBufferPosition: (bufferPosition) ->
@bufferMarker.setTailPosition(bufferPosition)
@@ -308,7 +308,7 @@ class Marker
# Extended: Sets the screen position of the marker's tail.
#
# * `screenRange` The new {Point} to use
# * `screenPosition` The new {Point} to use
# * `properties` (optional) {Object} properties to associate with the marker.
setTailScreenPosition: (screenPosition, options) ->
screenPosition = @displayBuffer.clipScreenPosition(screenPosition, options)
+1 -1
Ver Arquivo
@@ -61,7 +61,7 @@ class MenuManager
@pendingUpdateOperation = null
@template = []
atom.keymaps.onDidLoadBundledKeymaps => @loadPlatformItems()
atom.packages.onDidActivateAll => @sortPackagesMenu()
atom.packages.onDidActivateInitialPackages => @sortPackagesMenu()
# Public: Adds the given items to the application menu.
#
+7
Ver Arquivo
@@ -48,3 +48,10 @@ class NotificationManager
###
getNotifications: -> @notifications
###
Section: Managing Notifications
###
clear: ->
@notifications = []
+10 -1
Ver Arquivo
@@ -8,10 +8,14 @@ class Notification
@timestamp = new Date()
@dismissed = true
@dismissed = false if @isDismissable()
@displayed = false
onDidDismiss: (callback) ->
@emitter.on 'did-dismiss', callback
onDidDisplay: (callback) ->
@emitter.on 'did-display', callback
getOptions: -> @options
getType: -> @type
@@ -30,12 +34,17 @@ class Notification
dismiss: ->
return unless @isDismissable() and not @isDismissed()
@dismissed = true
@emitter.emit 'did-dismiss'
@emitter.emit 'did-dismiss', this
isDismissed: -> @dismissed
isDismissable: -> !!@options.dismissable
wasDisplayed: -> @displayed
setDisplayed: (@displayed) ->
@emitter.emit 'did-display', this
getIcon: ->
return @options.icon if @options.icon?
switch @type
+68 -12
Ver Arquivo
@@ -5,7 +5,7 @@ EmitterMixin = require('emissary').Emitter
{Emitter} = require 'event-kit'
fs = require 'fs-plus'
Q = require 'q'
{deprecate} = require 'grim'
Grim = require 'grim'
Package = require './package'
ThemePackage = require './theme-package'
@@ -48,30 +48,76 @@ class PackageManager
Section: Event Subscription
###
# Public: Invoke the given callback when all packages have been activated.
# Public: Invoke the given callback when all packages have been loaded.
#
# * `callback` {Function}
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidLoadInitialPackages: (callback) ->
@emitter.on 'did-load-initial-packages', callback
@emitter.on 'did-load-all', callback # TODO: Remove once deprecated pre-1.0 APIs are gone
onDidLoadAll: (callback) ->
@emitter.on 'did-load-all', callback
Grim.deprecate("Use `::onDidLoadInitialPackages` instead.")
@onDidLoadInitialPackages(callback)
# Public: Invoke the given callback when all packages have been activated.
#
# * `callback` {Function}
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidActivateInitialPackages: (callback) ->
@emitter.on 'did-activate-initial-packages', callback
@emitter.on 'did-activate-all', callback # TODO: Remove once deprecated pre-1.0 APIs are gone
onDidActivateAll: (callback) ->
@emitter.on 'did-activate-all', callback
Grim.deprecate("Use `::onDidActivateInitialPackages` instead.")
@onDidActivateInitialPackages(callback)
# Public: Invoke the given callback when a package is activated.
#
# * `callback` A {Function} to be invoked when a package is activated.
# * `package` The {Package} that was activated.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidActivatePackage: (callback) ->
@emitter.on 'did-activate-package', callback
# Public: Invoke the given callback when a package is deactivated.
#
# * `callback` A {Function} to be invoked when a package is deactivated.
# * `package` The {Package} that was deactivated.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidDeactivatePackage: (callback) ->
@emitter.on 'did-deactivate-package', callback
# Public: Invoke the given callback when a package is loaded.
#
# * `callback` A {Function} to be invoked when a package is loaded.
# * `package` The {Package} that was loaded.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidLoadPackage: (callback) ->
@emitter.on 'did-load-package', callback
# Public: Invoke the given callback when a package is unloaded.
#
# * `callback` A {Function} to be invoked when a package is unloaded.
# * `package` The {Package} that was unloaded.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidUnloadPackage: (callback) ->
@emitter.on 'did-unload-package', callback
on: (eventName) ->
switch eventName
when 'loaded'
deprecate 'Use PackageManager::onDidLoadAll instead'
Grim.deprecate 'Use PackageManager::onDidLoadInitialPackages instead'
when 'activated'
deprecate 'Use PackageManager::onDidActivateAll instead'
Grim.deprecate 'Use PackageManager::onDidActivateInitialPackages instead'
else
deprecate 'PackageManager::on is deprecated. Use event subscription methods instead.'
Grim.deprecate 'PackageManager::on is deprecated. Use event subscription methods instead.'
EmitterMixin::on.apply(this, arguments)
###
@@ -278,7 +324,7 @@ class PackageManager
packagePaths = _.uniq packagePaths, (packagePath) -> path.basename(packagePath)
@loadPackage(packagePath) for packagePath in packagePaths
@emit 'loaded'
@emitter.emit 'did-load-all'
@emitter.emit 'did-load-initial-packages'
loadPackage: (nameOrPath) ->
return pack if pack = @getLoadedPackage(nameOrPath)
@@ -295,6 +341,7 @@ class PackageManager
pack = new Package(packagePath, metadata)
pack.load()
@loadedPackages[pack.name] = pack
@emitter.emit 'did-load-package', pack
return pack
catch error
console.warn "Failed to load package.json '#{path.basename(packagePath)}'", error.stack ? error
@@ -312,16 +359,19 @@ class PackageManager
if pack = @getLoadedPackage(name)
delete @loadedPackages[pack.name]
@emitter.emit 'did-unload-package', pack
else
throw new Error("No loaded package for name '#{name}'")
# Activate all the packages that should be activated.
activate: ->
promises = []
for [activator, types] in @packageActivators
packages = @getLoadedPackagesForTypes(types)
activator.activatePackages(packages)
@emit 'activated'
@emitter.emit 'did-activate-all'
promises = promises.concat(activator.activatePackages(packages))
Q.all(promises).then =>
@emit 'activated'
@emitter.emit 'did-activate-initial-packages'
# another type of package manager can handle other package types.
# See ThemeManager
@@ -329,9 +379,13 @@ class PackageManager
@packageActivators.push([activator, types])
activatePackages: (packages) ->
promises = []
atom.config.transact =>
@activatePackage(pack.name) for pack in packages
for pack in packages
promise = @activatePackage(pack.name)
promises.push(promise) unless pack.hasActivationCommands()
@observeDisabledPackages()
promises
# Activate a single package by name
activatePackage: (name) ->
@@ -340,6 +394,7 @@ class PackageManager
else if pack = @loadPackage(name)
pack.activate().then =>
@activePackages[pack.name] = pack
@emitter.emit 'did-activate-package', pack
pack
else
Q.reject(new Error("Failed to load package '#{name}'"))
@@ -357,3 +412,4 @@ class PackageManager
@setPackageState(pack.name, state) if state = pack.serialize?()
pack.deactivate()
delete @activePackages[pack.name]
@emitter.emit 'did-deactivate-package', pack
+19 -9
Ver Arquivo
@@ -23,8 +23,6 @@ module.exports =
class Package
EmitterMixin.includeInto(this)
@stylesheetsDir: 'stylesheets'
@isBundledPackagePath: (packagePath) ->
if atom.packages.devMode
return false unless atom.packages.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
@@ -44,6 +42,15 @@ class Package
throw error unless ignoreErrors
metadata ?= {}
metadata.name = packageName
if metadata.stylesheetMain?
deprecate("Use the `mainStyleSheet` key instead of `stylesheetMain` in your `package.json`", {packageName})
metadata.mainStyleSheet = metadata.stylesheetMain
if metadata.stylesheets?
deprecate("Use the `styleSheets` key instead of `stylesheets` in your `package.json`", {packageName})
metadata.styleSheets = metadata.stylesheets
metadata
keymaps: null
@@ -233,15 +240,18 @@ class Package
[stylesheetPath, atom.themes.loadStylesheet(stylesheetPath, true)]
getStylesheetsPath: ->
path.join(@path, @constructor.stylesheetsDir)
if fs.isDirectorySync(path.join(@path, 'stylesheets'))
deprecate("Store package style sheets in the `styles/` directory instead of `stylesheets/`", packageName: @name)
path.join(@path, 'stylesheets')
else
path.join(@path, 'styles')
getStylesheetPaths: ->
stylesheetDirPath = @getStylesheetsPath()
if @metadata.stylesheetMain
[fs.resolve(@path, @metadata.stylesheetMain)]
else if @metadata.stylesheets
@metadata.stylesheets.map (name) -> fs.resolve(stylesheetDirPath, name, ['css', 'less', ''])
if @metadata.mainStyleSheet
[fs.resolve(@path, @metadata.mainStyleSheet)]
else if @metadata.styleSheets
@metadata.styleSheets.map (name) -> fs.resolve(stylesheetDirPath, name, ['css', 'less', ''])
else if indexStylesheet = fs.resolve(@path, 'index', ['css', 'less'])
[indexStylesheet]
else
@@ -299,7 +309,7 @@ class Package
if fs.isDirectorySync(path.join(@path, 'scoped-properties'))
settingsDirPath = path.join(@path, 'scoped-properties')
deprecate("Store package settings files in the `settings` directory instead of `scoped-properties`")
deprecate("Store package settings files in the `settings/` directory instead of `scoped-properties/`", packageName: @name)
else
settingsDirPath = path.join(@path, 'settings')
+1 -1
Ver Arquivo
@@ -64,7 +64,7 @@ class PaneContainerView extends View
@getActivePaneView()?.activeView
paneForUri: (uri) ->
atom.views.getView(@model.paneForUri(uri)).__spacePenView
atom.views.getView(@model.paneForURI(uri)).__spacePenView
focusNextPaneView: ->
@model.activateNextPane()
+2 -2
Ver Arquivo
@@ -143,8 +143,8 @@ class PaneContainer extends Model
getActivePaneItem: ->
@getActivePane().getActiveItem()
paneForUri: (uri) ->
find @getPanes(), (pane) -> pane.itemForUri(uri)?
paneForURI: (uri) ->
find @getPanes(), (pane) -> pane.itemForURI(uri)?
paneForItem: (item) ->
@getPanes().find (pane) -> item in pane.getItems()
+47 -9
Ver Arquivo
@@ -41,16 +41,28 @@ class Pane extends Model
# Called by the Serializable mixin during serialization.
serializeParams: ->
if typeof @activeItem?.getURI is 'function'
activeItemURI = @activeItem.getURI()
else if typeof @activeItem?.getUri is 'function'
activeItemURI = @activeItem.getUri()
id: @id
items: compact(@items.map((item) -> item.serialize?()))
activeItemUri: @activeItem?.getUri?()
activeItemURI: activeItemURI
focused: @focused
# Called by the Serializable mixin during deserialization.
deserializeParams: (params) ->
{items, activeItemUri} = params
{items, activeItemURI, activeItemUri} = params
activeItemURI ?= activeItemUri
params.items = compact(items.map (itemState) -> atom.deserializers.deserialize(itemState))
params.activeItem = find params.items, (item) -> item.getUri?() is activeItemUri
params.activeItem = find params.items, (item) ->
if typeof item.getURI is 'function'
itemURI = item.getURI()
else if typeof item.getUri is 'function'
itemURI = item.getUri()
itemURI is activeItemURI
params
getParent: -> @parent
@@ -426,10 +438,17 @@ class Pane extends Model
@destroyItem(item) for item in @getItems() when item isnt @activeItem
promptToSaveItem: (item) ->
return true unless typeof item.getUri is 'function' and item.shouldPromptToSave?()
return true unless item.shouldPromptToSave?()
if typeof item.getURI is 'function'
uri = item.getURI()
else if typeof item.getUri is 'function'
uri = item.getUri()
else
return true
chosen = atom.confirm
message: "'#{item.getTitle?() ? item.getUri()}' has changes, do you want to save them?"
message: "'#{item.getTitle?() ? uri}' has changes, do you want to save them?"
detailedMessage: "Your changes will be lost if you close this item without saving."
buttons: ["Save", "Cancel", "Don't Save"]
@@ -456,7 +475,12 @@ class Pane extends Model
# * `nextAction` (optional) {Function} which will be called after the item is
# successfully saved.
saveItem: (item, nextAction) ->
if item?.getUri?()
if typeof item?.getURI is 'function'
itemURI = item.getURI()
else if typeof item?.getUri is 'function'
itemURI = item.getUri()
if itemURI?
item.save?()
nextAction?()
else
@@ -485,19 +509,33 @@ class Pane extends Model
# none exists.
#
# * `uri` {String} containing a URI.
itemForURI: (uri) ->
find @items, (item) ->
if typeof item.getURI is 'function'
itemUri = item.getURI()
else if typeof item.getUri is 'function'
itemUri = item.getUri()
itemUri is uri
itemForUri: (uri) ->
find @items, (item) -> item.getUri?() is uri
Grim.deprecate("Use `::itemForURI` instead.")
@itemForURI(uri)
# Public: Activate the first item that matches the given URI.
#
# Returns a {Boolean} indicating whether an item matching the URI was found.
activateItemForUri: (uri) ->
if item = @itemForUri(uri)
activateItemForURI: (uri) ->
if item = @itemForURI(uri)
@activateItem(item)
true
else
false
activateItemForUri: (uri) ->
Grim.deprecate("Use `::activateItemForURI` instead.")
@activateItemForURI(uri)
copyActiveItem: ->
if @activeItem?
@activeItem.copy?() ? atom.deserializers.deserialize(@activeItem.serialize())
+9 -12
Ver Arquivo
@@ -139,14 +139,11 @@ class Project extends Model
Grim.deprecate("Use ::getDirectories instead")
@rootDirectory
# Public: Given a uri, this resolves it relative to the project directory. If
# the path is already absolute or if it is prefixed with a scheme, it is
# returned unchanged.
#
# * `uri` The {String} name of the path to convert.
#
# Returns a {String} or undefined if the uri is not missing or empty.
resolve: (uri) ->
Grim.deprecate("Use `Project::getDirectories()[0]?.resolve()` instead")
@resolvePath(uri)
resolvePath: (uri) ->
return unless uri
if uri?.match(/[A-Za-z0-9+-.]+:\/\//) # leave path alone if it has a scheme
@@ -220,14 +217,14 @@ class Project extends Model
#
# Returns a promise that resolves to an {TextEditor}.
open: (filePath, options={}) ->
filePath = @resolve(filePath)
filePath = @resolvePath(filePath)
@bufferForPath(filePath).then (buffer) =>
@buildEditorForBuffer(buffer, options)
# Deprecated
openSync: (filePath, options={}) ->
deprecate("Use Project::open instead")
filePath = @resolve(filePath)
filePath = @resolvePath(filePath)
@buildEditorForBuffer(@bufferForPathSync(filePath), options)
# Retrieves all the {TextBuffer}s in the project; that is, the
@@ -239,14 +236,14 @@ class Project extends Model
# Is the buffer for the given path modified?
isPathModified: (filePath) ->
@findBufferForPath(@resolve(filePath))?.isModified()
@findBufferForPath(@resolvePath(filePath))?.isModified()
findBufferForPath: (filePath) ->
_.find @buffers, (buffer) -> buffer.getPath() == filePath
# Only to be used in specs
bufferForPathSync: (filePath) ->
absoluteFilePath = @resolve(filePath)
absoluteFilePath = @resolvePath(filePath)
existingBuffer = @findBufferForPath(absoluteFilePath) if filePath
existingBuffer ? @buildBufferSync(absoluteFilePath)
@@ -259,7 +256,7 @@ class Project extends Model
#
# Returns a promise that resolves to the {TextBuffer}.
bufferForPath: (filePath) ->
absoluteFilePath = @resolve(filePath)
absoluteFilePath = @resolvePath(filePath)
existingBuffer = @findBufferForPath(absoluteFilePath) if absoluteFilePath
Q(existingBuffer ? @buildBuffer(absoluteFilePath))
+9 -21
Ver Arquivo
@@ -35,25 +35,6 @@ _ = require 'underscore-plus'
#
# callback()
# ```
#
# ## Events
#
# ### task:log
#
# Emitted when console.log is called within the task.
#
# ### task:warn
#
# Emitted when console.warn is called within the task.
#
# ### task:error
#
# Emitted when console.error is called within the task.
#
# ### task:completed
#
# Emitted when the task has succeeded or failed.
#
module.exports =
class Task
Emitter.includeInto(this)
@@ -111,7 +92,7 @@ class Task
handleEvents: ->
@childProcess.removeAllListeners()
@childProcess.on 'message', ({event, args}) =>
@emit(event, args...)
@emit(event, args...) if @childProcess?
# Public: Starts the task.
#
@@ -144,6 +125,14 @@ class Task
throw new Error('Cannot send message to terminated process')
undefined
# Public: Call a function when an event is emitted by the child process
#
# * `eventName` The {String} name of the event to handle.
# * `callback` The {Function} to call when the event is emitted.
#
# Returns a {Disposable} that can be used to stop listening for the event.
on: (eventName, callback) -> Emitter::on.call(this, eventName, callback)
# Public: Forcefully stop the running task.
#
# No more events are emitted once this method is called.
@@ -154,5 +143,4 @@ class Task
@childProcess.kill()
@childProcess = null
@off()
undefined
+29 -27
Ver Arquivo
@@ -48,7 +48,7 @@ TextEditorComponent = React.createClass
render: ->
{focused, showIndentGuide, showLineNumbers, visible} = @state
{editor, mini, cursorBlinkPeriod, cursorBlinkResumeDelay, hostElement, useShadowDOM} = @props
{editor, cursorBlinkPeriod, cursorBlinkResumeDelay, hostElement, useShadowDOM} = @props
maxLineNumberDigits = editor.getLineCount().toString().length
hasSelection = editor.getLastSelection()? and !editor.getLastSelection().isEmpty()
style = {}
@@ -96,7 +96,7 @@ TextEditorComponent = React.createClass
className += ' has-selection' if hasSelection
div {className, style},
if @shouldRenderGutter()
if @gutterVisible
GutterComponent {
ref: 'gutter', onMouseDown: @onGutterMouseDown, lineDecorations,
defaultCharWidth, editor, renderedRowRange, maxLineNumberDigits, scrollViewHeight,
@@ -118,7 +118,7 @@ TextEditorComponent = React.createClass
@scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow,
visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration,
placeholderText, @performedInitialMeasurement, @backgroundColor, cursorPixelRects,
cursorBlinkPeriod, cursorBlinkResumeDelay, mini, useShadowDOM
cursorBlinkPeriod, cursorBlinkResumeDelay, useShadowDOM
}
ScrollbarComponent
@@ -159,9 +159,6 @@ TextEditorComponent = React.createClass
{editor} = @props
Math.max(1, Math.ceil(editor.getHeight() / editor.getLineHeightInPixels()))
shouldRenderGutter: ->
not @props.mini and @state.showLineNumbers
getInitialState: -> {}
getDefaultProps: ->
@@ -185,12 +182,12 @@ TextEditorComponent = React.createClass
@subscribe stylesElement.onDidUpdateStyleElement @onStylesheetsChanged
@subscribe stylesElement.onDidRemoveStyleElement @onStylesheetsChanged
unless atom.themes.isInitialLoadComplete()
@subscribe atom.themes.onDidReloadAll @onAllThemesLoaded
@subscribe atom.themes.onDidChangeActiveThemes @onAllThemesLoaded
@subscribe scrollbarStyle.changes, @refreshScrollbars
@domPollingIntervalId = setInterval(@pollDOM, @domPollingInterval)
@updateParentViewFocusedClassIfNeeded({})
@updateParentViewMiniClassIfNeeded({})
@updateParentViewMiniClass()
@checkForVisibilityChange()
componentWillUnmount: ->
@@ -202,9 +199,6 @@ TextEditorComponent = React.createClass
clearInterval(@domPollingIntervalId)
@domPollingIntervalId = null
componentWillReceiveProps: (newProps) ->
@props.editor.setMini(newProps.mini)
componentDidUpdate: (prevProps, prevState) ->
cursorMoved = @cursorMoved
selectionChanged = @selectionChanged
@@ -214,7 +208,7 @@ TextEditorComponent = React.createClass
if @props.editor.isAlive()
@updateParentViewFocusedClassIfNeeded(prevState)
@updateParentViewMiniClassIfNeeded(prevState)
@updateParentViewMiniClass()
@props.hostElement.__spacePenView.trigger 'cursor:moved' if cursorMoved
@props.hostElement.__spacePenView.trigger 'selection:changed' if selectionChanged
@props.hostElement.__spacePenView.trigger 'editor:display-updated'
@@ -308,8 +302,8 @@ TextEditorComponent = React.createClass
cursorPixelRects
getLineDecorations: (decorationsByMarkerId) ->
{editor, mini} = @props
return {} if mini
{editor} = @props
return {} if editor.isMini()
decorationsByScreenRow = {}
for markerId, decorations of decorationsByMarkerId
@@ -349,8 +343,8 @@ TextEditorComponent = React.createClass
decorationParams = decoration.getProperties()
filteredDecorations[markerId] ?=
id: markerId
startPixelPosition: editor.pixelPositionForScreenPosition(screenRange.start)
endPixelPosition: editor.pixelPositionForScreenPosition(screenRange.end)
startPixelPosition: editor.pixelPositionForScreenPosition(screenRange.start, true)
endPixelPosition: editor.pixelPositionForScreenPosition(screenRange.end, true)
decorations: []
filteredDecorations[markerId].decorations.push decorationParams
filteredDecorations
@@ -368,8 +362,8 @@ TextEditorComponent = React.createClass
decorationParams = decoration.getProperties()
filteredDecorations[markerId] ?=
id: markerId
headPixelPosition: editor.pixelPositionForScreenPosition(headScreenPosition)
tailPixelPosition: editor.pixelPositionForScreenPosition(tailScreenPosition)
headPixelPosition: editor.pixelPositionForScreenPosition(headScreenPosition, true)
tailPixelPosition: editor.pixelPositionForScreenPosition(tailScreenPosition, true)
decorations: []
filteredDecorations[markerId].decorations.push decorationParams
filteredDecorations
@@ -377,6 +371,8 @@ TextEditorComponent = React.createClass
observeEditor: ->
{editor} = @props
@subscribe editor.onDidChange(@onScreenLinesChanged)
@subscribe editor.onDidChangeGutterVisible(@updateGutterVisible)
@subscribe editor.onDidChangeMini(@setMini)
@subscribe editor.observeGrammar(@onGrammarChanged)
@subscribe editor.observeCursors(@onCursorAdded)
@subscribe editor.observeSelections(@onSelectionAdded)
@@ -463,7 +459,7 @@ TextEditorComponent = React.createClass
scopeDescriptor = editor.getRootScopeDescriptor()
subscriptions.add atom.config.observe 'editor.showIndentGuide', scope: scopeDescriptor, @setShowIndentGuide
subscriptions.add atom.config.observe 'editor.showLineNumbers', scope: scopeDescriptor, @setShowLineNumbers
subscriptions.add atom.config.observe 'editor.showLineNumbers', scope: scopeDescriptor, @updateGutterVisible
subscriptions.add atom.config.observe 'editor.scrollSensitivity', scope: scopeDescriptor, @setScrollSensitivity
focused: ->
@@ -881,7 +877,7 @@ TextEditorComponent = React.createClass
@backgroundColor = backgroundColor
@requestUpdate() unless suppressUpdate
if @shouldRenderGutter()
if @refs.gutter?
gutterBackgroundColor = getComputedStyle(@refs.gutter.getDOMNode()).backgroundColor
if gutterBackgroundColor isnt @gutterBackgroundColor
@gutterBackgroundColor = gutterBackgroundColor
@@ -1001,6 +997,16 @@ TextEditorComponent = React.createClass
setShowIndentGuide: (showIndentGuide) ->
@setState({showIndentGuide})
setMini: ->
@updateGutterVisible()
@requestUpdate()
updateGutterVisible: ->
gutterVisible = not @props.editor.isMini() and @props.editor.isGutterVisible() and atom.config.get('editor.showLineNumbers')
if gutterVisible isnt @gutterVisible
@gutterVisible = gutterVisible
@requestUpdate()
# Deprecated
setInvisibles: (invisibles={}) ->
grim.deprecate "Use config.set('editor.invisibles', invisibles) instead"
@@ -1010,9 +1016,6 @@ TextEditorComponent = React.createClass
setShowInvisibles: (showInvisibles) ->
atom.config.set('editor.showInvisibles', showInvisibles)
setShowLineNumbers: (showLineNumbers) ->
@setState({showLineNumbers})
setScrollSensitivity: (scrollSensitivity) ->
if scrollSensitivity = parseInt(scrollSensitivity)
@scrollSensitivity = Math.abs(scrollSensitivity) / 100
@@ -1047,10 +1050,9 @@ TextEditorComponent = React.createClass
@props.hostElement.classList.toggle('is-focused', @state.focused)
@props.rootElement.classList.toggle('is-focused', @state.focused)
updateParentViewMiniClassIfNeeded: (prevProps) ->
if prevProps.mini isnt @props.mini
@props.hostElement.classList.toggle('mini', @props.mini)
@props.rootElement.classList.toggle('mini', @props.mini)
updateParentViewMiniClass: ->
@props.hostElement.classList.toggle('mini', @props.editor.isMini())
@props.rootElement.classList.toggle('mini', @props.editor.isMini())
runScrollBenchmark: ->
unless process.env.NODE_ENV is 'production'
+22 -6
Ver Arquivo
@@ -63,7 +63,8 @@ class TextEditorElement extends HTMLElement
@buildModel() unless @getModel()?
@mountComponent() unless @component?.isMounted()
@component.checkForVisibilityChange()
@focus() if @focusOnAttach
if this is document.activeElement
@focused()
@emitter.emit("did-attach")
detachedCallback: ->
@@ -99,6 +100,7 @@ class TextEditorElement extends HTMLElement
tabLength: 2
softTabs: true
mini: @hasAttribute('mini')
gutterVisible: not @hasAttribute('gutter-hidden')
placeholderText: @getAttribute('placeholder-text')
))
@@ -108,7 +110,6 @@ class TextEditorElement extends HTMLElement
rootElement: @rootElement
stylesElement: @stylesElement
editor: @model
mini: @model.mini
lineOverdrawMargin: @lineOverdrawMargin
useShadowDOM: @useShadowDOM
)
@@ -128,10 +129,7 @@ class TextEditorElement extends HTMLElement
@component = null
focused: ->
if @component?
@component.focused()
else
@focusOnAttach = true
@component?.focused()
blurred: (event) ->
unless @useShadowDOM
@@ -174,6 +172,24 @@ class TextEditorElement extends HTMLElement
getDefaultCharacterWidth: ->
@getModel().getDefaultCharWidth()
# Extended: Converts a buffer position to a pixel position.
#
# * `bufferPosition` An object that represents a buffer position. It can be either
# an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point}
#
# Returns an {Object} with two values: `top` and `left`, representing the pixel position.
pixelPositionForBufferPosition: (bufferPosition) ->
@getModel().pixelPositionForBufferPosition(bufferPosition, true)
# Extended: Converts a screen position to a pixel position.
#
# * `screenPosition` An object that represents a screen position. It can be either
# an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point}
#
# Returns an {Object} with two values: `top` and `left`, representing the pixel positions.
pixelPositionForScreenPosition: (screenPosition) ->
@getModel().pixelPositionForScreenPosition(screenPosition, true)
# Extended: call the given `callback` when the editor is attached to the DOM.
#
# * `callback` {Function}
+5 -5
Ver Arquivo
@@ -127,7 +127,7 @@ class TextEditorView extends View
Object.defineProperty @::, 'lastRenderedScreenRow', get: -> @component.getRenderedRowRange()[1]
Object.defineProperty @::, 'active', get: -> @is(@getPaneView()?.activeView)
Object.defineProperty @::, 'isFocused', get: -> document.activeElement is @element or document.activeElement is @element.component?.refs.input.getDOMNode()
Object.defineProperty @::, 'mini', get: -> @component?.props.mini
Object.defineProperty @::, 'mini', get: -> @model?.isMini()
Object.defineProperty @::, 'component', get: -> @element?.component
afterAttach: (onDom) ->
@@ -174,12 +174,12 @@ class TextEditorView extends View
@model.scrollToCursorPosition()
pixelPositionForBufferPosition: (bufferPosition) ->
deprecate 'Use TextEditor::pixelPositionForBufferPosition instead. You can get the editor via editorView.getModel()'
@model.pixelPositionForBufferPosition(bufferPosition)
deprecate 'Use TextEditorElement::pixelPositionForBufferPosition instead. You can get the editor via editorView.getModel()'
@model.pixelPositionForBufferPosition(bufferPosition, true)
pixelPositionForScreenPosition: (screenPosition) ->
deprecate 'Use TextEditor::pixelPositionForScreenPosition instead. You can get the editor via editorView.getModel()'
@model.pixelPositionForScreenPosition(screenPosition)
deprecate 'Use TextEditorElement::pixelPositionForScreenPosition instead. You can get the editor via editorView.getModel()'
@model.pixelPositionForScreenPosition(screenPosition, true)
appendToLinesView: (view) ->
view.css('position', 'absolute')
+36 -18
Ver Arquivo
@@ -77,7 +77,7 @@ class TextEditor extends Model
'$verticalScrollbarWidth', '$horizontalScrollbarHeight', '$scrollTop', '$scrollLeft',
'manageScrollPosition', toProperty: 'displayBuffer'
constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText}) ->
constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText, @gutterVisible}) ->
super
@emitter = new Emitter
@@ -354,7 +354,7 @@ class TextEditor extends Model
# Immediately calls your callback for each existing cursor.
#
# * `callback` {Function}
# * `selection` {Selection} that was added
# * `cursor` {Cursor} that was added
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
observeCursors: (callback) ->
@@ -515,7 +515,11 @@ class TextEditor extends Model
getBuffer: -> @buffer
# Retrieves the current buffer's URI.
getUri: -> @buffer.getUri()
getURI: -> @buffer.getUri()
getUri: ->
deprecate("Use `::getURI` instead")
@getURI()
# Create an {TextEditor} with its initial state based on this object
copy: ->
@@ -533,9 +537,25 @@ class TextEditor extends Model
if mini isnt @mini
@mini = mini
@updateInvisibles()
@emitter.emit 'did-change-mini', @mini
@mini
isMini: -> @mini
onDidChangeMini: (callback) ->
@emitter.on 'did-change-mini', callback
setGutterVisible: (gutterVisible) ->
unless gutterVisible is @gutterVisible
@gutterVisible = gutterVisible
@emitter.emit 'did-change-gutter-visible', @gutterVisible
@gutterVisible
isGutterVisible: -> @gutterVisible ? true
onDidChangeGutterVisible: (callback) ->
@emitter.on 'did-change-gutter-visible', callback
# Set the number of characters that can be displayed horizontally in the
# editor.
#
@@ -2522,7 +2542,11 @@ class TextEditor extends Model
logCursorScope: ->
scopeDescriptor = @getLastCursor().getScopeDescriptor()
console.log scopeDescriptor.scopes, scopeDescriptor
list = scopeDescriptor.scopes.toString().split(',')
list = list.map (item) -> "* #{item}"
content = "Scopes at Cursor\n#{list.join('\n')}"
atom.notifications.addInfo(content, dismissable: true)
# {Delegates to: DisplayBuffer.tokenForBufferPosition}
tokenForBufferPosition: (bufferPosition) -> @displayBuffer.tokenForBufferPosition(bufferPosition)
@@ -2875,21 +2899,15 @@ class TextEditor extends Model
getLastVisibleScreenRow: ->
@getVisibleRowRange()[1]
# Extended: Converts a buffer position to a pixel position.
#
# * `bufferPosition` An object that represents a buffer position. It can be either
# an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point}
#
# Returns an {Object} with two values: `top` and `left`, representing the pixel positions.
pixelPositionForBufferPosition: (bufferPosition) -> @displayBuffer.pixelPositionForBufferPosition(bufferPosition)
pixelPositionForBufferPosition: (bufferPosition, suppressDeprecation) ->
unless suppressDeprecation
deprecate("This method is deprecated on the model layer. Use `TextEditorElement::pixelPositionForBufferPosition` instead")
@displayBuffer.pixelPositionForBufferPosition(bufferPosition)
# Extended: Converts a screen position to a pixel position.
#
# * `screenPosition` An object that represents a screen position. It can be either
# an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point}
#
# Returns an {Object} with two values: `top` and `left`, representing the pixel positions.
pixelPositionForScreenPosition: (screenPosition) -> @displayBuffer.pixelPositionForScreenPosition(screenPosition)
pixelPositionForScreenPosition: (screenPosition, suppressDeprecation) ->
unless suppressDeprecation
deprecate("This method is deprecated on the model layer. Use `TextEditorElement::pixelPositionForScreenPosition` instead")
@displayBuffer.pixelPositionForScreenPosition(screenPosition)
getSelectionMarkerAttributes: ->
type: 'selection', editorId: @id, invalidate: 'never'
+25 -7
Ver Arquivo
@@ -61,8 +61,13 @@ class ThemeManager
# updating the list of active themes have completed.
#
# * `callback` {Function}
onDidChangeActiveThemes: (callback) ->
@emitter.on 'did-change-active-themes', callback
@emitter.on 'did-reload-all', callback # TODO: Remove once deprecated pre-1.0 APIs are gone
onDidReloadAll: (callback) ->
@emitter.on 'did-reload-all', callback
Grim.deprecate("Use `::onDidChangeActiveThemes` instead.")
@onDidChangeActiveThemes(callback)
# Deprecated: Invoke `callback` when a stylesheet has been added to the dom.
#
@@ -106,7 +111,7 @@ class ThemeManager
on: (eventName) ->
switch eventName
when 'reloaded'
Grim.deprecate 'Use ThemeManager::onDidReloadAll instead'
Grim.deprecate 'Use ThemeManager::onDidChangeActiveThemes instead'
when 'stylesheet-added'
Grim.deprecate 'Use ThemeManager::onDidAddStylesheet instead'
when 'stylesheet-removed'
@@ -132,9 +137,13 @@ class ThemeManager
###
# Public: Get an array of all the loaded theme names.
getLoadedNames: ->
getLoadedThemeNames: ->
theme.name for theme in @getLoadedThemes()
getLoadedNames: ->
Grim.deprecate("Use `::getLoadedThemeNames` instead.")
@getLoadedThemeNames()
# Public: Get an array of all the loaded themes.
getLoadedThemes: ->
pack for pack in @packageManager.getLoadedPackages() when pack.isTheme()
@@ -144,9 +153,13 @@ class ThemeManager
###
# Public: Get an array of all the active theme names.
getActiveNames: ->
getActiveThemeNames: ->
theme.name for theme in @getActiveThemes()
getActiveNames: ->
Grim.deprecate("Use `::getActiveThemeNames` instead.")
@getActiveThemeNames()
# Public: Get an array of all the active themes.
getActiveThemes: ->
pack for pack in @packageManager.getActivePackages() when pack.isTheme()
@@ -195,10 +208,11 @@ class ThemeManager
# the first/top theme to override later themes in the stack.
themeNames.reverse()
# Public: Set the list of enabled themes.
# Set the list of enabled themes.
#
# * `enabledThemeNames` An {Array} of {String} theme names.
setEnabledThemes: (enabledThemeNames) ->
Grim.deprecate("Use `atom.config.set('core.themes', arrayOfThemeNames)` instead")
atom.config.set('core.themes', enabledThemeNames)
###
@@ -322,7 +336,7 @@ class ThemeManager
@reloadBaseStylesheets()
@initialLoadComplete = true
@emit 'reloaded'
@emitter.emit 'did-reload-all'
@emitter.emit 'did-change-active-themes'
deferred.resolve()
deferred.promise
@@ -358,6 +372,10 @@ class ThemeManager
themePaths = []
for themeName in @getEnabledThemeNames()
if themePath = @packageManager.resolvePackagePath(themeName)
themePaths.push(path.join(themePath, Package.stylesheetsDir))
deprecatedPath = path.join(themePath, 'stylesheets')
if fs.isDirectorySync(deprecatedPath)
themePaths.push(deprecatedPath)
else
themePaths.push(path.join(themePath, 'styles'))
themePaths.filter (themePath) -> fs.isDirectorySync(themePath)
+3
Ver Arquivo
@@ -96,6 +96,9 @@ class WindowEventHandler
@subscribe $(document), 'click', 'a', @openLink
# Prevent form submits from changing the current window's URL
@subscribe $(document), 'submit', 'form', (e) -> e.preventDefault()
@subscribe $(document), 'contextmenu', (e) ->
e.preventDefault()
atom.contextMenu.showForEvent(e)
+1 -1
Ver Arquivo
@@ -52,7 +52,7 @@ module.exports =
class WorkspaceView extends View
Delegator.includeInto(this)
@delegatesProperty 'fullScreen', 'destroyedItemUris', toProperty: 'model'
@delegatesProperty 'fullScreen', 'destroyedItemURIs', toProperty: 'model'
@delegatesMethods 'open', 'openSync',
'saveActivePaneItem', 'saveActivePaneItemAs', 'saveAll', 'destroyActivePaneItem',
'destroyActivePane', 'increaseFontSize', 'decreaseFontSize', toProperty: 'model'
+75 -23
Ver Arquivo
@@ -1,11 +1,14 @@
{deprecate} = require 'grim'
_ = require 'underscore-plus'
{join} = require 'path'
path = require 'path'
{join} = path
{Model} = require 'theorist'
Q = require 'q'
Serializable = require 'serializable'
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
Grim = require 'grim'
fs = require 'fs-plus'
StackTraceParser = require 'stacktrace-parser'
TextEditor = require './text-editor'
PaneContainer = require './pane-container'
Pane = require './pane'
@@ -43,7 +46,7 @@ class Workspace extends Model
@properties
paneContainer: null
fullScreen: false
destroyedItemUris: -> []
destroyedItemURIs: -> []
constructor: (params) ->
super
@@ -202,8 +205,7 @@ class Workspace extends Model
# Essential: Invoke the given callback when the active pane item changes.
#
# * `callback` {Function} to be called when the active pane item changes.
# * `event` {Object} with the following keys:
# * `activeItem` The active pane item.
# * `item` The active pane item.
#
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidChangeActivePaneItem: (callback) -> @paneContainer.onDidChangeActivePaneItem(callback)
@@ -383,9 +385,9 @@ class Workspace extends Model
open: (uri, options={}) ->
searchAllPanes = options.searchAllPanes
split = options.split
uri = atom.project.resolve(uri)
uri = atom.project.resolvePath(uri)
pane = @paneContainer.paneForUri(uri) if searchAllPanes
pane = @paneContainer.paneForURI(uri) if searchAllPanes
pane ?= switch split
when 'left'
@getActivePane().findLeftmostSibling()
@@ -394,7 +396,7 @@ class Workspace extends Model
else
@getActivePane()
@openUriInPane(uri, pane, options)
@openURIInPane(uri, pane, options)
# Open Atom's license in the active pane.
openLicense: ->
@@ -422,9 +424,8 @@ class Workspace extends Model
{initialLine, initialColumn} = options
activatePane = options.activatePane ? true
uri = atom.project.resolve(uri)
item = @getActivePane().itemForUri(uri)
uri = atom.project.resolvePath(uri)
item = @getActivePane().itemForURI(uri)
if uri
item ?= opener(uri, options) for opener in @getOpeners() when !item
item ?= atom.project.openSync(uri, {initialLine, initialColumn})
@@ -434,7 +435,7 @@ class Workspace extends Model
@getActivePane().activate() if activatePane
item
openUriInPane: (uri, pane, options={}) ->
openURIInPane: (uri, pane, options={}) ->
# TODO: Remove deprecated changeFocus option
if options.changeFocus?
deprecate("The `changeFocus` option has been renamed to `activatePane`")
@@ -444,8 +445,8 @@ class Workspace extends Model
activatePane = options.activatePane ? true
if uri?
item = pane.itemForUri(uri)
item ?= opener(atom.project.resolve(uri), options) for opener in @getOpeners() when !item
item = pane.itemForURI(uri)
item ?= opener(uri, options) for opener in @getOpeners() when !item
item ?= atom.project.open(uri, options)
Q(item)
@@ -468,7 +469,7 @@ class Workspace extends Model
#
# Returns a promise that is resolved when the item is opened
reopenItem: ->
if uri = @destroyedItemUris.pop()
if uri = @destroyedItemURIs.pop()
@open(uri)
else
Q()
@@ -476,7 +477,7 @@ class Workspace extends Model
# Deprecated
reopenItemSync: ->
deprecate("Use Workspace::reopenItem instead")
if uri = @destroyedItemUris.pop()
if uri = @destroyedItemURIs.pop()
@openSync(uri)
# Public: Register an opener for a uri.
@@ -496,8 +497,17 @@ class Workspace extends Model
# Returns a {Disposable} on which `.dispose()` can be called to remove the
# opener.
addOpener: (opener) ->
@openers.push(opener)
new Disposable => _.remove(@openers, opener)
packageName = @getCallingPackageName()
wrappedOpener = (uri, options) ->
item = opener(uri, options)
if item? and typeof item.getUri is 'function' and typeof item.getURI isnt 'function'
Grim.deprecate("Pane item with class `#{item.constructor.name}` should implement `::getURI` instead of `::getUri`.", {packageName})
item
@openers.push(wrappedOpener)
new Disposable => _.remove(@openers, wrappedOpener)
registerOpener: (opener) ->
Grim.deprecate("Call Workspace::addOpener instead")
@addOpener(opener)
@@ -509,6 +519,34 @@ class Workspace extends Model
getOpeners: ->
@openers
getCallingPackageName: ->
error = new Error
Error.captureStackTrace(error)
stack = StackTraceParser.parse(error.stack)
packagePaths = @getPackagePathsByPackageName()
for i in [0...stack.length]
stackFramePath = stack[i].file
# Empty when it was run from the dev console
return unless stackFramePath
for packageName, packagePath of packagePaths
continue if stackFramePath is 'node.js'
relativePath = path.relative(packagePath, stackFramePath)
return packageName unless /^\.\./.test(relativePath)
return
getPackagePathsByPackageName: ->
packagePathsByPackageName = {}
for pack in atom.packages.getLoadedPackages()
packagePath = pack.path
if packagePath.indexOf('.atom/dev/packages') > -1 or packagePath.indexOf('.atom/packages') > -1
packagePath = fs.realpathSync(packagePath)
packagePathsByPackageName[pack.name] = packagePath
packagePathsByPackageName
###
Section: Pane Items
###
@@ -554,7 +592,7 @@ class Workspace extends Model
# Save the active pane item.
#
# If the active pane item currently has a URI according to the item's
# `.getUri` method, calls `.save` on the item. Otherwise
# `.getURI` method, calls `.save` on the item. Otherwise
# {::saveActivePaneItemAs} # will be called instead. This method does nothing
# if the active item does not implement a `.save` method.
saveActivePaneItem: ->
@@ -618,8 +656,12 @@ class Workspace extends Model
# * `uri` {String} uri
#
# Returns a {Pane} or `undefined` if no pane exists for the given URI.
paneForURI: (uri) ->
@paneContainer.paneForURI(uri)
paneForUri: (uri) ->
@paneContainer.paneForUri(uri)
deprecate("Use ::paneForURI instead.")
@paneForURI(uri)
# Extended: Get the {Pane} containing the given item.
#
@@ -652,13 +694,23 @@ class Workspace extends Model
# Removes the item's uri from the list of potential items to reopen.
itemOpened: (item) ->
if uri = item.getUri?()
_.remove(@destroyedItemUris, uri)
if typeof item.getURI is 'function'
uri = item.getURI()
else if typeof item.getUri is 'function'
uri = item.getUri()
if uri?
_.remove(@destroyedItemURIs, uri)
# Adds the destroyed item's uri to the list of items to reopen.
didDestroyPaneItem: ({item}) =>
if uri = item.getUri?()
@destroyedItemUris.push(uri)
if typeof item.getURI is 'function'
uri = item.getURI()
else if typeof item.getUri is 'function'
uri = item.getUri()
if uri?
@destroyedItemURIs.push(uri)
# Called by Model superclass when destroyed
destroyed: ->
+9
Ver Arquivo
@@ -12,3 +12,12 @@
background-color: @background-color-selected;
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit; // inherit from themes
}
+8 -1
Ver Arquivo
@@ -23,7 +23,14 @@ window.onload = function() {
};
// Skip "?loadSettings=".
var loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14)));
var rawLoadSettings = decodeURIComponent(location.search.substr(14));
var loadSettings;
try {
loadSettings = JSON.parse(rawLoadSettings);
} catch (error) {
console.error("Failed to parse load settings: " + rawLoadSettings);
throw error;
}
// Normalize to make sure drive letter case is consistent on Windows
process.resourcesPath = path.normalize(process.resourcesPath);
-9
Ver Arquivo
@@ -12,15 +12,6 @@ body {
font-size: @font-size;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: @font-family;
}
atom-workspace {
display: block;
height: 100%;