Comparar commits

...

380 Commits

Autor SHA1 Mensagem Data
simurai efe2b5dcfc 🎨 Rename flexible size class 2015-01-31 11:05:00 +09:00
simurai dc7bcfa8f2 🎨 Remove unused styles 2015-01-30 21:37:58 +09:00
simurai ebad1eeb6a Add badge component
It's now part of core
2015-01-30 19:53:54 +09:00
Ben Ogle b02d0e3df3 Merge pull request #5280 from atom/bo-schema-on-load
Reset all user config values when the schema changes
2015-01-29 18:06:18 -08:00
Ben Ogle d3f29c4580 🎨 Fix wording 2015-01-29 17:54:41 -08:00
Ben Ogle 7263ca8faa 🎨 Fix spec title 2015-01-29 17:54:41 -08:00
Ben Ogle cd812e7a65 Transact on resetting the settings when a schema changes 2015-01-29 17:54:41 -08:00
Ben Ogle 4e6e636b8b 🎨 Reorder args to be consistent with other methods 2015-01-29 17:54:41 -08:00
Ben Ogle 083bafdb33 Handle unschema’d items in objects.
This is required for packages that still use configDefaults
2015-01-29 17:54:41 -08:00
Ben Ogle adbe151c5d Fix up the linter error 2015-01-29 17:54:41 -08:00
Ben Ogle 26b450fe49 🎨 Clean up spec naming 2015-01-29 17:54:41 -08:00
Ben Ogle 5d273d0ee6 Add a bit more coverage to the specs 2015-01-29 17:54:41 -08:00
Ben Ogle b9b2b4bca2 Adhere to the schemas when loading the user’s config 2015-01-29 17:54:41 -08:00
Ben Ogle 79094ee889 Reset all user config values when the schema changes. 2015-01-29 17:54:40 -08:00
Kevin Sawicki d2f485a1ab ⬆️ deprecation-cop@0.34 2015-01-29 16:44:33 -08:00
Kevin Sawicki c12002a0ba ⬆️ bracket-matcher@0.71 2015-01-29 16:41:22 -08:00
Kevin Sawicki e0bac77fa5 ⬆️ season@5.1.2
Closes atom/snippets#101
2015-01-29 11:31:11 -08:00
Kevin Sawicki c4c13375e4 ⬆️ language-todo@0.16 2015-01-29 09:41:06 -08:00
Kevin Sawicki 83f0104c46 Merge pull request #5305 from mnquintana/patch-3
Fix broken npm package.json link in creating-a-package.md
2015-01-29 09:15:11 -08:00
Machiste N. Quintana a0a3c93b1d 📝 Fix broken npm package.json link
In creating-a-package.md
Fixes #5304
2015-01-29 10:52:46 -05:00
Nathan Sobo 98a874808e ⬆️ react-atom-fork for @bolinfest's changes 2015-01-29 08:24:00 -07:00
Ben Ogle e7b790c5b9 Merge pull request #5300 from nextPrime/patch-1
http://github.com -> https://github.com
2015-01-28 18:45:27 -08:00
nextPrime 4988293400 http://github.com -> https://github.com
Change http://github.com to https://github.com to avoid plaintext HTTP connections.
2015-01-28 21:17:29 -05:00
Kevin Sawicki 0d51c3b871 ⬆️ apm@0.133 2015-01-28 16:42:13 -08:00
Kevin Sawicki 8316183fa0 ⬇️ apm@0.131 2015-01-28 16:37:43 -08:00
simurai 8e617ff4e2 📝 Update Shadow DOM selector 2015-01-29 09:27:17 +09:00
Kevin Sawicki 3ca5495690 Merge pull request #5279 from paulcbetts/patch-1
Enable DirectWrite
2015-01-28 16:11:15 -08:00
Kevin Sawicki 5c47ae0cbc ⬆️ apm@0.132 2015-01-28 16:05:31 -08:00
Cheng Zhao 6a86a00c66 Merge pull request #5282 from atom/chrome40
Upgrade to Chrome40
2015-01-28 15:52:20 -08:00
Cheng Zhao 1abe64e73e styleguide@0.43.0 2015-01-28 14:35:45 -08:00
Cheng Zhao bb9150340d ⬆️ markdown-preview@0.131.0 2015-01-28 14:32:55 -08:00
Cheng Zhao c3f5c43694 ⬆️ link@0.30.0 2015-01-28 14:24:29 -08:00
Cheng Zhao 1678016ae4 ⬆️ image-view@0.48.0 2015-01-28 14:22:43 -08:00
Cheng Zhao f50e402de3 ⬆️ bracket-matcher@0.70.0 2015-01-28 14:20:08 -08:00
Cheng Zhao e6363150dd ⬆️ pathwatcher@3.1.0 2015-01-28 14:16:16 -08:00
Cheng Zhao 5f024bfd69 ⬆️ markdown-preview@0.130.0 2015-01-28 14:06:29 -08:00
Cheng Zhao 76adb58fea ⬆️ scandal@2.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 53d5e61b23 ⬆️ atom-keymap@3.1.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 499c09fc25 ⬆️ first-mate@3.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 7891595fed ⬆️ text-buffer@4.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 604f2a951f ⬆️ scroller-style@2.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao c1b6b716b1 ⬆️ archive-view@0.46.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 4d861a68d1 ⬆️ dev-live-reload@0.41.0 2015-01-28 14:06:15 -08:00
Cheng Zhao a831688ce1 ⬆️ snippets@0.72.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 1cbac24cee ⬆️ tree-view@0.154.0 2015-01-28 14:06:15 -08:00
Cheng Zhao afa5f73094 ⬆️ spell-check@0.54.0 2015-01-28 14:06:15 -08:00
Cheng Zhao a142e23f49 ⬆️ nslog@2.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao f1b7536d06 ⬆️ oniguruma@4.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 397e61a0d8 ⬆️ git-utils@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao af22e45f70 ⬆️ runas@2.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao e6a12530a1 ⬆️ symbols-view@0.81.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 896c98b7a0 ⬆️ pathwatcher@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 3201a05672 ⬆️ apm@0.131.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 93181d8a54 Array::find is undefined in Chrome 40 2015-01-28 14:06:14 -08:00
Cheng Zhao 661f1f822a ⬆️ atom-keymap@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 678306317d ⬆️ text-buffer@3.11.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 8dd5f17609 ⬆️ scrollbar-style@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 13e069b45d ⬆️ scandal@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao e61cc5eb13 ⬆️ tree-view@0.152.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 9e92952ad0 ⬆️ symbols-view@0.80.0 2015-01-28 14:06:14 -08:00
Cheng Zhao a8d778781c ⬆️ snippets@v0.71.0 2015-01-28 14:06:14 -08:00
Cheng Zhao da17679ec7 ⬆️ dev-live-preview@0.40.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 1cf663714e ⬆️ archive-view@0.45.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 05963c4e57 ⬆️ spell-check@0.53.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 965a18f7e2 ⬆️ nslog@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 58c45f87e6 ⬆️ oniguruma@3.1.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 21e609ffac ⬆️ pathwatcher@2.7.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 93befc986f ⬆️ git-utils@2.3.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 3321d77264 ⬆️ runas@1.2.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 84761563f0 ⬆️ apm@0.129.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 014cf19723 ⬆️ atom-shell@0.21.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 2a42ed4aaa ⬆️ markdown-preview@0.129.0 2015-01-28 14:05:17 -08:00
Kevin Sawicki 34b1615782 Lower limit to 175 2015-01-28 12:09:43 -08:00
Kevin Sawicki 87db2760b8 ⬆️ autocomplete@0.44 2015-01-28 09:40:42 -08:00
Max Brunsfeld b4dd0f4f73 ⬆️ language-c 2015-01-28 09:35:20 -08:00
Max Brunsfeld 9d655fd642 ⬆️ language-javascript 2015-01-28 09:12:38 -08:00
Max Brunsfeld 4700edf439 ⬆️ markdown-preview 2015-01-28 08:50:32 -08:00
Cheng Zhao 87c2f4496f 🐧 Set window icon, fixes #5281 2015-01-27 20:34:36 -08:00
Ben Ogle 2741445d95 ⬆️ background-tips@0.22.0 2015-01-27 18:32:32 -08:00
Kevin Sawicki ed90c5e6c2 ⬆️ less-cache@0.21 2015-01-27 17:32:13 -08:00
Kevin Sawicki 0bf2a3f480 ⬆️ apm@0.130 2015-01-27 17:24:03 -08:00
Paul Betts a743e8d058 Enable DirectWrite
Chrome 39 proper now has DirectWrite as the default renderer, which makes a huge difference in text clarity, especially on High DPI monitors.
2015-01-27 14:38:50 -08:00
Kevin Sawicki ddc607c760 ⬆️ tree-view@0.151 2015-01-27 14:30:28 -08:00
Kevin Sawicki cbc8ad1467 Merge pull request #5201 from wyand/master
🍎 try ~/Applications before using mdfind
2015-01-27 14:09:52 -08:00
Kevin Sawicki 1a1eb4380a ⬆️ tabs@0.65 2015-01-27 14:06:28 -08:00
Kevin Sawicki 535b49f60c ⬆️ tree-view@0.150 2015-01-27 13:43:09 -08:00
Kevin Sawicki b5e60f7aa0 ⬆️ spell-check@0.52 2015-01-27 13:33:04 -08:00
Kevin Sawicki ce29060d2d ⬆️ first-mate@2.2.5 2015-01-27 09:30:24 -08:00
Ben Ogle 7d1c23b561 ⬆️ git-diff@0.50.0 2015-01-26 17:39:30 -08:00
Ben Ogle 9e2799db27 ⬆️ status-bar@0.58.0 2015-01-26 15:56:50 -08:00
Daniel Hengeveld 040f6deb1e Merge pull request #5263 from atom/bump-tree-view
⬆️ bump tree view for new sort option
2015-01-26 14:31:53 -08:00
Kevin Sawicki 33d2debf5f Prepare 0.177 2015-01-26 13:59:57 -08:00
Daniel Hengeveld 6de40e21c7 bump tree view to include version with new sort option 2015-01-26 13:05:37 -08:00
Cheng Zhao 6169caa1fb Merge pull request #5235 from atom/atom-shell-v0.20.7
Upgrade to atom-shell v0.20.7
2015-01-26 12:58:06 -08:00
Cheng Zhao b4e25137a2 "screen" is now a browser side module 2015-01-26 11:28:00 -08:00
Cheng Zhao 05aaace387 Do not set window icon, fixes #4811 2015-01-26 11:28:00 -08:00
Cheng Zhao a32daecf5f ⬆️ atom-shell@0.20.7 2015-01-26 11:28:00 -08:00
Kevin Sawicki 6db43d85c4 Remove CI node_modules cleaning 2015-01-26 11:01:42 -08:00
Kevin Sawicki 53e06b8680 Clean out node_modules on Linux CI 2015-01-26 10:44:06 -08:00
Kevin Sawicki 9ab2500970 Clean out node_modules on Windows CI 2015-01-26 10:15:37 -08:00
Kevin Sawicki 697e70d47c ⬆️ apm@0.128 2015-01-26 09:43:42 -08:00
Daniel Hengeveld ffd1f8520c Merge pull request #5240 from mnquintana/less-rename
📝 Rename LESS to Less
2015-01-25 11:48:12 -08:00
Machiste Quintana 9132859757 📝 LESS -> Less 2015-01-24 09:49:53 -05:00
Kevin Sawicki 6af2e1649c ⬆️ legal-eagle@0.9 2015-01-23 13:33:25 -08:00
Kevin Sawicki 0962918a82 ⬆️ timecop@0.28 2015-01-23 11:51:41 -08:00
Kevin Sawicki 6b963a562f Track coffee cache hits correctly 2015-01-23 11:48:19 -08:00
Ben Ogle db41b022c2 Merge pull request #5228 from atom/bo-fix-wait-promise
Make waitsForPromise() work with es6 promises as well as Q promises
2015-01-23 10:33:20 -08:00
Kevin Sawicki d4084b305b ⬆️ season@5.1.1 2015-01-23 09:57:48 -08:00
Kevin Sawicki b81c1f408f Track coffee cache hits/misses 2015-01-23 09:41:26 -08:00
Kevin Sawicki 97bdb84122 ⬆️ season@5.1 2015-01-23 09:41:26 -08:00
Kevin Sawicki 87e8720269 ⬆️ less-cache@0.20 2015-01-23 09:41:26 -08:00
Max Brunsfeld 160c32384c ⬆️ markdown-preview@0.126.0 2015-01-23 08:33:44 -08:00
Ben Ogle 33299ec774 ⬆️ notifications@0.26.0 2015-01-22 18:15:50 -08:00
Max Brunsfeld d4cc549a01 Add jasmine.useRealClock
This is the only way to unmock the _.now function uses
by _.debounce and _.throttle, since package specs don't
necessarily have access to core's copy of underscore-plus

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-22 17:59:18 -08:00
Ben Ogle 76a5da8be8 Make waitsForPromise() work with es6 promises as well as Q promises. 2015-01-22 17:26:15 -08:00
Ben Ogle 0b0cbe11dc 📝 Fix BufferedProcess docs 2015-01-22 17:24:56 -08:00
Nathan Sobo 86d730a3a9 Always forceUpdate when editor component is visible
Fixes #5187. Giving up after 90 minutes on producing a failing test case
because this is all changing soon anyway and getting simpler. I’m
willing to risk this regressing to solve it now and move on.
2015-01-22 17:28:02 -07:00
Kevin Sawicki 99ff482afe ⬆️ apm@0.127 2015-01-22 15:36:04 -08:00
Kevin Sawicki 84be87324e Always deepClone since it supports colors now 2015-01-22 14:41:55 -08:00
Kevin Sawicki d1ecafc69f ⬆️ apm@0.125 2015-01-22 14:12:58 -08:00
Kevin Sawicki 235f602002 Merge pull request #5220 from atom/ks-bundle-one-themes
Bundle the one themes
2015-01-22 14:11:37 -08:00
Kevin Sawicki 1ee4240b7e ⬆️ one-dark-ui@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki a46c4ed30e ⬆️ one-light-syntax@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki 023b9d18e1 ⬆️ one-dark-syntax@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki 5b992d1397 Warm cache with one themes 2015-01-22 13:49:42 -08:00
Kevin Sawicki 1ad25f4a56 Bundle one themes 2015-01-22 13:49:42 -08:00
Kevin Sawicki 4baea35c23 ⬆️ apm@0.124 2015-01-22 11:33:57 -08:00
Kevin Sawicki 63335f6b60 Return Color object when in cloned objects
This adds a custom deepClone that clones any Color objects
correctly.
2015-01-22 10:48:07 -08:00
Nathan Sobo f691c20d68 Revert "Add license override for emoji-images"
This reverts commit 36d28235fa.
2015-01-22 10:58:51 -07:00
Max Brunsfeld 45ca1c6762 Merge pull request #5189 from atom/mb-simpler-auto-indent-on-paste
Preserve relative indentation of pasted lines when auto-indenting
2015-01-22 08:44:18 -08:00
Max Brunsfeld 528267b7d7 Preserve relative indentation of pasted lines when auto-indenting 2015-01-22 08:34:20 -08:00
Max Brunsfeld 5cdeb7bc18 Fix comment for Selection::adjustIndent 2015-01-22 08:34:20 -08:00
Nathan Sobo 36d28235fa Add license override for emoji-images 2015-01-22 08:40:53 -07:00
Dan Wyand 3b13e4f502 🍎 try ~/Applications before using mdfind 2015-01-21 23:01:37 -05:00
Kevin Sawicki f7ecc3e2a3 Don't log npm install warnings
Closes #5194
2015-01-21 17:10:21 -08:00
Kevin Sawicki 89a5469151 📝 Mention apm install --check
Refs atom/apm#265
2015-01-21 15:33:19 -08:00
Kevin Sawicki 77e8f5c9ac ⬆️ markdown-preview@0.125 2015-01-21 13:41:37 -08:00
Kevin Sawicki 1fc597ca22 🎨 2015-01-21 11:23:28 -08:00
Kevin Sawicki 5c62eb0253 ⬆️ wrap-guide@0.31 2015-01-21 11:22:29 -08:00
Kevin Sawicki c378ef0649 Merge pull request #5044 from russlescai/rl-scoped-file-encoding
Allow scoped default File Encoding
2015-01-21 11:22:17 -08:00
Nathan Sobo 12982027f2 ⬆️ release-notes 2015-01-21 12:19:37 -07:00
Kevin Sawicki 36a9e3f76e ⬆️ deprecation-cop@0.33 2015-01-21 11:11:42 -08:00
Kevin Sawicki a9d215970f Remove fs patches that are now fixed in Atom Shell 2015-01-21 10:39:08 -08:00
Kevin Sawicki 0daee2c2c2 Prepare 0.176 2015-01-21 10:12:57 -08:00
Kevin Sawicki f9fe317298 ⬆️ apm@0.123 2015-01-21 09:53:34 -08:00
Max Brunsfeld ce46991600 ⬆️ language-javascript
Fixes #5180
2015-01-21 09:52:17 -08:00
Nathan Sobo e1d9838a28 ⬆️ markdown-preview 2015-01-21 10:46:19 -07:00
Kevin Sawicki 0c057dbbd5 ⬆️ encoding-selector@0.17 2015-01-21 09:23:51 -08:00
Kevin Sawicki aad393618e Merge pull request #5175 from atom/ks-shorten-apm-paths
Shorten apm paths in bundle
2015-01-21 09:23:09 -08:00
Kevin Sawicki ccaffb1c28 Add fall back apm path for dev mode 2015-01-21 09:07:26 -08:00
Kevin Sawicki 47b1d3e90f Use new apm.cmd path 2015-01-21 09:07:26 -08:00
Kevin Sawicki 9df7ea91db Use new apm path on all platforms 2015-01-21 09:07:26 -08:00
Kevin Sawicki 5bf0e53c01 Shorten apm paths on Windows 2015-01-21 09:07:26 -08:00
Nathan Sobo c052b03793 ⬆️ markdown-preview 2015-01-21 10:05:43 -07:00
Nathan Sobo 22cf142473 Add license override for cheerio@0.15.0
Newer versions of the library have the license added, but this is easier
than upgrading for now.
2015-01-21 09:02:25 -07:00
Max Brunsfeld 1d6db875ff ⬆️ text-buffer
To fix exception contributing to #5169
2015-01-21 07:20:50 -08:00
Nathan Sobo b2a71ecd36 ⬆️ packages to fix deprecations 2015-01-21 07:47:29 -07:00
Kevin Sawicki 432b531c07 Include fallback vars when warming less cache 2015-01-20 18:45:14 -08:00
Kevin Sawicki 3190f7578f ⬆️ keybinding-resolve@0.27 2015-01-20 18:02:34 -08:00
Ben Ogle db49d4da31 Merge pull request #5157 from postcasio/da-handle-erofs
Handle EROFS errors when saving
2015-01-20 15:39:19 -08:00
Ben Ogle 9fb1edbc54 Fix inconsistent keybindings in first package guide
Closes #3863
2015-01-20 15:11:39 -08:00
Kevin Sawicki 5a2365cead ⬆️ apm@0.122 2015-01-20 10:14:35 -08:00
Kevin Sawicki 3619e6acaf ⬆️ language-sql@0.14 2015-01-20 10:14:23 -08:00
Kevin Sawicki 936ab1c898 Merge pull request #5118 from nullstyle/fix-addOpener-doc-typo
Fix typo in addOpener doc
2015-01-20 10:03:31 -08:00
Nathan Sobo b961ed416e Merge pull request #5152 from atom/sm-docs-upgrading-syntax-theme
Update atom-text-editor selector example
2015-01-20 09:54:13 -07:00
postcasio 867f920329 Handle EROFS errors when saving 2015-01-20 09:56:00 +00:00
simurai 6f4107fe5d 📝 Update text-editor example 2015-01-20 16:03:47 +09:00
Ben Ogle 323ce940f9 Merge pull request #5143 from avrahamruderman/master
typo
2015-01-19 10:49:34 -08:00
Avi 1fe452776d typo
the the
2015-01-19 22:11:31 +11:00
Scott Fleckenstein d263205a9a 📝 Fix typo in addOpener doc 2015-01-16 18:39:54 -08:00
Nathan Sobo 60970d6cec ⬆️ markdown-preview to debug flaky spec 2015-01-16 16:15:47 -07:00
Kevin Sawicki 32f6ab717e Merge pull request #5117 from rachelmyers/patch-1
Replace the lipstick emoji for formatting changes
2015-01-16 14:16:35 -08:00
Rachel Myers 4f871f1331 s/💄/🎨 as emoji for formatting changes
Fixes #5111
2015-01-16 14:08:33 -08:00
Max Brunsfeld c2107fa9b3 ⬆️ settings-view
For more deprecation fixes
2015-01-16 12:25:17 -08:00
Max Brunsfeld 96d4c1c41b Save config when deprerecated Config::set signature is used 2015-01-16 12:24:32 -08:00
Ben Ogle bac10d60c4 Merge pull request #5114 from atom/bo-readonly
Allow opening of readonly files
2015-01-16 11:41:30 -08:00
Ben Ogle 828b841f17 Roll two whens into one 2015-01-16 11:24:24 -08:00
Ben Ogle 11bda1b47a Add error handling for EBUSY as well 2015-01-16 11:07:32 -08:00
Ben Ogle 2577843e51 Explicitly check if the path to be deserialized is a dir 2015-01-16 10:53:35 -08:00
Max Brunsfeld e0e821e7a4 ⬆️ service-hub@0.2.0 2015-01-16 10:50:47 -08:00
Ben Ogle 93f109fbba Add a better message for EPERM errors. 2015-01-16 10:45:48 -08:00
Ben Ogle 97a55ba8c0 Only check read permission on read 2015-01-16 10:24:19 -08:00
Max Brunsfeld 0a59d13d56 Fix Config::unset with no scope-selector
Closes #5095
2015-01-16 10:23:12 -08:00
Kevin Sawicki 20dbc4cfd3 ⬆️ apm@0.121 2015-01-16 09:47:43 -08:00
Kevin Sawicki 6efaf91ff9 Merge pull request #5086 from atom/ks-deserialize-buffer-error
Check if files are accessible during deserialization
2015-01-16 09:47:01 -08:00
Kevin Sawicki b6b90c0270 💄 2015-01-16 09:33:42 -08:00
Kevin Sawicki d736ebff38 Don't deserialize buffers with inaccessible paths 2015-01-16 09:33:42 -08:00
Kevin Sawicki 0cf180804c 💄 2015-01-16 09:33:42 -08:00
Kevin Sawicki c0c5f46097 📝 Tweak catch comment 2015-01-16 09:33:42 -08:00
Kevin Sawicki 16cc9f76c4 📝 Tweak spec description 2015-01-16 09:33:42 -08:00
Kevin Sawicki 6ad8aa7e5c Ignore buffer errors when the path is a directory
This would previously cause Atom to fail to launch if a buffer's
serialized path was now a directory on launch.
2015-01-16 09:33:42 -08:00
Kevin Sawicki 67fc2b9af5 ⬆️ pathwatcher@2.6.1 2015-01-16 09:33:42 -08:00
Nathan Sobo b8b58b25da ⬆️ dev-live-reload 2015-01-16 09:38:14 -07:00
simurai 696c795b50 🐛 Fix overflow of mini editors
Issue #4400
2015-01-16 20:12:53 +09:00
Kevin Sawicki 97d697f195 Guard against no cwd when resolving
Refs #5074
2015-01-15 17:02:23 -08:00
Kevin Sawicki 57d020ff65 Ensure resolving paths to open uses strings
Refs #5074
2015-01-15 16:58:08 -08:00
Kevin Sawicki 3e56822968 ⬆️ oniguruma@3.0.6 2015-01-15 16:48:05 -08:00
Max Brunsfeld d46d797f87 ⬆️ snippets@0.70 2015-01-15 16:26:02 -08:00
Max Brunsfeld fa6a826a37 ⬆️ language-gfm 2015-01-15 14:16:41 -08:00
Ben Ogle e598856db5 Fix the version number in the upgrade guide 2015-01-15 14:00:37 -08:00
Ben Ogle 380fee33ef ⬆️ metrics@0.41.0 2015-01-15 14:00:37 -08:00
Kevin Sawicki d524d25a43 Prepare 0.175 2015-01-15 12:56:02 -08:00
Nathan Sobo 2f765974f8 Merge pull request #4169 from atom/upgrading-docs
Add package upgrade guide
2015-01-15 13:07:54 -07:00
Nathan Sobo 28868fdb8c ⬆️ deprecation-cop 2015-01-15 13:04:12 -07:00
Max Brunsfeld 4ce785d12c ⬆️ bookmarks and git-diff
For updated decoration type name
2015-01-15 11:35:46 -08:00
Cheng Zhao 7f8f5203bc ⬆️ grunt-atom-shell-installer@0.20.0 2015-01-15 11:09:14 -08:00
Kevin Sawicki 77fb8ba15b Prepare 0.174 2015-01-15 11:06:45 -08:00
Nathan Sobo 058005afdf ⬆️ markdown-preview 2015-01-15 11:28:41 -07:00
Kevin Sawicki 062072ad87 Add linter emoji 2015-01-15 09:57:38 -08:00
Kevin Sawicki a6a9a9e94b Use skinny arrow to remove lint warning 2015-01-15 09:53:47 -08:00
simurai c024abcc5f 🐛 Fix line-height of the indent-guide
Issue #4279
2015-01-15 20:14:57 +09:00
Nathan Sobo c69f4baa04 Merge pull request #5068 from atom/ns-line-number-decorations
Rename 'gutter' decorations to 'line-number'
2015-01-14 20:04:02 -07:00
Nathan Sobo 5a4cf01083 Move getFirst/LastVisibleScreenRow to the view 2015-01-14 20:02:49 -07:00
Nathan Sobo 49699bddf2 Fix styleSheets manifest key in package.json of fixtures 2015-01-14 19:52:26 -07:00
Nathan Sobo 542ed631e8 Emit deprecation warnings for decorations of type ‘gutter’ 2015-01-14 19:49:46 -07:00
Nathan Sobo 8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -07:00
Nathan Sobo f570a417e6 Allow for styles/ directory in themes in prebuild-less task 2015-01-14 19:49:07 -07:00
Nathan Sobo ae9e1b0416 ⬆️ ui themes to fix imports 2015-01-14 19:36:28 -07:00
Nathan Sobo 08ab5ff650 ⬆️ themes to rename stylesheets directories 2015-01-14 19:26:55 -07:00
Max Brunsfeld c33288f9bb ⬆️ symbols-view 2015-01-14 18:06:46 -08:00
Nathan Sobo 073f9f2a3e ⬆️ spell-check for deprecation fix 2015-01-14 19:06:15 -07:00
Nathan Sobo b6fc7ff1ac ⬆️ dev-live-reload for build error fix 2015-01-14 19:03:04 -07:00
Nathan Sobo 163ee97c73 ⬆️ packages for deprecation fixes 2015-01-14 18:58:56 -07:00
Max Brunsfeld 788b55ee2a ⬆️ git-diff 2015-01-14 17:56:04 -08:00
Max Brunsfeld 3a3a4cd3b2 ⬆️ grammar-selector 2015-01-14 17:52:02 -08:00
Max Brunsfeld 9d01795335 ⬆️ image-view 2015-01-14 17:49:06 -08:00
Nathan Sobo aa0a767e34 ⬆️ packages for deprecation fixes 2015-01-14 18:48:27 -07:00
Nathan Sobo fb4956dde6 Fix deprecated styleSheets manifest key 2015-01-14 18:48:27 -07:00
Nathan Sobo 94cee03335 Provide package name for styles metadata deprecations 2015-01-14 18:48:26 -07:00
Max Brunsfeld 15581c9750 ⬆️ incompatible-packages 2015-01-14 17:45:16 -08:00
Max Brunsfeld 55c8c920f9 ⬆️ keybinding-resolver 2015-01-14 17:43:00 -08:00
Max Brunsfeld 0db20c7cbb ⬆️ notifications@0.25.0 2015-01-14 17:37:50 -08:00
Max Brunsfeld 57e618dec9 ⬆️ package-generator 2015-01-14 17:34:03 -08:00
Max Brunsfeld 206810d5db ⬆️ release-notes 2015-01-14 17:31:04 -08:00
Nathan Sobo 85a2698f67 ⬆️ packages for deprecation fixes 2015-01-14 18:28:08 -07:00
Max Brunsfeld 04a8a6f784 ⬆️ settings-view 2015-01-14 17:26:41 -08:00
Nathan Sobo 5d40916b6c ⬆️ themes for deprecation fixes 2015-01-14 18:20:47 -07:00
Max Brunsfeld 9f73a42cf1 ⬆️ deprecation-cop@0.31.0 2015-01-14 17:19:14 -08:00
Nathan Sobo 75b43b4fa3 ⬆️ archive-view 2015-01-14 18:07:28 -07:00
Max Brunsfeld 19f105e9e7 ⬆️ snippets@0.69.0 2015-01-14 17:07:16 -08:00
Max Brunsfeld f097f6b4f8 ⬆️ deprecation-cop@0.30 2015-01-14 17:06:52 -08:00
Ben Ogle 9fa571bf39 Merge pull request #4906 from atom/bo-better-errors
Better errors
2015-01-14 16:25:01 -08:00
Ben Ogle 5cb18fc7e5 this. -> @ 2015-01-14 16:15:54 -08:00
Ben Ogle 274ae6cd57 Use buffer.getPath not @getPath in project
😬
2015-01-14 16:15:53 -08:00
Ben Ogle 7d3fe78eed Remove Pane require from workspace view specs 2015-01-14 16:15:53 -08:00
Ben Ogle 4ba7182bbf 💄 Inline fileName cause it's used once 2015-01-14 16:15:53 -08:00
Ben Ogle 5fe4476114 ⬆️ text-buffer@3.10.0 2015-01-14 16:15:53 -08:00
Ben Ogle 3dc908c5ff Use eventType from pathwatcher's watch errors in messages 2015-01-14 16:15:53 -08:00
Ben Ogle 2355862101 ⬆️ pathwatcher@2.6.0 2015-01-14 16:15:53 -08:00
Ben Ogle e51e859631 Clean up error messages for keymap.cson
Use the computed path as well
2015-01-14 16:15:53 -08:00
Ben Ogle 6211f7330f Use path name in config error messsages 2015-01-14 16:15:53 -08:00
Ben Ogle 62eac3f8a5 Fix error string when there is a user config error 2015-01-14 16:15:53 -08:00
Ben Ogle ba40706265 Add a notification when the init script can’t be loaded 2015-01-14 16:15:53 -08:00
Ben Ogle 683203a9a1 Attempt to fix theme manager specs
They work for me!
2015-01-14 16:15:53 -08:00
Ben Ogle 3ec3c2b69d Fix theme manager specs 2015-01-14 16:15:53 -08:00
Ben Ogle 1bc2248fc2 Fix config specs 2015-01-14 16:15:53 -08:00
Ben Ogle 4be793f465 Post notifications when the user’s sheet cannot be loaded / parsed 2015-01-14 16:15:53 -08:00
Ben Ogle 3454249b58 Allow ENOENT errors in project.open 2015-01-14 16:15:52 -08:00
Ben Ogle cbd42ac20c Don’t need the pane in workspace.open 2015-01-14 16:15:52 -08:00
Ben Ogle 02e4482def :up_arrow: command-palette@0.33.0 2015-01-14 16:15:52 -08:00
Ben Ogle 2306f16b30 :up_arrow: snippets for better errors 2015-01-14 16:15:52 -08:00
Ben Ogle 9bb6a18d41 Support empty paths 2015-01-14 16:15:52 -08:00
Ben Ogle 85844f03f7 Display better error on unable to watch keycap.cson 2015-01-14 16:15:52 -08:00
Ben Ogle 4b8e98af0c Display a better message when there are config watch errors on startup 2015-01-14 16:15:52 -08:00
Ben Ogle f30992c5f2 Upgrade pathwatcher and text-buffer for error catching 2015-01-14 16:15:52 -08:00
Ben Ogle 4af007dce3 💄 2015-01-14 16:15:52 -08:00
Ben Ogle 1e7da34346 Use code rather than name for custom error 2015-01-14 16:15:52 -08:00
Ben Ogle b8efbedee1 Create a warning notification when buffer has a watch error 2015-01-14 16:15:52 -08:00
Ben Ogle 8435826e8a Remove linter errors 2015-01-14 16:15:52 -08:00
Ben Ogle 16468eb65d Move workspace specs to workspace. 2015-01-14 16:15:52 -08:00
Ben Ogle d5e04e883e Use the error.code and path in the error 2015-01-14 16:15:52 -08:00
Ben Ogle 2f3ce50875 Add large file issue link to large file error 2015-01-14 16:15:51 -08:00
Ben Ogle c20d3a8182 Throw an error when the error is unhandled 2015-01-14 16:15:51 -08:00
Ben Ogle ca1f66d197 Post a notification when the user cannot access a file 2015-01-14 16:15:51 -08:00
Ben Ogle 4138b95146 Remove unnecessary < chars. wtf 2015-01-14 16:15:51 -08:00
Ben Ogle 11d4222c9f Handle error when opening a file that doesn’t exist 2015-01-14 16:15:51 -08:00
Ben Ogle bc454f14e0 Add a warning notification for oversize file open 2015-01-14 16:15:51 -08:00
Kevin Sawicki bc65322da0 Merge pull request #5066 from adrianlee44/patch-1
Fix getOriginUrl calling itself
2015-01-14 15:52:25 -08:00
Adrian Lee 63ad6b1a66 Fix getOriginUrl calling itself 2015-01-14 15:44:59 -08:00
Nathan Sobo 4dd0bf7dab ⬆️ tabs 2015-01-14 16:14:26 -07:00
Nathan Sobo aa7482ac28 ⬆️ deprecation-cop 2015-01-14 16:07:51 -07:00
Nathan Sobo ad1d92d6d9 ⬆️ markdown-preview 2015-01-14 16:02:59 -07:00
Kevin Sawicki 131e7a021a ⬆️ spell-check@0.50 2015-01-14 15:00:53 -08:00
Max Brunsfeld 38e0c39c4a ⬆️ styleguide@0.42.0
For deprecation fixes
2015-01-14 14:27:40 -08:00
Russell Lescai c538857cfa Removed unnecessary braces. 2015-01-15 08:57:25 +10:30
Max Brunsfeld c964e718b7 ⬆️ symbols-view@0.78.0
For deprecation fixes
2015-01-14 14:25:42 -08:00
Max Brunsfeld 2738da2829 ⬆️ tabs@0.63.0
For deprecation fixes
2015-01-14 14:20:58 -08:00
Max Brunsfeld fe36f5f9de ⬆️ timecop@0.27.0
For deprecation fixes
2015-01-14 14:05:40 -08:00
Max Brunsfeld c179e562a7 ⬆️ tree-view@0.148.0
For deprecation fixes
2015-01-14 13:58:28 -08:00
Max Brunsfeld e8ad1aa074 ⬆️ wrap-guide@0.30.0
For deprecation fixes
2015-01-14 13:57:59 -08:00
Nathan Sobo 3f190d67da ⬆️ markdown-preview to fix deprecations 2015-01-14 14:23:55 -07:00
Nathan Sobo e60a9e45f7 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 14:23:17 -07:00
Max Brunsfeld 114b938edf Merge pull request #5060 from atom/mb-fix-folds-with-splits
Fix folds with splits
2015-01-14 13:13:52 -08: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
Max Brunsfeld 0d5a707ffb Fix folding with splits
Fixes #4099

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-14 09:43:20 -08: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
Russell Lescai 6716e544f0 Fix spec it function. 2015-01-14 15:07:42 +10:30
Russell Lescai 2f3a9c9e35 Updated js scope selector. 2015-01-14 14:08:23 +10:30
Russell Lescai 3d1baaf3f3 Added spec. Changed argument order for config get/set. 2015-01-14 13:46:21 +10:30
Russell Lescai b819f681aa Moved setEncoding to TextEditor constructor. 2015-01-14 13:05:20 +10:30
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
Russell Lescai e30b2f1c73 Allow scoped default File Encoding 2015-01-14 11:51:21 +10:30
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
Ben Ogle ab9cc75f8b Add bit about the engines field 2015-01-07 14:04:08 -08:00
Ben Ogle 9fcac1ab1c Add a bit about contributing to the guide 2015-01-07 14:04:08 -08:00
Ben Ogle c172882c15 Package upgrade guide 💄 2015-01-07 14:04:08 -08:00
Ben Ogle bb6446f7d0 Update wording in tldr of guide 2015-01-07 14:04:08 -08:00
Ben Ogle e2609ddd06 New version of atom-space-pen-views 2015-01-07 14:04:07 -08:00
Ben Ogle 7f3e0287eb Add bit about removal of subscribe() in upgrading your View section 2015-01-07 14:04:07 -08:00
Ben Ogle 1bba80c2b2 Add an example of an arg with the emitter 2015-01-07 14:04:07 -08:00
Ben Ogle 0845610595 editorView -> editorElement again 2015-01-07 14:04:07 -08:00
Ben Ogle 2c09321315 💄 2015-01-07 14:04:07 -08:00
Ben Ogle f2d495eab2 Update the guide to have a section on using the model layer. 2015-01-07 14:04:07 -08:00
Ben Ogle 67c193c5ce Update the guide's selectListView upgrade text 2015-01-07 14:04:07 -08:00
Ben Ogle e62485195a Update the docs on TextEditorView 2015-01-07 14:04:07 -08:00
Ben Ogle 1eba8cff39 Update text about attached and detached semantics 2015-01-07 14:04:07 -08:00
Ben Ogle 40b465b0b6 Update deprecation cop summary 2015-01-07 14:04:07 -08:00
Ben Ogle 909ec375b1 Remove unnecessary tos 2015-01-07 14:04:07 -08:00
Ben Ogle a17b504bdb Add missing line to upgrade guide 2015-01-07 14:04:07 -08:00
Ben Ogle 75857bec01 Update items to equal an array 2015-01-07 14:04:07 -08:00
Ben Ogle b8fa3a2127 Cleanup based on @kevinsawicki feedback 2015-01-07 14:04:07 -08:00
Ben Ogle 979fad966d 💄 2015-01-07 14:04:07 -08:00
Ben Ogle d523f9e1ec Add images of deprecations 2015-01-07 14:04:06 -08:00
Ben Ogle f10453ed04 Reword parts of the guide for clarity 2015-01-07 14:04:06 -08:00
Ben Ogle 2743c0ab6f Upgrade versions of atom-space-pen-views 2015-01-07 14:04:06 -08:00
Ben Ogle 2cf5df858f Be more clear about the export from atom-space-pen-views 2015-01-07 14:04:06 -08:00
Ben Ogle dfbb50385d Comment 💄 2015-01-07 14:04:06 -08:00
Ben Ogle e0f6642a9b with -> by 2015-01-07 14:04:06 -08:00
Ben Ogle 87c217c3f6 Fix don’t 2015-01-07 14:04:06 -08:00
Ben Ogle 77aa539e70 Update a bit of the guide 2015-01-07 14:04:06 -08:00
Ben Ogle 13fa424ed5 Add upgrading selectors section to package upgrade guide 2015-01-07 14:04:06 -08:00
Ben Ogle 0ea2a9dc9c Add guide section on subscribing to commands 2015-01-07 14:04:06 -08:00
Ben Ogle e3eadc310d Add guide section about events and the emitter. 2015-01-07 14:04:06 -08:00
Ben Ogle 6520587ba8 Add section about updating specs 2015-01-07 14:04:06 -08:00
Ben Ogle 3bb62b6651 Update converting view section 2015-01-07 14:04:06 -08:00
Ben Ogle e8ab37c207 Update the View Changes section 2015-01-07 14:04:06 -08:00
Ben Ogle 612e972ac6 Add tl;dr section 2015-01-07 14:04:05 -08:00
Ben Ogle 14a20147c6 Add an example 2015-01-07 14:04:05 -08:00
Ben Ogle ed9c62f883 Add a section on converting a SelectListView 2015-01-07 14:04:05 -08:00
Ben Ogle 0239c7d386 Update structure of the docs a bit 2015-01-07 14:04:05 -08:00
Ben Ogle 7a0b8c31d4 Add initial draft of converting your package 2015-01-07 14:04:05 -08:00
85 arquivos alterados com 1909 adições e 474 exclusões
+6 -1
Ver Arquivo
@@ -74,7 +74,7 @@ For more information on how to work with Atom's official packages, see
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally
* Consider starting the commit message with an applicable emoji:
* :lipstick: `:lipstick:` when improving the format/structure of the code
* :art: `:art:` when improving the format/structure of the code
* :racehorse: `:racehorse:` when improving performance
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
* :memo: `:memo:` when writing docs
@@ -88,6 +88,7 @@ For more information on how to work with Atom's official packages, see
* :lock: `:lock:` when dealing with security
* :arrow_up: `:arrow_up:` when upgrading dependencies
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
## CoffeeScript Styleguide
@@ -99,6 +100,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
@@ -1,6 +1,6 @@
![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png)
Atom is a hackable text editor for the 21st century, built on [atom-shell](http://github.com/atom/atom-shell), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Atom is a hackable text editor for the 21st century, built on [atom-shell](https://github.com/atom/atom-shell), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Visit [atom.io](https://atom.io) to learn more or visit the [Atom forum](https://discuss.atom.io).
+1 -1
Ver Arquivo
@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.119.0"
"atom-package-manager": "0.133.0"
}
}
+15 -9
Ver Arquivo
@@ -45,18 +45,24 @@ if [ $REDIRECT_STDERR ]; then
fi
if [ $OS == 'Mac' ]; then
ATOM_PATH="${ATOM_PATH:-/Applications}" # Set ATOM_PATH unless it is already set
ATOM_APP_NAME=Atom.app
# If ATOM_PATH isn't a executable file, use spotlight to search for Atom
if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
fi
if [ -z "${ATOM_PATH}" ]; then
# If ATOM_PATH isnt set, check /Applications and then ~/Applications for Atom.app
if [ -x "/Applications/$ATOM_APP_NAME" ]; then
ATOM_PATH="/Applications"
elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then
ATOM_PATH="$HOME/Applications"
else
# We havent found an Atom.app, use spotlight to search for Atom
ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
# Exit if Atom can't be found
if [ -z "$ATOM_PATH" ]; then
echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app."
exit 1
# Exit if Atom can't be found
if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app."
exit 1
fi
fi
fi
if [ $EXPECT_OUTPUT ]; then
+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':
+4 -4
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.20.0",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
"grunt-contrib-coffee": "~0.12.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.11.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.8.0",
"legal-eagle": "~0.9.0",
"minidump": "~0.8",
"npm": "~1.4.5",
"rcedit": "~0.3.0",
+4 -1
Ver Arquivo
@@ -144,7 +144,10 @@ module.exports = (grunt) ->
cp 'spec', path.join(appDir, 'spec')
cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/
cp 'static', path.join(appDir, 'static')
cp 'apm', path.join(appDir, 'apm'), filter: filterNodeModule
cp path.join('apm', 'node_modules', 'atom-package-manager'), path.join(appDir, 'apm'), filter: filterNodeModule
if process.platform isnt 'win32'
fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.join(appDir, 'apm', 'node_modules', '.bin', 'apm'))
if process.platform is 'darwin'
grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) ->
+4
Ver Arquivo
@@ -35,6 +35,10 @@ module.exports =
MIT/X11
"""
'cheerio@0.15.0':
repository: "https://github.com/cheeriojs/cheerio"
license: 'MIT'
source: 'https://github.com/cheeriojs/cheerio/blob/master/package.json'
'specificity@0.1.3':
repository: 'https://github.com/keeganstreet/specificity'
license: 'MIT'
+1 -1
Ver Arquivo
@@ -10,7 +10,7 @@ module.exports = (grunt) ->
fullPath = path.join(relativePath, fileName)
else
fullPath = fileName
longPaths.push(fullPath) if fullPath.length >= 200
longPaths.push(fullPath) if fullPath.length >= 175
longPaths.sort (longPath1, longPath2) -> longPath2.length - longPath1.length
+36 -3
Ver Arquivo
@@ -1,4 +1,5 @@
path = require 'path'
fs = require 'fs'
LessCache = require 'less-cache'
@@ -7,14 +8,35 @@ module.exports = (grunt) ->
prebuiltConfigurations = [
['atom-dark-ui', 'atom-dark-syntax']
['atom-dark-ui', 'atom-light-syntax']
['atom-dark-ui', 'one-dark-syntax']
['atom-dark-ui', 'one-light-syntax']
['atom-dark-ui', 'solarized-dark-syntax']
['atom-dark-ui', 'base16-tomorrow-dark-theme']
['atom-dark-ui', 'base16-tomorrow-light-theme']
['atom-light-ui', 'atom-light-syntax']
['atom-light-ui', 'atom-dark-syntax']
['atom-light-ui', 'one-dark-syntax']
['atom-light-ui', 'one-light-syntax']
['atom-light-ui', 'solarized-dark-syntax']
['atom-light-ui', 'base16-tomorrow-dark-theme']
['atom-light-ui', 'base16-tomorrow-light-theme']
['one-dark-ui', 'one-dark-syntax']
['one-dark-ui', 'one-light-syntax']
['one-dark-ui', 'atom-dark-syntax']
['one-dark-ui', 'atom-light-syntax']
['one-dark-ui', 'solarized-dark-syntax']
['one-dark-ui', 'base16-tomorrow-dark-theme']
['one-dark-ui', 'base16-tomorrow-light-theme']
['one-light-ui', 'one-light-syntax']
['one-light-ui', 'one-dark-syntax']
['one-light-ui', 'atom-light-syntax']
['one-light-ui', 'atom-dark-syntax']
['one-light-ui', 'solarized-dark-syntax']
['one-light-ui', 'base16-tomorrow-dark-theme']
['one-light-ui', 'base16-tomorrow-light-theme']
]
directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache')
@@ -25,7 +47,10 @@ module.exports = (grunt) ->
for theme in configuration
# TODO Use AtomPackage class once it runs outside of an Atom context
themePath = path.resolve('node_modules', theme)
stylesheetsDir = path.join(themePath, 'stylesheets')
if fs.existsSync(path.join(themePath, 'stylesheets'))
stylesheetsDir = path.join(themePath, 'stylesheets')
else
stylesheetsDir = path.join(themePath, 'styles')
{main} = grunt.file.readJSON(path.join(themePath, 'package.json'))
main ?= 'index.less'
mainPath = path.join(themePath, main)
@@ -38,10 +63,18 @@ module.exports = (grunt) ->
resourcePath: path.resolve('.')
importPaths: importPaths
cssForFile = (file) ->
baseVarImports = """
@import "variables/ui-variables";
@import "variables/syntax-variables";
"""
less = fs.readFileSync(file, 'utf8')
lessCache.cssForFile(file, [baseVarImports, less].join('\n'))
for file in @filesSrc
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
cssForFile(file)
for file in themeMains
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
cssForFile(file)
+1 -1
Ver Arquivo
@@ -45,7 +45,7 @@ the editor to see it in action!
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[Less]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[R]: http://en.wikipedia.org/wiki/R_(programming_language)
[TextMate]: http://macromates.com
+2 -2
Ver Arquivo
@@ -6,7 +6,7 @@ theme.
### Differences
TextMate themes use [plist][plist] files while Atom themes use [CSS][CSS] or
[LESS][LESS] to style the UI and syntax in the editor.
[Less][Less] to style the UI and syntax in the editor.
The utility that converts the theme first parses the theme's plist file and
then creates comparable CSS rules and properties that will style Atom similarly.
@@ -62,7 +62,7 @@ __Syntax Theme__ dropdown menu to enable your new theme.
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[Less]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[TextMate]: http://macromates.com
[TextMateThemes]: http://wiki.macromates.com/Themes/UserSubmittedThemes
+4 -4
Ver Arquivo
@@ -123,8 +123,8 @@ like you.
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
@@ -406,7 +406,7 @@ all the other available commands.
[status-bar]: https://github.com/atom/status-bar
[cs-syntax]: https://github.com/atom/language-coffee-script
[npm]: http://en.wikipedia.org/wiki/Npm_(software)
[npm-keys]: https://npmjs.org/doc/json.html
[npm-keys]: https://docs.npmjs.com/files/package.json
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[wrap-guide]: https://github.com/atom/wrap-guide/
[keymaps]: advanced/keymaps.md
@@ -418,7 +418,7 @@ all the other available commands.
[underscore]: http://underscorejs.org/
[jasmine]: http://jasmine.github.io
[cson]: https://github.com/atom/season
[LESS]: http://lesscss.org
[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
+4 -4
Ver Arquivo
@@ -1,7 +1,7 @@
# Creating a Theme
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
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
@@ -17,7 +17,7 @@ section on the left hand side.
Themes are pretty straightforward but it's still helpful to be familiar with
a few things before starting:
* LESS is a superset of CSS, but it has some really handy features like
* Less is a superset of CSS, but it has some really handy features like
variables. If you aren't familiar with its syntax, take a few minutes
to [familiarize yourself][less-tutorial].
* You may also want to review the concept of a _[package.json]_, too. This file
@@ -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
+3 -3
Ver Arquivo
@@ -169,17 +169,17 @@ For example, to change the color of the cursor, you could add the following
rule to your _~/.atom/styles.less_ file:
```less
atom-text-editor.is-focused .cursor {
atom-text-editor::shadow .cursor {
border-color: pink;
}
```
Unfamiliar with LESS? Read more about it [here][LESS].
Unfamiliar with Less? Read more about it [here][Less].
This file can also be named _styles.css_ and contain CSS.
[creating-a-package]: creating-a-package.md
[create-theme]: creating-a-theme.md
[LESS]: http://www.lesscss.org
[Less]: http://www.lesscss.org
[CSON]: https://github.com/atom/season
[CoffeeScript]: http://coffeescript.org/
+15
Ver Arquivo
@@ -100,6 +100,21 @@ When an error is thrown in Atom, the developer tools are automatically shown wit
If you can reproduce the error, use this approach to get the full stack trace. The stack trace might point to a problem in your [Init script][init script or stylesheet] or a specific package you installed, which you can then disable and report an issue on its GitHub repository.
## Check that you have a build toolchain installed
If you are having issues installing a package using `apm install`, this could be
because the package has dependencies on libraries that contain native code
and so you will need to have a C++ compiler and Python installed to be able to
install it.
You can run `apm install --check` to see if [apm][apm] can build native code on
your machine.
Check out the pre-requisites in the [build instructions][build-instructions] for
your platform for more details.
[apm]: https://github.com/atom/apm
[build-instructions]: https://github.com/atom/atom/tree/master/docs/build-instructions
[submitting issues]: https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues
[building atom]: https://github.com/atom/atom#building
[atom releases]: https://github.com/atom/atom/releases
+1 -1
Ver Arquivo
@@ -34,7 +34,7 @@ files. If you are using Git you can use `cmd-shift-b` to search the list of
files modified and untracked in your project's repository.
You can also use the tree view to navigate to a file. To open and focus the
the tree view, press `ctrl-0`. The tree view can be toggled open and closed with
tree view, press `ctrl-0`. The tree view can be toggled open and closed with
`cmd-\`.
#### Adding, Moving, Deleting Files
+625
Ver Arquivo
@@ -0,0 +1,625 @@
# Upgrading your package to 1.0 APIs
Atom is rapidly approaching 1.0. Much of the effort leading up to the 1.0 has been cleaning up APIs in an attempt to future proof, and make a more pleasant experience developing packages.
This document will guide you through the large bits of upgrading your package to work with 1.0 APIs.
## TL;DR
We've set deprecation messages and errors in strategic places to help make sure you don't miss anything. You should be able to get 95% of the way to an updated package just by fixing errors and deprecations. There are a couple of things you can do to get the full effect of all the errors and deprecations.
### Use atom-space-pen-views
If you use any class from `require 'atom'` with a `$` or `View` in the name, add the `atom-space-pen-views` module to your package's `package.json` file's dependencies:
```js
{
"dependencies": {
"atom-space-pen-views": "^2.0.3"
}
}
```
Then run `apm install` in your package directory.
### Require views from atom-space-pen-views
Anywhere you are requiring one of the following from `atom` you need to require them from `atom-space-pen-views` instead.
```coffee
# require these from 'atom-space-pen-views' rather than 'atom'
$
$$
$$$
View
TextEditorView
ScrollView
SelectListView
```
So this:
```coffee
# Old way
{$, TextEditorView, View, GitRepository} = require 'atom'
```
Would be replaced by this:
```coffee
# New way
{GitRepository} = require 'atom'
{$, TextEditorView, View} = require 'atom-space-pen-views'
```
### Run specs and test your package
You wrote specs, right!? Here's where they shine. Run them with `cmd-shift-P`, and search for `run package specs`. It will show all the deprecation messages and errors.
### Update the engines field in package.json
When you are deprecation free and all done converting, upgrade the `engines` field in your package.json:
```json
{
"engines": {
"atom": ">=0.174.0, <2.0.0"
}
}
```
### Examples
We have upgraded all the core packages. Please see [this issue](https://github.com/atom/atom/issues/4011) for a link to all the upgrade PRs.
## Deprecations
All of the methods in Atom core that have changes will emit deprecation messages when called. These messages are shown in two places: your **package specs**, and in **Deprecation Cop**.
### Specs
Just run your specs, and all the deprecations will be displayed in yellow.
![spec-deps](https://cloud.githubusercontent.com/assets/69169/5637943/b85114ba-95b5-11e4-8681-b81ea8f556d7.png)
### Deprecation Cop
Run an atom window in dev mode (`atom -d`) with your package loaded, and open Deprecation Cop (search for `deprecation` in the command palette). Deprecated methods will be appear in Deprecation Cop only after they have been called.
![dep-cop](https://cloud.githubusercontent.com/assets/69169/5637914/6e702fa2-95b5-11e4-92cc-a236ddacee21.png)
When deprecation cop is open, and deprecated methods are called, a `Refresh` button will appear in the top right of the Deprecation Cop interface. So exercise your package, then come back to Deprecation Cop and click the `Refresh` button.
## Upgrading your Views
Previous to 1.0, views were baked into Atom core. These views were based on jQuery and `space-pen`. They looked something like this:
```coffee
# The old way: getting views from atom
{$, TextEditorView, View} = require 'atom'
module.exports =
class SomeView extends View
@content: ->
@div class: 'find-and-replace', =>
@div class: 'block', =>
@subview 'myEditor', new TextEditorView(mini: true)
#...
```
### The New
`require 'atom'` no longer provides view helpers or jQuery. Atom core is now 'view agnostic'. The preexisting view system is available from a new npm package: `atom-space-pen-views`.
`atom-space-pen-views` now provides jQuery, `space-pen` views, and Atom specific views:
```coffee
# These are now provided by atom-space-pen-views
$
$$
$$$
View
TextEditorView
ScrollView
SelectListView
```
### Adding the module dependencies
To use the new views, you need to specify the `atom-space-pen-views` module in your package's `package.json` file's dependencies:
```js
{
"dependencies": {
"atom-space-pen-views": "^2.0.3"
}
}
```
`space-pen` bundles jQuery. If you do not need `space-pen` or any of the views, you can require jQuery directly.
```js
{
"dependencies": {
"jquery": "^2"
}
}
```
### Converting your views
Sometimes it is as simple as converting the requires at the top of each view page. I assume you read the 'TL;DR' section and have updated all of your requires.
### Upgrading classes extending any space-pen View
#### `afterAttach` and `beforeRemove` updated
The `afterAttach` and `beforeRemove` hooks have been replaced with
`attached` and `detached` and the semantics have changed.
`afterAttach` was called whenever the node was attached to another DOM node, even if that parent node wasn't present in the DOM. `afterAttach` also was called with a boolean indicating whether or not the element and its parents were on the DOM. Now the `attached` hook is _only_ called when the node and all of its parents are actually on the DOM, and is not called with a boolean.
`beforeRemove` was only called when `$.fn.remove` was called, which was typically used when the node was completely removed from the DOM. The new `detached` hook is called whenever the DOM node is _detached_, which could happen if the node is being detached for reattachment later. In short, if `beforeRemove` is called the node is never coming back. With `detached` it might be attached again later.
```coffee
# Old way
{View} = require 'atom'
class MyView extends View
afterAttach: (onDom) ->
#...
beforeRemove: ->
#...
```
```coffee
# New way
{View} = require 'atom-space-pen-views'
class MyView extends View
attached: ->
# Always called with the equivalent of @afterAttach(true)!
#...
detached: ->
#...
```
#### `subscribe` and `subscribeToCommand` methods removed
The `subscribe` and `subscribeToCommand` methods have been removed. See the Eventing and Disposables section for more info.
### Upgrading to the new TextEditorView
All of the atom-specific methods available on the `TextEditorView` have been moved to the `TextEditor`, available via `TextEditorView::getModel`. See the [`TextEditorView` docs][TextEditorView] and [`TextEditor` docs][TextEditor] for more info.
### Upgrading classes extending ScrollView
The `ScrollView` has very minor changes.
You can no longer use `@off` to remove default behavior for `core:move-up`, `core:move-down`, etc.
```coffee
# Old way to turn off default behavior
class ResultsView extends ScrollView
initialize: (@model) ->
super()
# turn off default scrolling behavior from ScrollView
@off 'core:move-up'
@off 'core:move-down'
@off 'core:move-left'
@off 'core:move-right'
```
```coffee
# New way to turn off default behavior
class ResultsView extends ScrollView
initialize: (@model) ->
disposable = super()
# turn off default scrolling behavior from ScrollView
disposable.dispose()
```
* Check out [an example](https://github.com/atom/find-and-replace/pull/311/files#diff-9) from find-and-replace.
* See the [docs][ScrollView] for all the options.
### Upgrading classes extending SelectListView
Your SelectListView might look something like this:
```coffee
# Old!
class CommandPaletteView extends SelectListView
initialize: ->
super()
@addClass('command-palette overlay from-top')
atom.workspaceView.command 'command-palette:toggle', => @toggle()
confirmed: ({name, jQuery}) ->
@cancel()
# do something with the result
toggle: ->
if @hasParent()
@cancel()
else
@attach()
attach: ->
@storeFocusedElement()
items = [] # TODO: build items
@setItems(items)
atom.workspaceView.append(this)
@focusFilterEditor()
confirmed: ({name, jQuery}) ->
@cancel()
```
This attaches and detaches itself from the dom when toggled, canceling magically detaches it from the DOM, and it uses the classes `overlay` and `from-top`.
The new SelectListView no longer automatically detaches itself from the DOM when cancelled. It's up to you to implement whatever cancel beahavior you want. Using the new APIs to mimic the sematics of the old class, it should look like this:
```coffee
# New!
class CommandPaletteView extends SelectListView
initialize: ->
super()
# no more need for the `overlay` and `from-top` classes
@addClass('command-palette')
atom.commands.add 'atom-workspace', 'command-palette:toggle', => @toggle()
# You need to implement the `cancelled` method and hide.
cancelled: ->
@hide()
confirmed: ({name, jQuery}) ->
@cancel()
# do something with the result
toggle: ->
# Toggling now checks panel visibility,
# and hides / shows rather than attaching to / detaching from the DOM.
if @panel?.isVisible()
@cancel()
else
@show()
show: ->
# Now you will add your select list as a modal panel to the workspace
@panel ?= atom.workspace.addModalPanel(item: this)
@panel.show()
@storeFocusedElement()
items = [] # TODO: build items
@setItems(items)
@focusFilterEditor()
hide: ->
@panel?.hide()
```
* And check out the [conversion of CommandPaletteView][selectlistview-example] as a real-world example.
* See the [SelectListView docs][SelectListView] for all options.
## Using the model layer rather than the view layer
The API no longer exposes any specialized view objects or view classes. `atom.workspaceView`, and all the view classes: `WorkspaceView`, `EditorView`, `PaneView`, etc. have been globally deprecated.
Nearly all of the atom-specific actions performed by the old view objects can now be managed via the model layer. For example, here's adding a panel to the interface using the `atom.workspace` model instead of the `workspaceView`:
```coffee
# Old!
div = document.createElement('div')
atom.workspaceView.appendToTop(div)
```
```coffee
# New!
div = document.createElement('div')
atom.workspace.addTopPanel(item: div)
```
For actions that still require the view, such as dispatching commands or munging css classes, you'll access the view via the `atom.views.getView()` method. This will return a subclass of `HTMLElement` rather than a jQuery object or an instance of a deprecated view class (e.g. `WorkspaceView`).
```coffee
# Old!
workspaceView = atom.workspaceView
editorView = workspaceView.getActiveEditorView()
paneView = editorView.getPaneView()
```
```coffee
# New!
# Generally, just use the models
workspace = atom.workspace
editor = workspace.getActiveTextEditor()
pane = editor.getPane()
# If you need views, get them with `getView`
workspaceElement = atom.views.getView(atom.workspace)
editorElement = atom.views.getView(editor)
paneElement = atom.views.getView(pane)
```
## Updating Specs
`atom.workspaceView`, the `WorkspaceView` class and the `EditorView` class have been deprecated. These two objects are used heavily throughout specs, mostly to dispatch events and commands. This section will explain how to remove them while still retaining the ability to dispatch events and commands.
### Removing WorkspaceView references
`WorkspaceView` has been deprecated. Everything you could do on the view, you can now do on the `Workspace` model.
Requiring `WorkspaceView` from `atom` and accessing any methods on it will throw a deprecation warning. Many specs lean heavily on `WorkspaceView` to trigger commands and fetch `EditorView` objects.
Your specs might contain something like this:
```coffee
# Old!
{WorkspaceView} = require 'atom'
describe 'FindView', ->
beforeEach ->
atom.workspaceView = new WorkspaceView()
```
Instead, we will use the `atom.views.getView()` method. This will return a plain `HTMLElement`, not a `WorkspaceView` or jQuery object.
```coffee
# New!
describe 'FindView', ->
workspaceElement = null
beforeEach ->
workspaceElement = atom.views.getView(atom.workspace)
```
### Attaching the workspace to the DOM
The workspace needs to be attached to the DOM in some cases. For example, view hooks only work (`attached()` on `View`, `attachedCallback()` on custom elements) when there is a descendant attached to the DOM.
You might see this in your specs:
```coffee
# Old!
atom.workspaceView.attachToDom()
```
Change it to:
```coffee
# New!
jasmine.attachToDOM(workspaceElement)
```
### Removing EditorView references
Like `WorkspaceView`, `EditorView` has been deprecated. Everything you needed to do on the view you are now able to do on the `TextEditor` model.
In many cases, you will not even need to get the editor's view anymore. Any of those instances should be updated to use the `TextEditor` instance instead. You should really only need the editor's view when you plan on triggering a command on the view in a spec.
Your specs might contain something like this:
```coffee
# Old!
describe 'Something', ->
[editorView] = []
beforeEach ->
editorView = atom.workspaceView.getActiveView()
```
We're going to use `atom.views.getView()` again to get the editor element. As in the case of the `workspaceElement`, `getView` will return a subclass of `HTMLElement` rather than an `EditorView` or jQuery object.
```coffee
# New!
describe 'Something', ->
[editor, editorElement] = []
beforeEach ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
```
### Dispatching commands
Since the `editorElement` objects are no longer `jQuery` objects, they no longer support `trigger()`. Additionally, Atom has a new command dispatcher, `atom.commands`, that we use rather than commandeering jQuery's `trigger` method.
From this:
```coffee
# Old!
workspaceView.trigger 'a-package:toggle'
editorView.trigger 'find-and-replace:show'
```
To this:
```coffee
# New!
atom.commands.dispatch workspaceElement, 'a-package:toggle'
atom.commands.dispatch editorElement, 'find-and-replace:show'
```
## Eventing and Disposables
A couple large things changed with respect to events:
1. All model events are now exposed as event subscription methods that return [`Disposable`][disposable] objects
1. The `subscribe()` method is no longer available on `space-pen` `View` objects
1. An Emitter is now provided from `require 'atom'`
### Consuming Events
All events from the Atom API are now methods that return a [`Disposable`][disposable] object, on which you can call `dispose()` to unsubscribe.
```coffee
# Old!
editor.on 'changed', ->
```
```coffee
# New!
disposable = editor.onDidChange ->
# You can unsubscribe at some point in the future via `dispose()`
disposable.dispose()
```
Deprecation warnings will guide you toward the correct methods.
#### Using a CompositeDisposable
You can group multiple disposables into a single disposable with a `CompositeDisposable`.
```coffee
{CompositeDisposable} = require 'atom'
class Something
constructor: ->
editor = atom.workspace.getActiveTextEditor()
@disposables = new CompositeDisposable
@disposables.add editor.onDidChange ->
@disposables.add editor.onDidChangePath ->
destroy: ->
@disposables.dispose()
```
### Removing View::subscribe and Subscriber::subscribe calls
There were a couple permutations of `subscribe()`. In these examples, a `CompositeDisposable` is used as it will commonly be useful where conversion is necessary.
#### subscribe(unsubscribable)
This one is very straight forward.
```coffee
# Old!
@subscribe editor.on 'changed', ->
```
```coffee
# New!
disposables = new CompositeDisposable
disposables.add editor.onDidChange ->
```
#### subscribe(modelObject, event, method)
When the modelObject is an Atom model object, the change is very simple. Just use the correct event method, and add it to your CompositeDisposable.
```coffee
# Old!
@subscribe editor, 'changed', ->
```
```coffee
# New!
disposables = new CompositeDisposable
disposables.add editor.onDidChange ->
```
#### subscribe(jQueryObject, selector(optional), event, method)
Things are a little more complicated when subscribing to a DOM or jQuery element. Atom no longer provides helpers for subscribing to elements. You can use jQuery or the native DOM APIs, whichever you prefer.
```coffee
# Old!
@subscribe $(window), 'focus', ->
```
```coffee
# New!
{Disposable, CompositeDisposable} = require 'atom'
disposables = new CompositeDisposable
# New with jQuery
focusCallback = ->
$(window).on 'focus', focusCallback
disposables.add new Disposable ->
$(window).off 'focus', focusCallback
# New with native APIs
focusCallback = ->
window.addEventListener 'focus', focusCallback
disposables.add new Disposable ->
window.removeEventListener 'focus', focusCallback
```
### Providing Events: Using the Emitter
You no longer need to require `emissary` to get an emitter. We now provide an `Emitter` class from `require 'atom'`. We have a specific pattern for use of the `Emitter`. Rather than mixing it in, we instantiate a member variable, and create explicit subscription methods. For more information see the [`Emitter` docs][emitter].
```coffee
# New!
{Emitter} = require 'atom'
class Something
constructor: ->
@emitter = new Emitter
destroy: ->
@emitter.dispose()
onDidChange: (callback) ->
@emitter.on 'did-change', callback
methodThatFiresAChange: ->
@emitter.emit 'did-change', {data: 2}
# Using the evented class
something = new Something
something.onDidChange (eventObject) ->
console.log eventObject.data # => 2
something.methodThatFiresAChange()
```
## Subscribing To Commands
`$.fn.command` and `View::subscribeToCommand` are no longer available. Now we use `atom.commands.add`, and collect the results in a `CompositeDisposable`. See [the docs][commands-add] for more info.
```coffee
# Old!
atom.workspaceView.command 'core:close core:cancel', ->
# When inside a View class, you might see this
@subscribeToCommand 'core:close core:cancel', ->
```
```coffee
# New!
@disposables.add atom.commands.add 'atom-workspace',
'core:close': ->
'core:cancel': ->
# You can register commands directly on individual DOM elements in addition to
# using selectors. When in a View class, you should have a `@element` object
# available. `@element` is a plain HTMLElement object
@disposables.add atom.commands.add @element,
'core:close': ->
'core:cancel': ->
```
## Upgrading your stylesheet's selectors
Many selectors have changed, and we have introduced the [Shadow DOM][shadowdom] to the editor. See [Upgrading Your Package Selectors guide][upgrading-selectors] for more information in upgrading your package stylesheets.
## Help us improve this guide!
Did you hit something painful that wasn't in here? Want to reword some bit of it? Find something incorrect? Please edit [this file][guide], and send a pull request. Contributions are greatly appreciated.
[texteditorview]:https://github.com/atom/atom-space-pen-views#texteditorview
[scrollview]:https://github.com/atom/atom-space-pen-views#scrollview
[selectlistview]:https://github.com/atom/atom-space-pen-views#selectlistview
[selectlistview-example]:https://github.com/atom/command-palette/pull/19/files
[emitter]:https://atom.io/docs/api/latest/Emitter
[texteditor]:https://atom.io/docs/api/latest/TextEditor
[disposable]:https://atom.io/docs/api/latest/Disposable
[commands-add]:https://atom.io/docs/api/latest/CommandRegistry#instance-add
[upgrading-selectors]:upgrading-your-ui-theme
[shadowdom]:http://blog.atom.io/2014/11/18/avoiding-style-pollution-with-the-shadow-dom.html
[guide]:https://github.com/atom/atom/blob/master/docs/upgrading/upgrading-your-package.md
+2 -5
Ver Arquivo
@@ -6,19 +6,16 @@ Syntax themes are specifically intended to style only text editor content, so th
When theme style sheets are loaded into the text editor's shadow DOM, selectors intended to target the editor from the *outside* no longer make sense. Styles targeting the `.editor` and `.editor-colors` classes instead need to target the `:host` pseudo-element, which matches against the containing `atom-text-editor` node. Check out the [Shadow DOM 201][host-pseudo-element] article for more information about the `:host` pseudo-element.
Here's an example from Atom's light syntax theme. Note that the previous selectors intended to target the editor from the outside have been retained to allow the theme to keep working during the transition phase when it is possible to disable the shadow DOM.
Here's an example from Atom's light syntax theme. Note that the `atom-text-editor` selector intended to target the editor from the outside has been retained to allow the theme to keep working during the transition phase when it is possible to disable the shadow DOM.
```css
.editor-colors, :host { /* :host added */
atom-text-editor, :host { /* :host added */
background-color: @syntax-background-color;
color: @syntax-text-color;
}
.editor, :host { /* :host added */
.invisible-character {
color: @syntax-invisible-character-color;
}
/* more nested selectors... */
}
```
+4 -4
Ver Arquivo
@@ -88,17 +88,17 @@ run the `ascii-art:convert` command it will output 'Hello, World!'
Now let's add a key binding to trigger the `ascii-art:convert` command. Open
_keymaps/ascii-art.cson_ and add a key binding linking `ctrl-alt-a` to the
`ascii-art:convert` command. You can delete the pre-existing key binding since
you don't need it anymore. When finished, the file will look like this:
you don't need it anymore. When finished, the file will have this:
```coffeescript
'atom-text-editor':
'cmd-alt-a': 'ascii-art:convert'
'ctrl-alt-a': 'ascii-art:convert'
```
Notice `atom-text-editor` on the first line. Just like CSS, keymap selectors
*scope* key bindings so they only apply to specific elements. In this case, our
binding is only active for elements matching the `atom-text-editor` selector. If
the Tree View has focus, pressing `cmd-alt-a` won't trigger the
the Tree View has focus, pressing `ctrl-alt-a` won't trigger the
`ascii-art:convert` command. But if the editor has focus, the
`ascii-art:convert` method *will* be triggered. More information on key bindings
can be found in the [keymaps](advanced/keymaps.html) documentation.
@@ -142,7 +142,7 @@ convert: ->
selection.insertText("\n#{asciiArt}\n")
```
Select some text in an editor window and hit `cmd-alt-a`. :tada: You're now an
Select some text in an editor window and hit `ctrl-alt-a`. :tada: You're now an
ASCII art professional!
## Further reading
+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 {
}
+69 -64
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.171.0",
"version": "0.177.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -17,10 +17,10 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.20.5",
"atomShellVersion": "0.21.0",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^2.5.1",
"atom-keymap": "^3.1.0",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.8.0",
@@ -29,104 +29,109 @@
"delegato": "^1",
"emissary": "^1.3.1",
"event-kit": "^1.0.1",
"first-mate": "^2.2.4",
"first-mate": "^3.0.0",
"fs-plus": "^2.3.2",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^2.2",
"git-utils": "^3.0.0",
"grim": "1.1.0",
"guid": "0.0.10",
"jasmine-json": "~0.0",
"jasmine-tagged": "^1.1.2",
"jquery": "^2.1.1",
"less-cache": "0.19.0",
"less-cache": "0.21",
"marked": "^0.3",
"mixto": "^1",
"mkdirp": "0.3.5",
"nslog": "^1.0.1",
"oniguruma": "^3.0.4",
"nslog": "^2.0.0",
"oniguruma": "^4.0.0",
"optimist": "0.4.0",
"pathwatcher": "^2.5.0",
"pathwatcher": "^3.1.0",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"react-atom-fork": "^0.11.1",
"react-atom-fork": "^0.11.5",
"reactionary-atom-fork": "^1.0.0",
"runas": "1.0.1",
"scandal": "1.0.3",
"runas": "2.0.0",
"scandal": "2.0.0",
"scoped-property-store": "^0.16.2",
"scrollbar-style": "^1.0.2",
"season": "^5.0.2",
"scrollbar-style": "^2.0.0",
"season": "^5.1.2",
"semver": "2.2.1",
"serializable": "^1",
"service-hub": "^0.1.0",
"service-hub": "^0.2.0",
"space-pen": "3.8.2",
"stacktrace-parser": "0.1.1",
"temp": "0.7.0",
"text-buffer": "^3.8.4",
"text-buffer": "^4.0.0",
"theorist": "^1.0.2",
"underscore-plus": "^1.6.6",
"vm-compatibility-layer": "0.1.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.23.0",
"atom-dark-ui": "0.43.0",
"atom-light-syntax": "0.24.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.41.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.25.0",
"dev-live-reload": "0.36.0",
"encoding-selector": "0.14.0",
"atom-dark-syntax": "0.26.0",
"atom-dark-ui": "0.46.0",
"atom-light-syntax": "0.26.0",
"atom-light-ui": "0.40.0",
"base16-tomorrow-dark-theme": "0.25.0",
"base16-tomorrow-light-theme": "0.8.0",
"one-dark-ui": "0.2.0",
"one-dark-syntax": "0.2.0",
"one-light-syntax": "0.2.0",
"one-light-ui": "0.1.0",
"solarized-dark-syntax": "0.32.0",
"solarized-light-syntax": "0.19.0",
"archive-view": "0.46.0",
"autocomplete": "0.44.0",
"autoflow": "0.21.0",
"autosave": "0.20.0",
"background-tips": "0.22.0",
"bookmarks": "0.35.0",
"bracket-matcher": "0.71.0",
"command-palette": "0.34.0",
"deprecation-cop": "0.34.0",
"dev-live-reload": "0.41.0",
"encoding-selector": "0.17.0",
"exception-reporting": "0.21.0",
"find-and-replace": "0.155.0",
"fuzzy-finder": "0.64.0",
"git-diff": "0.47.0",
"find-and-replace": "0.156.0",
"fuzzy-finder": "0.65.0",
"git-diff": "0.50.0",
"go-to-line": "0.30.0",
"grammar-selector": "0.42.0",
"image-view": "0.46.0",
"incompatible-packages": "0.19.0",
"keybinding-resolver": "0.25.0",
"link": "0.29.0",
"markdown-preview": "0.117.0",
"metrics": "0.40.0",
"notifications": "0.23.0",
"grammar-selector": "0.44.0",
"image-view": "0.48.0",
"incompatible-packages": "0.21.0",
"keybinding-resolver": "0.27.0",
"link": "0.30.0",
"markdown-preview": "0.131.0",
"metrics": "0.41.0",
"notifications": "0.26.0",
"open-on-github": "0.32.0",
"package-generator": "0.36.0",
"release-notes": "0.45.0",
"settings-view": "0.169.0",
"snippets": "0.67.0",
"spell-check": "0.49.0",
"status-bar": "0.56.0",
"styleguide": "0.41.0",
"symbols-view": "0.77.0",
"tabs": "0.61.0",
"timecop": "0.26.0",
"tree-view": "0.147.0",
"package-generator": "0.37.0",
"release-notes": "0.47.0",
"settings-view": "0.174.0",
"snippets": "0.72.0",
"spell-check": "0.54.0",
"status-bar": "0.57.0",
"styleguide": "0.43.0",
"symbols-view": "0.81.0",
"tabs": "0.64.0",
"timecop": "0.28.0",
"tree-view": "0.154.0",
"update-package-dependencies": "0.7.0",
"welcome": "0.21.0",
"whitespace": "0.28.0",
"wrap-guide": "0.29.0",
"language-c": "0.37.0",
"wrap-guide": "0.31.0",
"language-c": "0.38.0",
"language-clojure": "0.10.0",
"language-coffee-script": "0.39.0",
"language-css": "0.26.0",
"language-gfm": "0.62.0",
"language-gfm": "0.63.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.54.0",
"language-javascript": "0.56.0",
"language-json": "0.11.0",
"language-less": "0.24.0",
"language-make": "0.13.0",
@@ -141,9 +146,9 @@
"language-sass": "0.31.0",
"language-shellscript": "0.12.0",
"language-source": "0.9.0",
"language-sql": "0.13.0",
"language-sql": "0.14.0",
"language-text": "0.6.0",
"language-todo": "0.15.0",
"language-todo": "0.16.0",
"language-toml": "0.15.0",
"language-xml": "0.27.0",
"language-yaml": "0.22.0"
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
#!/bin/sh
"$0/../../app/apm/node_modules/atom-package-manager/bin/node.exe" "$0/../../app/apm/node_modules/atom-package-manager/lib/cli.js" "$@"
"$0/../../app/apm/bin/node.exe" "$0/../../app/apm/lib/cli.js" "$@"
+1 -1
Ver Arquivo
@@ -18,5 +18,5 @@ FOR %%a IN (%*) DO (
IF "%EXPECT_OUTPUT%"=="YES" (
"%~dp0\..\..\atom.exe" %*
) ELSE (
"%~dp0\..\app\apm\node_modules\atom-package-manager\bin\node.exe" "%~dp0\atom.js" %*
"%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %*
)
+1 -1
Ver Arquivo
@@ -18,5 +18,5 @@ done
if [ $EXPECT_OUTPUT ]; then
"$0/../../../atom.exe" "$@"
else
"$0/../../app/apm/node_modules/atom-package-manager/bin/node.exe" "$0/../atom.js" "$@"
"$0/../../app/apm/bin/node.exe" "$0/../atom.js" "$@"
fi
+3 -3
Ver Arquivo
@@ -48,9 +48,9 @@ function bootstrap() {
var dedupeNpmCommand = npmPath + npmFlags + 'dedupe';
if (process.argv.indexOf('--no-quiet') === -1) {
buildInstallCommand += ' --quiet';
apmInstallCommand += ' --quiet';
moduleInstallCommand += ' --quiet';
buildInstallCommand += ' --loglevel error';
apmInstallCommand += ' --loglevel error';
moduleInstallCommand += ' --loglevel error';
dedupeApmCommand += ' --quiet';
dedupeNpmCommand += ' --quiet';
buildInstallOptions.ignoreStdout = true;
+127 -13
Ver Arquivo
@@ -226,14 +226,44 @@ describe "Config", ->
advanceClock(500)
expect(atom.config.save.callCount).toBe 1
describe "when a 'source' and no 'scopeSelector' is given", ->
it "removes all scoped settings with the given source", ->
atom.config.set("foo.bar.baz", 1, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.quux", 2, scopeSelector: ".b", source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a.b"])).toEqual(baz: 1, quux: 2)
describe "when no 'scopeSelector' is given", ->
describe "when a 'source' but no key-path is given", ->
it "removes all scoped settings with the given source", ->
atom.config.set("foo.bar.baz", 1, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.quux", 2, scopeSelector: ".b", source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a.b"])).toEqual(baz: 1, quux: 2)
atom.config.unset(null, source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a"])).toEqual(baz: 0, ok: 0)
atom.config.unset(null, source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a"])).toEqual(baz: 0, ok: 0)
describe "when a 'source' and a key-path is given", ->
it "removes all scoped settings with the given source and key-path", ->
atom.config.set("foo.bar.baz", 1)
atom.config.set("foo.bar.baz", 2, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.baz", 3, scopeSelector: ".a.b", source: "source-b")
expect(atom.config.get("foo.bar.baz", scope: [".a.b"])).toEqual(3)
atom.config.unset("foo.bar.baz", source: "source-b")
expect(atom.config.get("foo.bar.baz", scope: [".a.b"])).toEqual(2)
expect(atom.config.get("foo.bar.baz")).toEqual(1)
describe "when no 'source' is given", ->
it "removes all scoped and unscoped properties for that key-path", ->
atom.config.setDefaults("foo.bar", baz: 100)
atom.config.set("foo.bar", { baz: 1, ok: 2 }, scopeSelector: ".a")
atom.config.set("foo.bar", { baz: 11, ok: 12 }, scopeSelector: ".b")
atom.config.set("foo.bar", { baz: 21, ok: 22 })
atom.config.unset("foo.bar.baz")
expect(atom.config.get("foo.bar.baz", scope: [".a"])).toBe 100
expect(atom.config.get("foo.bar.baz", scope: [".b"])).toBe 100
expect(atom.config.get("foo.bar.baz")).toBe 100
expect(atom.config.get("foo.bar.ok", scope: [".a"])).toBe 2
expect(atom.config.get("foo.bar.ok", scope: [".b"])).toBe 12
expect(atom.config.get("foo.bar.ok")).toBe 22
describe "when a 'scopeSelector' is given", ->
it "restores the global default when no scoped default set", ->
@@ -669,6 +699,26 @@ describe "Config", ->
expect(atom.config.get("foo.bar")).toBe 'baz'
expect(atom.config.get("foo.bar", scope: ['.source.ruby'])).toBe 'more-specific'
describe "when the config file does not conform to the schema", ->
beforeEach ->
fs.writeFileSync atom.config.configFilePath, """
'*':
foo:
bar: 'omg'
int: 'baz'
'.source.ruby':
foo:
bar: 'scoped'
int: 'nope'
"""
it "validates and does not load the incorrect values", ->
atom.config.loadUserConfig()
expect(atom.config.get("foo.int")).toBe 12
expect(atom.config.get("foo.bar")).toBe 'omg'
expect(atom.config.get("foo.int", scope: ['.source.ruby'])).toBe 12
expect(atom.config.get("foo.bar", scope: ['.source.ruby'])).toBe 'scoped'
describe "when the config file contains valid cson", ->
beforeEach ->
fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'")
@@ -686,15 +736,14 @@ describe "Config", ->
expect(observeHandler).toHaveBeenCalledWith 'baz'
describe "when the config file contains invalid cson", ->
addErrorHandler = null
beforeEach ->
spyOn(console, 'error')
spyOn(atom.notifications, 'addError')
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
fs.writeFileSync(atom.config.configFilePath, "{{{{{")
it "logs an error to the console and does not overwrite the config file on a subsequent save", ->
atom.config.loadUserConfig()
expect(console.error).toHaveBeenCalled()
expect(atom.notifications.addError.callCount).toBe 1
expect(addErrorHandler.callCount).toBe 1
atom.config.set("hair", "blonde") # trigger a save
expect(atom.config.save).not.toHaveBeenCalled()
@@ -876,10 +925,11 @@ describe "Config", ->
expect(atom.config.get('foo.bar')).toBe 'newVal'
describe "when the config file changes to contain invalid cson", ->
addErrorHandler = null
beforeEach ->
spyOn(console, 'error')
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
writeConfigFile("}}}")
waitsFor "error to be logged", -> console.error.callCount > 0
waitsFor "error to be logged", -> addErrorHandler.callCount > 0
it "logs a warning and does not update config data", ->
expect(updatedHandler.callCount).toBe 0
@@ -1076,6 +1126,62 @@ describe "Config", ->
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'omg'
expect(atom.config.get('foo.bar.str', scope: ['.source.coffee'])).toBe 'ok'
describe 'when a schema is added after config values have been set', ->
schema = null
beforeEach ->
schema =
type: 'object'
properties:
int:
type: 'integer'
default: 2
str:
type: 'string'
default: 'def'
it "respects the new schema when values are set", ->
expect(atom.config.set('foo.bar.str', 'global')).toBe true
expect(atom.config.set('foo.bar.str', 'scoped', scopeSelector: '.source.js')).toBe true
expect(atom.config.get('foo.bar.str')).toBe 'global'
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'scoped'
expect(atom.config.set('foo.bar.noschema', 'nsGlobal')).toBe true
expect(atom.config.set('foo.bar.noschema', 'nsScoped', scopeSelector: '.source.js')).toBe true
expect(atom.config.get('foo.bar.noschema')).toBe 'nsGlobal'
expect(atom.config.get('foo.bar.noschema', scope: ['.source.js'])).toBe 'nsScoped'
expect(atom.config.set('foo.bar.int', 'nope')).toBe true
expect(atom.config.set('foo.bar.int', 'notanint', scopeSelector: '.source.js')).toBe true
expect(atom.config.set('foo.bar.int', 23, scopeSelector: '.source.coffee')).toBe true
expect(atom.config.get('foo.bar.int')).toBe 'nope'
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 'notanint'
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
atom.config.setSchema('foo.bar', schema)
expect(atom.config.get('foo.bar.str')).toBe 'global'
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'scoped'
expect(atom.config.get('foo.bar.noschema')).toBe 'nsGlobal'
expect(atom.config.get('foo.bar.noschema', scope: ['.source.js'])).toBe 'nsScoped'
expect(atom.config.get('foo.bar.int')).toBe 2
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 2
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
it "sets all values that adhere to the schema", ->
expect(atom.config.set('foo.bar.int', 10)).toBe true
expect(atom.config.set('foo.bar.int', 15, scopeSelector: '.source.js')).toBe true
expect(atom.config.set('foo.bar.int', 23, scopeSelector: '.source.coffee')).toBe true
expect(atom.config.get('foo.bar.int')).toBe 10
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 15
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
atom.config.setSchema('foo.bar', schema)
expect(atom.config.get('foo.bar.int')).toBe 10
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 15
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
describe 'when the value has an "integer" type', ->
beforeEach ->
schema =
@@ -1363,6 +1469,14 @@ describe "Config", ->
atom.config.set('foo.bar.aColor', false)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
it "returns a clone of the Color when returned in a parent object", ->
color1 = atom.config.get('foo.bar').aColor
color2 = atom.config.get('foo.bar').aColor
expect(color1.toRGBAString()).toBe 'rgba(255, 255, 255, 1)'
expect(color2.toRGBAString()).toBe 'rgba(255, 255, 255, 1)'
expect(color1).not.toBe color2
expect(color1).toEqual color2
describe 'when the `enum` key is used', ->
beforeEach ->
schema =
+9 -4
Ver Arquivo
@@ -351,11 +351,16 @@ describe "DisplayBuffer", ->
expect(displayBuffer.tokenizedLineForScreenRow(1).text).toMatch /^10/
describe "when there is another display buffer pointing to the same buffer", ->
it "does not create folds in the other display buffer", ->
it "does not consider folds to be nested inside of folds from the other display buffer", ->
otherDisplayBuffer = new DisplayBuffer({buffer, tabLength})
otherDisplayBuffer.createFold(1, 5)
displayBuffer.createFold(2, 4)
expect(otherDisplayBuffer.foldsStartingAtBufferRow(2).length).toBe 0
expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe '2'
expect(displayBuffer.tokenizedLineForScreenRow(3).text).toBe '5'
describe "when the buffer changes", ->
[fold1, fold2] = []
beforeEach ->
@@ -1058,7 +1063,7 @@ describe "DisplayBuffer", ->
[marker, decoration, decorationProperties] = []
beforeEach ->
marker = displayBuffer.markBufferRange([[2, 13], [3, 15]])
decorationProperties = {type: 'gutter', class: 'one'}
decorationProperties = {type: 'line-number', class: 'one'}
decoration = displayBuffer.decorateMarker(marker, decorationProperties)
it "can add decorations associated with markers and remove them", ->
@@ -1079,11 +1084,11 @@ describe "DisplayBuffer", ->
describe "when a decoration is updated via Decoration::update()", ->
it "emits an 'updated' event containing the new and old params", ->
decoration.onDidChangeProperties updatedSpy = jasmine.createSpy()
decoration.setProperties type: 'gutter', class: 'two'
decoration.setProperties type: 'line-number', class: 'two'
{oldProperties, newProperties} = updatedSpy.mostRecentCall.args[0]
expect(oldProperties).toEqual decorationProperties
expect(newProperties).toEqual type: 'gutter', class: 'two', id: decoration.id
expect(newProperties).toEqual type: 'line-number', class: 'two', id: decoration.id
describe "::getDecorations(properties)", ->
it "returns decorations matching the given optional properties", ->
@@ -0,0 +1,5 @@
class TestItem
getUri: -> "test"
exports.activate = ->
atom.workspace.addOpener -> new TestItem
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
@@ -1,4 +1,4 @@
{
"theme": "syntax",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
+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'
+49
Ver Arquivo
@@ -37,6 +37,32 @@ describe "Project", ->
deserializedProject.getBuffers()[0].destroy()
expect(deserializedProject.getBuffers().length).toBe 0
it "does not deserialize buffers when their path is a directory that exists", ->
pathToOpen = path.join(temp.mkdirSync(), 'file.txt')
waitsForPromise ->
atom.project.open(pathToOpen)
runs ->
expect(atom.project.getBuffers().length).toBe 1
fs.mkdirSync(pathToOpen)
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
it "does not deserialize buffers when their path is inaccessible", ->
pathToOpen = path.join(temp.mkdirSync(), 'file.txt')
fs.writeFileSync(pathToOpen, '')
waitsForPromise ->
atom.project.open(pathToOpen)
runs ->
expect(atom.project.getBuffers().length).toBe 1
fs.chmodSync(pathToOpen, '000')
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
describe "when an editor is saved and the project has no path", ->
it "sets the project's path to the saved file's parent directory", ->
tempFile = temp.openSync().path
@@ -51,6 +77,29 @@ describe "Project", ->
editor.saveAs(tempFile)
expect(atom.project.getPaths()[0]).toBe path.dirname(tempFile)
describe "when a watch error is thrown from the TextBuffer", ->
editor = null
beforeEach ->
waitsForPromise ->
atom.project.open(require.resolve('./fixtures/dir/a')).then (o) -> editor = o
it "creates a warning notification", ->
atom.notifications.onDidAddNotification noteSpy = jasmine.createSpy()
error = new Error('SomeError')
error.eventType = 'resurrect'
editor.buffer.emitter.emit 'will-throw-watch-error',
handle: jasmine.createSpy()
error: error
expect(noteSpy).toHaveBeenCalled()
notification = noteSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getDetail()).toBe 'SomeError'
expect(notification.getMessage()).toContain '`resurrect`'
expect(notification.getMessage()).toContain 'fixtures/dir/a'
describe ".open(path)", ->
[absolutePath, newBufferHandler] = []
+10 -4
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()
@@ -212,6 +213,11 @@ jasmine.snapshotDeprecations = ->
jasmine.restoreDeprecationsSnapshot = ->
Grim.deprecations = deprecationsSnapshot
jasmine.useRealClock = ->
jasmine.unspy(window, 'setTimeout')
jasmine.unspy(window, 'clearTimeout')
jasmine.unspy(_._, 'now')
addCustomMatchers = (spec) ->
spec.addMatchers
toBeInstanceOf: (expected) ->
@@ -297,13 +303,13 @@ window.waitsForPromise = (args...) ->
window.waitsFor timeout, (moveOn) ->
promise = fn()
if shouldReject
promise.fail(moveOn)
promise.done ->
promise.catch(moveOn)
promise.then ->
jasmine.getEnv().currentSpec.fail("Expected promise to be rejected, but it was resolved")
moveOn()
else
promise.done(moveOn)
promise.fail (error) ->
promise.then(moveOn)
promise.catch (error) ->
jasmine.getEnv().currentSpec.fail("Expected promise to be resolved, but it was rejected with #{jasmine.pp(error)}")
moveOn()
+6 -6
Ver Arquivo
@@ -931,7 +931,7 @@ describe "TextEditorComponent", ->
beforeEach ->
marker = editor.displayBuffer.markBufferRange([[2, 13], [3, 15]], invalidate: 'inside')
decorationParams = {type: ['gutter', 'line'], class: 'a'}
decorationParams = {type: ['line-number', 'line'], class: 'a'}
decoration = editor.decorateMarker(marker, decorationParams)
nextAnimationFrame()
@@ -946,7 +946,7 @@ describe "TextEditorComponent", ->
# Add decorations that are out of range
marker2 = editor.displayBuffer.markBufferRange([[9, 0], [9, 0]])
editor.decorateMarker(marker2, type: ['gutter', 'line'], class: 'b')
editor.decorateMarker(marker2, type: ['line-number', 'line'], class: 'b')
nextAnimationFrame()
# Scroll decorations into view
@@ -970,7 +970,7 @@ describe "TextEditorComponent", ->
marker.destroy()
marker = editor.markBufferRange([[0, 0], [0, 2]])
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'b')
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'b')
nextAnimationFrame()
expect(lineNumberHasClass(0, 'b')).toBe true
expect(lineNumberHasClass(1, 'b')).toBe false
@@ -1039,7 +1039,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyHead' property is true", ->
it "only applies the decoration's class to lines containing the marker's head", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-head', onlyHead: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-head', onlyHead: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(1, 'only-head')).toBe false
expect(lineAndLineNumberHaveClass(2, 'only-head')).toBe false
@@ -1048,7 +1048,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyEmpty' property is true", ->
it "only applies the decoration when its marker is empty", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-empty', onlyEmpty: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-empty', onlyEmpty: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(2, 'only-empty')).toBe false
expect(lineAndLineNumberHaveClass(3, 'only-empty')).toBe false
@@ -1060,7 +1060,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyNonEmpty' property is true", ->
it "only applies the decoration when its marker is non-empty", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-non-empty', onlyNonEmpty: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-non-empty', onlyNonEmpty: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(2, 'only-non-empty')).toBe true
expect(lineAndLineNumberHaveClass(3, 'only-non-empty')).toBe true
+34 -7
Ver Arquivo
@@ -155,6 +155,25 @@ describe "TextEditor", ->
expect(editor2.getSoftTabs()).toBe true
expect(editor2.getEncoding()).toBe 'macroman'
it "uses scoped `core.fileEncoding` values", ->
editor1 = null
editor2 = null
atom.config.set('core.fileEncoding', 'utf16le')
atom.config.set('core.fileEncoding', 'macroman', scopeSelector: '.js')
waitsForPromise ->
atom.workspace.open('a').then (o) -> editor1 = o
runs ->
expect(editor1.getEncoding()).toBe 'utf16le'
waitsForPromise ->
atom.workspace.open('test.js').then (o) -> editor2 = o
runs ->
expect(editor2.getEncoding()).toBe 'macroman'
describe "title", ->
describe ".getTitle()", ->
it "uses the basename of the buffer's path as its title, or 'untitled' if the path is undefined", ->
@@ -2630,12 +2649,20 @@ describe "TextEditor", ->
atom.config.set("editor.autoIndentOnPaste", true)
describe "when only whitespace precedes the cursor", ->
it "auto-indents the lines spanned by the pasted text", ->
atom.clipboard.write("console.log(x);\nconsole.log(y);\n")
editor.setCursorBufferPosition([5, 2])
it "auto-indents the lines spanned by the pasted text, based on the first pasted line", ->
expect(editor.indentationForBufferRow(5)).toBe(3)
atom.clipboard.write("a(x);\n b(x);\n c(x);\n", indentBasis: 0)
editor.setCursorBufferPosition([5, 0])
editor.pasteText()
expect(editor.lineTextForBufferRow(5)).toBe(" console.log(x);")
expect(editor.lineTextForBufferRow(6)).toBe(" console.log(y);")
# Adjust the indentation of the pasted block
expect(editor.indentationForBufferRow(5)).toBe(3)
expect(editor.indentationForBufferRow(6)).toBe(4)
expect(editor.indentationForBufferRow(7)).toBe(5)
# Preserve the indentation of the next row
expect(editor.indentationForBufferRow(8)).toBe(3)
describe "when non-whitespace characters precede the cursor", ->
it "does not auto-indent the first line being pasted", ->
@@ -2732,9 +2759,9 @@ describe "TextEditor", ->
editor.setSelectedBufferRange([[1, 2], [1, Infinity]])
editor.pasteText()
expect(editor.lineTextForBufferRow(1)).toBe(" if (items.length <= 1) return items;")
expect(editor.lineTextForBufferRow(2)).toBe(" ")
expect(editor.lineTextForBufferRow(2)).toBe("")
expect(editor.lineTextForBufferRow(3)).toBe(" if (items.length <= 1) return items;")
expect(editor.getCursorBufferPosition()).toEqual([2, 2])
expect(editor.getCursorBufferPosition()).toEqual([2, 0])
describe "when there is no selection", ->
it "pastes the line above the cursor and retains the cursor's column", ->
+82 -47
Ver Arquivo
@@ -289,69 +289,104 @@ describe "ThemeManager", ->
# from within the theme itself
expect($("atom-text-editor").css("background-color")).toBe "rgb(0, 152, 255)"
describe "when the user stylesheet changes", ->
describe "user stylesheet", ->
userStylesheetPath = null
beforeEach ->
jasmine.snapshotDeprecations()
afterEach ->
jasmine.restoreDeprecationsSnapshot()
it "reloads it", ->
[styleElementAddedHandler, styleElementRemovedHandler] = []
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
userStylesheetPath = path.join(temp.mkdirSync("atom"), 'styles.less')
fs.writeFileSync(userStylesheetPath, 'body {border-style: dotted !important;}')
spyOn(atom.styles, 'getUserStyleSheetPath').andReturn userStylesheetPath
waitsForPromise ->
themeManager.activateThemes()
describe "when the user stylesheet changes", ->
beforeEach ->
jasmine.snapshotDeprecations()
runs ->
atom.styles.onDidRemoveStyleElement styleElementRemovedHandler = jasmine.createSpy("styleElementRemovedHandler")
atom.styles.onDidAddStyleElement styleElementAddedHandler = jasmine.createSpy("styleElementAddedHandler")
afterEach ->
jasmine.restoreDeprecationsSnapshot()
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidRemoveStylesheet stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
it "reloads it", ->
[styleElementAddedHandler, styleElementRemovedHandler] = []
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
expect($(document.body).css('border-style')).toBe 'dotted'
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
waitsForPromise ->
themeManager.activateThemes()
waitsFor ->
themeManager.loadUserStylesheet.callCount is 1
runs ->
atom.styles.onDidRemoveStyleElement styleElementRemovedHandler = jasmine.createSpy("styleElementRemovedHandler")
atom.styles.onDidAddStyleElement styleElementAddedHandler = jasmine.createSpy("styleElementAddedHandler")
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidRemoveStylesheet stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dotted'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted'
expect($(document.body).css('border-style')).toBe 'dotted'
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
expect(styleElementAddedHandler).toHaveBeenCalled()
expect(styleElementAddedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
waitsFor ->
themeManager.loadUserStylesheet.callCount is 1
expect(stylesheetsChangedHandler).toHaveBeenCalled()
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
styleElementRemovedHandler.reset()
stylesheetRemovedHandler.reset()
stylesheetsChangedHandler.reset()
fs.removeSync(userStylesheetPath)
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dotted'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted'
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
expect(styleElementAddedHandler).toHaveBeenCalled()
expect(styleElementAddedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
runs ->
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
expect($(document.body).css('border-style')).toBe 'none'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
expect(stylesheetsChangedHandler).toHaveBeenCalled()
styleElementRemovedHandler.reset()
stylesheetRemovedHandler.reset()
stylesheetsChangedHandler.reset()
fs.removeSync(userStylesheetPath)
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
runs ->
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
expect($(document.body).css('border-style')).toBe 'none'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
describe "when there is an error reading the stylesheet", ->
addErrorHandler = null
beforeEach ->
themeManager.loadUserStylesheet()
spyOn(themeManager.lessCache, 'cssForFile').andCallFake ->
throw new Error('EACCES permission denied "styles.less"')
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates an error notification", ->
themeManager.loadUserStylesheet()
expect(addErrorHandler).toHaveBeenCalled()
note = addErrorHandler.mostRecentCall.args[0]
expect(note.getType()).toBe 'error'
expect(note.getMessage()).toContain 'Error loading'
describe "when there is an error watching the user stylesheet", ->
addErrorHandler = null
beforeEach ->
{File} = require 'pathwatcher'
spyOn(File::, 'on').andCallFake (event) ->
if event.indexOf('contents-changed') > -1
throw new Error('Unable to watch path')
spyOn(themeManager, 'loadStylesheet').andReturn ''
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates an error notification", ->
themeManager.loadUserStylesheet()
expect(addErrorHandler).toHaveBeenCalled()
note = addErrorHandler.mostRecentCall.args[0]
expect(note.getType()).toBe 'error'
expect(note.getMessage()).toContain 'Unable to watch path'
describe "when a non-existent theme is present in the config", ->
beforeEach ->
+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", ->
+197 -9
Ver Arquivo
@@ -1,11 +1,13 @@
path = require 'path'
temp = require 'temp'
Workspace = require '../src/workspace'
Pane = require '../src/pane'
{View} = require '../src/space-pen-extensions'
platform = require './spec-helper-platform'
_ = require 'underscore-plus'
fstream = require 'fstream'
fs = require 'fs-plus'
Grim = require 'grim'
describe "Workspace", ->
workspace = null
@@ -96,7 +98,7 @@ describe "Workspace", ->
workspace.open('a').then (o) -> editor = o
runs ->
expect(editor.getUri()).toBe atom.project.getDirectories()[0]?.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()
@@ -250,6 +252,116 @@ 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 "when there is an error opening the file", ->
notificationSpy = null
beforeEach ->
atom.notifications.onDidAddNotification notificationSpy = jasmine.createSpy()
describe "when a large file is opened", ->
beforeEach ->
spyOn(fs, 'getSizeSync').andReturn 2 * 1048577 # 2MB
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain '< 2MB'
describe "when a file does not exist", ->
it "creates an empty buffer for the specified path", ->
waitsForPromise ->
workspace.open('not-a-file.md')
runs ->
editor = workspace.getActiveTextEditor()
expect(notificationSpy).not.toHaveBeenCalled()
expect(editor.getPath()).toContain 'not-a-file.md'
describe "when the user does not have access to the file", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EACCES, permission denied '#{path}'")
error.path = path
error.code = 'EACCES'
throw error
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Permission denied'
expect(notification.getMessage()).toContain 'file1'
describe "when the the operation is not permitted", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EPERM, operation not permitted '#{path}'")
error.path = path
error.code = 'EPERM'
throw error
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to open'
expect(notification.getMessage()).toContain 'file1'
describe "when the the file is already open in windows", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EBUSY, resource busy or locked '#{path}'")
error.path = path
error.code = 'EBUSY'
throw error
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to open'
expect(notification.getMessage()).toContain 'file1'
describe "when there is an unhandled error", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
throw new Error("I dont even know what is happening right now!!")
it "creates a notification", ->
open = -> workspace.open('file1', workspace.getActivePane())
expect(open).toThrow()
describe "::reopenItem()", ->
it "opens the uri associated with the last closed pane that isn't currently open", ->
pane = workspace.getActivePane()
@@ -261,21 +373,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.getDirectories()[0]?.resolve('file1')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('file1')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.getDirectories()[0]?.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
pane.destroyActiveItem()
# reopens items with uris
@@ -285,20 +397,20 @@ describe "Workspace", ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.getDirectories()[0]?.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.getDirectories()[0]?.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.getDirectories()[0]?.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", ->
@@ -841,3 +953,79 @@ describe "Workspace", ->
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeTruthy()
describe "::saveActivePaneItem()", ->
describe "when there is an error", ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the directory cannot be written to", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the user does not have permission", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
error = new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
error.code = 'EACCES'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the operation is not permitted", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
error = new Error("EPERM, operation not permitted '/Some/dir/and-a-file.js'")
error.code = 'EPERM'
error.path = '/Some/dir/and-a-file.js'
throw error
it "emits a warning notification when the file is already open by another app", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
error = new Error("EBUSY, resource busy or locked '/Some/dir/and-a-file.js'")
error.code = 'EBUSY'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
notificaiton = addedSpy.mostRecentCall.args[0]
expect(notificaiton.getType()).toBe 'warning'
expect(notificaiton.getMessage()).toContain 'Unable to save'
it "emits a warning notification when the file system is read-only", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
error = new Error("EROFS, read-only file system '/Some/dir/and-a-file.js'")
error.code = 'EROFS'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
notification = addedSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to save'
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("no one knows")
save = -> atom.workspace.saveActivePaneItem()
expect(save).toThrow()
-37
Ver Arquivo
@@ -3,7 +3,6 @@ Q = require 'q'
path = require 'path'
temp = require 'temp'
TextEditorView = require '../src/text-editor-view'
Pane = require '../src/pane'
PaneView = require '../src/pane-view'
Workspace = require '../src/workspace'
@@ -295,39 +294,3 @@ describe "WorkspaceView", ->
modalContainer = workspaceElement.querySelector('atom-panel-container.modal')
expect(modalContainer.parentNode).toBe workspaceElement
describe "::saveActivePaneItem()", ->
describe "when there is an error", ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the directory cannot be written to", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the user does not have permission", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("no one knows")
save = -> atom.workspace.saveActivePaneItem()
expect(save).toThrow()
+4 -2
Ver Arquivo
@@ -3,7 +3,6 @@ ipc = require 'ipc'
os = require 'os'
path = require 'path'
remote = require 'remote'
screen = require 'screen'
shell = require 'shell'
_ = require 'underscore-plus'
@@ -547,6 +546,7 @@ class Atom extends Model
if @isValidDimensions(dimensions)
dimensions
else
screen = remote.require 'screen'
{width, height} = screen.getPrimaryDisplay().workAreaSize
{x: 0, y: 0, width: Math.min(1024, width), height}
@@ -776,7 +776,9 @@ class Atom extends Model
try
require(userInitScriptPath) if fs.isFileSync(userInitScriptPath)
catch error
console.error "Failed to load `#{userInitScriptPath}`", error.stack, error
atom.notifications.addError "Failed to load `#{userInitScriptPath}`",
detail: error.message
dismissable: true
# Require the module with the given globals.
#
+8 -3
Ver Arquivo
@@ -23,13 +23,18 @@ class AtomWindow
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
@browserWindow = new BrowserWindow
options =
show: false
title: 'Atom'
icon: @constructor.iconPath
'web-preferences':
'direct-write': false
'direct-write': true
'subpixel-font-scaling': false
# Don't set icon on Windows so the exe's ico will be used as window and
# taskbar's icon. See https://github.com/atom/atom/issues/4811 for more.
if process.platform is 'linux'
options.icon = @constructor.iconPath
@browserWindow = new BrowserWindow options
global.atomApplication.addWindow(this)
@handleEvents()
+5 -11
Ver Arquivo
@@ -13,16 +13,6 @@ process.on 'uncaughtException', (error={}) ->
nslog(error.message) if error.message?
nslog(error.stack) if error.stack?
# Patch fs.statSyncNoException/fs.lstatSyncNoException to fail for non-strings
# https://github.com/atom/atom-shell/issues/843
{lstatSyncNoException, statSyncNoException} = fs
fs.statSyncNoException = (pathToStat) ->
return false unless pathToStat and typeof pathToStat is 'string'
statSyncNoException(pathToStat)
fs.lstatSyncNoException = (pathToStat) ->
return false unless pathToStat and typeof pathToStat is 'string'
lstatSyncNoException(pathToStat)
start = ->
if process.platform is 'win32'
SquirrelUpdate = require './squirrel-update'
@@ -50,8 +40,12 @@ start = ->
app.removeListener 'open-file', addPathToOpen
app.removeListener 'open-url', addUrlToOpen
cwd = args.executedFrom?.toString() or process.cwd()
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
path.resolve(args.executedFrom ? process.cwd(), pathToOpen.toString())
if cwd
path.resolve(cwd, pathToOpen.toString())
else
path.resolve(pathToOpen.toString())
setupCoffeeScript()
if args.devMode
+1 -1
Ver Arquivo
@@ -125,7 +125,7 @@ addCommandsToPath = (callback) ->
atomShCommand = "#!/bin/sh\r\n\"$0/../#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\""
apmCommandPath = path.join(binFolder, 'apm.cmd')
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm.cmd'))
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd'))
apmCommand = "@echo off\r\n\"%~dp0\\#{relativeApmPath}\" %*"
apmShCommandPath = path.join(binFolder, 'apm')
+17 -16
Ver Arquivo
@@ -28,22 +28,23 @@ class BufferedProcess
# * `options` An {Object} with the following keys:
# * `command` The {String} command to execute.
# * `args` The {Array} of arguments to pass to the command (optional).
# * `options` The options {Object} to pass to Node's `ChildProcess.spawn`
# method (optional).
# * `stdout` The callback {Function} that receives a single argument which
# contains the standard output from the command. The callback is
# called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After
# the source stream has closed all remaining data is sent in a
# final call (optional).
# * `stderr` The callback {Function} that receives a single argument which
# contains the standard error output from the command. The
# callback is called as data is received but it's buffered to
# ensure only complete lines are passed until the source stream
# closes. After the source stream has closed all remaining data
# is sent in a final call (optional).
# * `exit` The callback {Function} which receives a single argument
# containing the exit status (optional).
# * `options` {Object} (optional) The options {Object} to pass to Node's
# `ChildProcess.spawn` method.
# * `stdout` {Function} (optional) The callback that receives a single
# argument which contains the standard output from the command. The
# callback is called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After the
# source stream has closed all remaining data is sent in a final call.
# * `data` {String}
# * `stderr` {Function} (optional) The callback that receives a single
# argument which contains the standard error output from the command. The
# callback is called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After the
# source stream has closed all remaining data is sent in a final call.
# * `data` {String}
# * `exit` {Function} (optional) The callback which receives a single
# argument containing the exit status.
# * `code` {Number}
constructor: ({command, args, options, stdout, stderr, exit}={}) ->
@emitter = new Emitter
options ?= {}
+13 -1
Ver Arquivo
@@ -7,6 +7,10 @@ fs = require 'fs-plus'
cacheDir = path.join(fs.absolute('~/.atom'), 'compile-cache')
stats =
hits: 0
misses: 0
# 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')
@@ -21,7 +25,10 @@ getCachePath = (coffee) ->
getCachedJavaScript = (cachePath) ->
if fs.isFileSync(cachePath)
try
fs.readFileSync(cachePath, 'utf8')
cachedJavaScript = fs.readFileSync(cachePath, 'utf8')
stats.hits++
return cachedJavaScript
return
convertFilePath = (filePath) ->
if process.platform is 'win32'
@@ -30,6 +37,7 @@ convertFilePath = (filePath) ->
compileCoffeeScript = (coffee, filePath, cachePath) ->
{js, v3SourceMap} = CoffeeScript.compile(coffee, filename: filePath, sourceMap: true)
stats.misses++
# Include source map in the web page environment.
if btoa? and JSON? and unescape? and encodeURIComponent?
js = "#{js}\n//# sourceMappingURL=data:application/json;base64,#{btoa unescape encodeURIComponent v3SourceMap}\n//# sourceURL=#{convertFilePath(filePath)}"
@@ -60,3 +68,7 @@ module.exports =
compileCoffeeScript(coffee, filePath, cachePath)
else if extension is '.cson'
CSON.readFileSync(filePath)
getCacheMisses: -> stats.misses
getCacheHits: -> stats.hits
+8 -6
Ver Arquivo
@@ -1,5 +1,5 @@
_ = require 'underscore-plus'
ParsedColor = require 'color'
ParsedColor = null
# Essential: A simple color class returned from {Config::get} when the value
# at the key path is of type 'color'.
@@ -7,15 +7,17 @@ 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.
# * `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
@@ -51,11 +53,11 @@ class Color
@blue = blue
@alpha = alpha
# Esssential: Returns a {String} in the form `'#abcdef'`.
# Essential: Returns a {String} in the form `'#abcdef'`.
toHexString: ->
"##{numberToHexString(@red)}#{numberToHexString(@green)}#{numberToHexString(@blue)}"
# Esssential: Returns a {String} in the form `'rgba(25, 50, 75, .9)'`.
# Essential: Returns a {String} in the form `'rgba(25, 50, 75, .9)'`.
toRGBAString: ->
"rgba(#{@red}, #{@green}, #{@blue}, #{@alpha})"
+80 -32
Ver Arquivo
@@ -583,6 +583,7 @@ class Config
Pass a `scopeSelector` in an options hash as the final argument instead.
"""
[scopeSelector, keyPath, value] = arguments
shouldSave = true
else
[keyPath, value, options] = arguments
scopeSelector = options?.scopeSelector
@@ -601,7 +602,7 @@ class Config
return false
if scopeSelector?
@setRawScopedValue(source, scopeSelector, keyPath, value)
@setRawScopedValue(keyPath, value, source, scopeSelector)
else
@setRawValue(keyPath, value)
@@ -640,8 +641,9 @@ class Config
@scopedSettingsStore.removePropertiesForSourceAndSelector(source, scopeSelector)
@emitChangeEvent()
else
@scopedSettingsStore.removePropertiesForSource(source)
if keyPath?
for scopeSelector of @scopedSettingsStore.propertiesForSource(source)
@unset(keyPath, {scopeSelector, source})
if keyPath? and source is @getUserConfigPath()
@set(keyPath, _.valueForKeyPath(@defaultSettings, keyPath))
# Extended: Get an {Array} of all of the `source` {String}s with which
@@ -795,6 +797,7 @@ class Config
_.extend rootSchema, schema
@setDefaults(keyPath, @extractDefaultsFromSchema(schema))
@setScopedDefaultsFromSchema(keyPath, schema)
@resetSettingsForSchemaChange()
load: ->
@initializeConfigDirectory()
@@ -832,25 +835,35 @@ class Config
@configFileHasErrors = false
catch error
@configFileHasErrors = true
@notifyFailure('Failed to load config.cson', error)
message = "Failed to load `#{path.basename(@configFilePath)}`"
detail = if error.location?
# stack is the output from CSON in this case
error.stack
else
# message will be EACCES permission denied, et al
error.message
@notifyFailure(message, detail)
observeUserConfig: ->
try
@watchSubscription ?= pathWatcher.watch @configFilePath, (eventType) =>
@debouncedLoad() if eventType is 'change' and @watchSubscription?
catch error
@notifyFailure('Failed to watch user config', error)
@notifyFailure """
Unable to watch path: `#{path.basename(@configFilePath)}`. Make sure you have permissions to
`#{@configFilePath}`. On linux there are currently problems with watch
sizes. See [this document][watches] for more info.
[watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path
"""
unobserveUserConfig: ->
@watchSubscription?.close()
@watchSubscription = null
notifyFailure: (errorMessage, error) ->
message = "#{errorMessage}"
detail = error.stack
atom.notifications.addError(message, {detail, dismissable: true})
console.error message
console.error detail
notifyFailure: (errorMessage, detail) ->
atom.notifications.addError(errorMessage, {detail, dismissable: true})
save: ->
allSettings = {'*': @settings}
@@ -888,16 +901,10 @@ class Config
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
if value?
if value instanceof Color
value = value.clone()
else
value = _.deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
value = @deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
else
if defaultValue instanceof Color
value = defaultValue.clone()
else
value = _.deepClone(defaultValue)
value = @deepClone(defaultValue)
value
@@ -947,6 +954,16 @@ class Config
catch e
console.warn("'#{keyPath}' could not set the default. Attempted default: #{JSON.stringify(defaults)}; Schema: #{JSON.stringify(@getSchema(keyPath))}")
deepClone: (object) ->
if object instanceof Color
object.clone()
else if _.isArray(object)
object.map (value) => @deepClone(value)
else if isPlainObject(object)
_.mapObject object, (key, value) => [key, @deepClone(value)]
else
object
# `schema` will look something like this
#
# ```coffee
@@ -982,9 +999,28 @@ class Config
defaults[key] = @extractDefaultsFromSchema(value) for key, value of properties
defaults
makeValueConformToSchema: (keyPath, value) ->
value = @constructor.executeSchemaEnforcers(keyPath, value, schema) if schema = @getSchema(keyPath)
value
makeValueConformToSchema: (keyPath, value, options) ->
if options?.suppressException
try
@makeValueConformToSchema(keyPath, value)
catch e
undefined
else
value = @constructor.executeSchemaEnforcers(keyPath, value, schema) if schema = @getSchema(keyPath)
value
# When the schema is changed / added, there may be values set in the config
# that do not conform to the schema. This will reset make them conform.
resetSettingsForSchemaChange: (source=@getUserConfigPath()) ->
@transact =>
@settings = @makeValueConformToSchema(null, @settings, suppressException: true)
priority = @priorityForSource(source)
selectorsAndSettings = @scopedSettingsStore.propertiesForSource(source)
@scopedSettingsStore.removePropertiesForSource(source)
for scopeSelector, settings of selectorsAndSettings
settings = @makeValueConformToSchema(null, settings, suppressException: true)
@setRawScopedValue(null, settings, source, scopeSelector)
return
###
Section: Private Scoped Settings
@@ -1001,8 +1037,15 @@ class Config
resetUserScopedSettings: (newScopedSettings) ->
source = @getUserConfigPath()
priority = @priorityForSource(source)
@scopedSettingsStore.removePropertiesForSource(source)
@scopedSettingsStore.addProperties(source, newScopedSettings, priority: @priorityForSource(source))
for scopeSelector, settings of newScopedSettings
settings = @makeValueConformToSchema(null, settings, suppressException: true)
validatedSettings = {}
validatedSettings[scopeSelector] = withoutEmptyObjects(settings)
@scopedSettingsStore.addProperties(source, validatedSettings, {priority}) if validatedSettings[scopeSelector]?
@emitChangeEvent()
addScopedSettings: (source, selector, value, options) ->
@@ -1015,7 +1058,7 @@ class Config
disposable.dispose()
@emitChangeEvent()
setRawScopedValue: (source, selector, keyPath, value) ->
setRawScopedValue: (keyPath, value, source, selector, options) ->
if keyPath?
newValue = {}
_.setValueForKeyPath(newValue, keyPath, value)
@@ -1102,12 +1145,17 @@ Config.addSchemaEnforcers
return value unless schema.properties?
newValue = {}
for prop, childSchema of schema.properties
continue unless value.hasOwnProperty(prop)
try
newValue[prop] = @executeSchemaEnforcers("#{keyPath}.#{prop}", value[prop], childSchema)
catch error
console.warn "Error setting item in object: #{error.message}"
for prop, propValue of value
childSchema = schema.properties[prop]
if childSchema?
try
newValue[prop] = @executeSchemaEnforcers("#{keyPath}.#{prop}", propValue, childSchema)
catch error
console.warn "Error setting item in object: #{error.message}"
else
# Just pass through un-schema'd values
newValue[prop] = propValue
newValue
'array':
@@ -1152,7 +1200,7 @@ Config.addSchemaEnforcers
throw new Error("Validation failed at #{keyPath}, #{JSON.stringify(value)} is not one of #{JSON.stringify(possibleValues)}")
isPlainObject = (value) ->
_.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value)
_.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) and not (value instanceof Color)
splitKeyPath = (keyPath) ->
return [] unless keyPath?
+5 -5
Ver Arquivo
@@ -34,8 +34,8 @@ class Decoration
# Private: Check if the `decorationProperties.type` matches `type`
#
# * `decorationProperties` {Object} eg. `{type: 'gutter', class: 'my-new-class'}`
# * `type` {String} type like `'gutter'`, `'line'`, etc. `type` can also
# * `decorationProperties` {Object} eg. `{type: 'line-number', class: 'my-new-class'}`
# * `type` {String} type like `'line-number'`, `'line'`, etc. `type` can also
# be an {Array} of {String}s, where it will return true if the decoration's
# type matches any in the array.
#
@@ -107,7 +107,7 @@ class Decoration
# Public: Check if this decoration is of type `type`
#
# * `type` {String} type like `'gutter'`, `'line'`, etc. `type` can also
# * `type` {String} type like `'line-number'`, `'line'`, etc. `type` can also
# be an {Array} of {String}s, where it will return true if the decoration's
# type matches any in the array.
#
@@ -131,10 +131,10 @@ class Decoration
# ## Examples
#
# ```coffee
# decoration.update({type: 'gutter', class: 'my-new-class'})
# decoration.update({type: 'line-number', class: 'my-new-class'})
# ```
#
# * `newProperties` {Object} eg. `{type: 'gutter', class: 'my-new-class'}`
# * `newProperties` {Object} eg. `{type: 'line-number', class: 'my-new-class'}`
setProperties: (newProperties) ->
return if @destroyed
oldProperties = @properties
+2 -2
Ver Arquivo
@@ -898,7 +898,7 @@ class DisplayBuffer extends Model
@getDecorations(propertyFilter).filter (decoration) -> decoration.isType('line')
getGutterDecorations: (propertyFilter) ->
@getDecorations(propertyFilter).filter (decoration) -> decoration.isType('gutter')
@getDecorations(propertyFilter).filter (decoration) -> decoration.isType('line-number')
getHighlightDecorations: (propertyFilter) ->
@getDecorations(propertyFilter).filter (decoration) -> decoration.isType('highlight')
@@ -1222,7 +1222,7 @@ class DisplayBuffer extends Model
@emitter.emit 'did-create-marker', marker
createFoldForMarker: (marker) ->
@decorateMarker(marker, type: 'gutter', class: 'folded')
@decorateMarker(marker, type: 'line-number', class: 'folded')
new Fold(this, marker)
foldForMarker: (marker) ->
+3 -4
Ver Arquivo
@@ -19,10 +19,9 @@ class Fold
# Returns whether this fold is contained within another fold
isInsideLargerFold: ->
if largestContainingFoldMarker = @displayBuffer.findMarker(class: 'fold', containsBufferRange: @getBufferRange())
not largestContainingFoldMarker.getBufferRange().isEqual(@getBufferRange())
else
false
largestContainingFoldMarker = @displayBuffer.findFoldMarker(containsRange: @getBufferRange())
largestContainingFoldMarker and
not largestContainingFoldMarker.getRange().isEqual(@getBufferRange())
# Destroys this fold
destroy: ->
+5 -2
Ver Arquivo
@@ -33,7 +33,7 @@ Task = require './task'
#
# ```coffee
# git = atom.project.getRepo()
# console.log git.getOriginUrl()
# console.log git.getOriginURL()
# ```
#
# ### Requiring in packages
@@ -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(path)
# Public: Returns the upstream branch for the current HEAD, or null if there
# is no upstream branch for the current HEAD.
+3 -3
Ver Arquivo
@@ -163,7 +163,7 @@ GutterComponent = React.createClass
classes = ''
if lineDecorations? and decorations = lineDecorations[screenRow]
for id, decoration of decorations
if Decoration.isType(decoration, 'gutter')
if Decoration.isType(decoration, 'line-number')
classes += decoration.class + ' '
classes += "foldable " if bufferRow >= 0 and editor.isFoldableAtBufferRow(bufferRow)
@@ -195,12 +195,12 @@ GutterComponent = React.createClass
if previousDecorations?
for id, decoration of previousDecorations
if Decoration.isType(decoration, 'gutter') and not @hasDecoration(decorations, decoration)
if Decoration.isType(decoration, 'line-number') and not @hasDecoration(decorations, decoration)
node.classList.remove(decoration.class)
if decorations?
for id, decoration of decorations
if Decoration.isType(decoration, 'gutter') and not @hasDecoration(previousDecorations, decoration)
if Decoration.isType(decoration, 'line-number') and not @hasDecoration(previousDecorations, decoration)
node.classList.add(decoration.class)
unless @screenRowsByLineNumberId[lineNumberId] is screenRow
+28 -3
Ver Arquivo
@@ -20,12 +20,37 @@ KeymapManager::getUserKeymapPath = ->
KeymapManager::loadUserKeymap = ->
userKeymapPath = @getUserKeymapPath()
if fs.isFileSync(userKeymapPath)
return unless fs.isFileSync(userKeymapPath)
try
@loadKeymap(userKeymapPath, watch: true, suppressErrors: true)
catch error
if error.message.indexOf('Unable to watch path') > -1
message = """
Unable to watch path: `#{path.basename(userKeymapPath)}`. Make sure you
have permission to read `#{userKeymapPath}`.
On linux there are currently problems with watch sizes. See
[this document][watches] for more info.
[watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path
"""
atom.notifications.addError(message, {dismissable: true})
else
detail = error.path
stack = error.stack
atom.notifications.addFatalError(error.message, {detail, stack, dismissable: true})
KeymapManager::subscribeToFileReadFailure = ->
this.onDidFailToReadFile (error) ->
atom.notifications.addError('Failed to load keymap.cson', {detail: error.stack, dismissable: true})
@onDidFailToReadFile (error) =>
userKeymapPath = @getUserKeymapPath()
message = "Failed to load `#{userKeymapPath}`"
detail = if error.location?
error.stack
else
error.message
atom.notifications.addError(message, {detail: detail, dismissable: true})
# This enables command handlers registered via jQuery to call
# `.abortKeyBinding()` on the `jQuery.Event` object passed to the handler.
+1 -1
Ver Arquivo
@@ -32,7 +32,7 @@ class LanguageMode
return unless commentStartEntry?
commentEndEntry = atom.config.getAll('editor.commentEnd', {scope}).find (entry) ->
commentEndEntry = _.find atom.config.getAll('editor.commentEnd', {scope}), (entry) ->
entry.scopeSelector is commentStartEntry.scopeSelector
commentStartString = commentStartEntry?.value
commentEndString = commentEndEntry?.value
+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
@@ -176,7 +176,7 @@ class MenuManager
element?.classList.toString().split(' ') ? []
sortPackagesMenu: ->
packagesMenu = @template.find ({label}) -> MenuHelpers.normalizeLabel(label) is 'Packages'
packagesMenu = _.find @template, ({label}) -> MenuHelpers.normalizeLabel(label) is 'Packages'
return unless packagesMenu?.submenu?
packagesMenu.submenu.sort (item1, item2) ->
+7 -1
Ver Arquivo
@@ -128,9 +128,15 @@ class PackageManager
#
# Return a {String} file path to apm.
getApmPath: ->
return @apmPath if @apmPath?
commandName = 'apm'
commandName += '.cmd' if process.platform is 'win32'
@apmPath ?= path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', commandName)
apmRoot = path.resolve(__dirname, '..', 'apm')
@apmPath = path.join(apmRoot, 'bin', commandName)
unless fs.isFileSync(@apmPath)
@apmPath = path.join(apmRoot, 'node_modules', 'atom-package-manager', 'bin', commandName)
@apmPath
# Public: Get the paths being used to look for packages.
#
+3 -3
Ver Arquivo
@@ -44,11 +44,11 @@ class Package
metadata.name = packageName
if metadata.stylesheetMain?
deprecate("Use the `mainStyleSheet` key instead of `stylesheetMain` in your `package.json`", {packageName})
deprecate("Use the `mainStyleSheet` key instead of `stylesheetMain` in the `package.json` of `#{packageName}`", {packageName})
metadata.mainStyleSheet = metadata.stylesheetMain
if metadata.stylesheets?
deprecate("Use the `styleSheets` key instead of `stylesheets` in your `package.json`", {packageName})
deprecate("Use the `styleSheets` key instead of `stylesheets` in the `package.json` of `#{packageName}`", {packageName})
metadata.styleSheets = metadata.stylesheets
metadata
@@ -241,7 +241,7 @@ class Package
getStylesheetsPath: ->
if fs.isDirectorySync(path.join(@path, 'stylesheets'))
deprecate("Store package style sheets in the `styles/` directory instead of `stylesheets/`", packageName: @name)
deprecate("Store package style sheets in the `styles/` directory instead of `stylesheets/` in the `#{@name}` package", packageName: @name)
path.join(@path, 'stylesheets')
else
path.join(@path, 'styles')
+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()
+4 -4
Ver Arquivo
@@ -48,7 +48,7 @@ class PaneContainer extends Model
deserializeParams: (params) ->
params.root = atom.deserializers.deserialize(params.root, container: this)
params.destroyEmptyPanes = atom.config.get('core.destroyEmptyPanes')
params.activePane = params.root.getPanes().find (pane) -> pane.id is params.activePaneId
params.activePane = find params.root.getPanes(), (pane) -> pane.id is params.activePaneId
params
serializeParams: (params) ->
@@ -143,11 +143,11 @@ 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()
find @getPanes(), (pane) -> item in pane.getItems()
saveAll: ->
pane.saveItems() for pane in @getPanes()
+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())
+35 -10
Ver Arquivo
@@ -39,9 +39,7 @@ class Project extends Model
@emitter = new Emitter
@buffers ?= []
for buffer in @buffers
do (buffer) =>
buffer.onDidDestroy => @removeBuffer(buffer)
@subscribeToBuffer(buffer) for buffer in @buffers
Grim.deprecate("Pass 'paths' array instead of 'path' to project constructor") if path?
paths ?= _.compact([path])
@@ -68,9 +66,17 @@ class Project extends Model
buffers: _.compact(@buffers.map (buffer) -> buffer.serialize() if buffer.isRetained())
deserializeParams: (params) ->
params.buffers = params.buffers.map (bufferState) -> atom.deserializers.deserialize(bufferState)
params
params.buffers = _.compact params.buffers.map (bufferState) ->
# Check that buffer's file path is accessible
return if fs.isDirectorySync(bufferState.filePath)
if bufferState.filePath
try
fs.closeSync(fs.openSync(bufferState.filePath, 'r'))
catch error
return unless error.code is 'ENOENT'
atom.deserializers.deserialize(bufferState)
params
###
Section: Event Subscription
@@ -218,6 +224,14 @@ class Project extends Model
# Returns a promise that resolves to an {TextEditor}.
open: (filePath, options={}) ->
filePath = @resolvePath(filePath)
if filePath?
try
fs.closeSync(fs.openSync(filePath, 'r'))
catch error
# allow ENOENT errors to create an editor for paths that dont exist
throw error unless error.code is 'ENOENT'
@bufferForPath(filePath).then (buffer) =>
@buildEditorForBuffer(buffer, options)
@@ -266,7 +280,6 @@ class Project extends Model
# Still needed when deserializing a tokenized buffer
buildBufferSync: (absoluteFilePath) ->
buffer = new TextBuffer({filePath: absoluteFilePath})
buffer.setEncoding(atom.config.get('core.fileEncoding'))
@addBuffer(buffer)
buffer.loadSync()
buffer
@@ -279,10 +292,11 @@ class Project extends Model
# Returns a promise that resolves to the {TextBuffer}.
buildBuffer: (absoluteFilePath) ->
if fs.getSizeSync(absoluteFilePath) >= 2 * 1048576 # 2MB
throw new Error("Atom can only handle files < 2MB for now.")
error = new Error("Atom can only handle files < 2MB for now.")
error.code = 'EFILETOOLARGE'
throw error
buffer = new TextBuffer({filePath: absoluteFilePath})
buffer.setEncoding(atom.config.get('core.fileEncoding'))
@addBuffer(buffer)
buffer.load()
.then((buffer) -> buffer)
@@ -290,11 +304,11 @@ class Project extends Model
addBuffer: (buffer, options={}) ->
@addBufferAtIndex(buffer, @buffers.length, options)
buffer.onDidDestroy => @removeBuffer(buffer)
@subscribeToBuffer(buffer)
addBufferAtIndex: (buffer, index, options={}) ->
@buffers.splice(index, 0, buffer)
buffer.onDidDestroy => @removeBuffer(buffer)
@subscribeToBuffer(buffer)
@emit 'buffer-created', buffer
buffer
@@ -323,6 +337,17 @@ class Project extends Model
else
@on 'buffer-created', (buffer) -> callback(buffer)
subscribeToBuffer: (buffer) ->
buffer.onDidDestroy => @removeBuffer(buffer)
buffer.onWillThrowWatchError ({error, handle}) ->
handle()
atom.notifications.addWarning """
Unable to read file after file `#{error.eventType}` event.
Make sure you have permission to access `#{buffer.getPath()}`.
""",
detail: error.message
dismissable: true
# Deprecated: delegate
registerOpener: (opener) ->
deprecate("Use Workspace::addOpener instead")
+14 -8
Ver Arquivo
@@ -362,7 +362,7 @@ class Selection extends Model
precedingText = @editor.getTextInRange([[oldBufferRange.start.row, 0], oldBufferRange.start])
startLevel = @editor.indentLevelForLine(precedingText)
if options.indentBasis? and not options.autoIndent
if options.indentBasis?
text = @adjustIndent(text, startLevel - options.indentBasis)
newBufferRange = @editor.buffer.setTextInRange(oldBufferRange, text, pick(options, 'undo', 'normalizeLineEndings'))
@@ -375,8 +375,16 @@ class Selection extends Model
if options.autoIndent
precedingText = @editor.getTextInBufferRange([[newBufferRange.start.row, 0], newBufferRange.start])
unless NonWhitespaceRegExp.test(precedingText)
@editor.autoIndentBufferRow(newBufferRange.getRows()[0])
@editor.autoIndentBufferRow(row) for row, i in newBufferRange.getRows() when i > 0
rowsToIndent = newBufferRange.getRows()
firstRow = rowsToIndent.shift()
rowsToIndent.pop() if text.endsWith("\n")
suggestedIndent = @editor.suggestedIndentForBufferRow(firstRow)
actualIndent = @editor.indentationForBufferRow(firstRow)
@editor.setIndentationForBufferRow(firstRow, suggestedIndent)
indentChange = suggestedIndent - actualIndent
for row in rowsToIndent
newIndent = @editor.indentationForBufferRow(row) + indentChange
@editor.setIndentationForBufferRow(row, newIndent)
else if options.autoIndentNewline and text == '\n'
currentIndentation = @editor.indentationForBufferRow(newBufferRange.start.row)
@editor.autoIndentBufferRow(newBufferRange.end.row, preserveLeadingWhitespace: true, skipBlankLines: false)
@@ -595,14 +603,12 @@ class Selection extends Model
@editor.createFold(range.start.row, range.end.row)
@cursor.setBufferPosition([range.end.row + 1, 0])
# Public: Increases the indentation level of
#
# * `indentIncrease` The beginning indent level.
# Private: Increase the indentation level of the given text by given number
# of levels. Leaves the first line unchanged.
adjustIndent: (text, indentIncrease) ->
lines = text.split('\n')
for line, i in lines when i > 0
if indentIncrease == 0
if indentIncrease == 0 or line is ''
continue
else if indentIncrease > 0
lines[i] = @editor.buildIndentString(indentIncrease) + line
+2 -2
Ver Arquivo
@@ -224,7 +224,7 @@ TextEditorComponent = React.createClass
@props.editor.setVisible(true)
@performedInitialMeasurement = true
@updatesPaused = false
@forceUpdate() if @updateRequestedWhilePaused and @canUpdate()
@forceUpdate() if @canUpdate()
requestUpdate: ->
return unless @canUpdate()
@@ -312,7 +312,7 @@ TextEditorComponent = React.createClass
headScreenRow = null
if marker.isValid()
for decoration in decorations
if decoration.isType('gutter') or decoration.isType('line')
if decoration.isType('line-number') or decoration.isType('line')
decorationParams = decoration.getProperties()
screenRange ?= marker.getScreenRange()
headScreenRow ?= marker.getHeadScreenPosition().row
+14
Ver Arquivo
@@ -190,6 +190,20 @@ class TextEditorElement extends HTMLElement
pixelPositionForScreenPosition: (screenPosition) ->
@getModel().pixelPositionForScreenPosition(screenPosition, true)
# Extended: Retrieves the number of the row that is visible and currently at the
# top of the editor.
#
# Returns a {Number}.
getFirstVisibleScreenRow: ->
@getModel().getFirstVisibleScreenRow(true)
# Extended: Retrieves the number of the row that is visible and currently at the
# bottom of the editor.
#
# Returns a {Number}.
getLastVisibleScreenRow: ->
@getModel().getLastVisibleScreenRow(true)
# Extended: call the given `callback` when the editor is attached to the DOM.
#
# * `callback` {Function}
+2 -2
Ver Arquivo
@@ -251,8 +251,8 @@ class TextEditorView extends View
@model.pageUp()
getFirstVisibleScreenRow: ->
deprecate 'Use TextEditor::getFirstVisibleScreenRow instead. You can get the editor via editorView.getModel()'
@model.getFirstVisibleScreenRow()
deprecate 'Use TextEditorElement::getFirstVisibleScreenRow instead.'
@model.getFirstVisibleScreenRow(true)
getLastVisibleScreenRow: ->
deprecate 'Use TextEditor::getLastVisibleScreenRow instead. You can get the editor via editorView.getModel()'
+22 -17
Ver Arquivo
@@ -105,6 +105,8 @@ class TextEditor extends Model
@languageMode = new LanguageMode(this)
@setEncoding(atom.config.get('core.fileEncoding', scope: @getRootScopeDescriptor()))
@subscribe @$scrollTop, (scrollTop) =>
@emit 'scroll-top-changed', scrollTop
@emitter.emit 'did-change-scroll-top', scrollTop
@@ -354,7 +356,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 +517,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: ->
@@ -1278,7 +1284,7 @@ class TextEditor extends Model
#
# * `marker` A {Marker} you want this decoration to follow.
# * `decorationParams` An {Object} representing the decoration e.g.
# `{type: 'gutter', class: 'linter-error'}`
# `{type: 'line-number', class: 'linter-error'}`
# * `type` There are a few supported decoration types: `gutter`, `line`,
# `highlight`, and `overlay`. The behavior of the types are as follows:
# * `gutter` Adds the given `class` to the line numbers overlapping the
@@ -1307,6 +1313,9 @@ class TextEditor extends Model
#
# Returns a {Decoration} object
decorateMarker: (marker, decorationParams) ->
if decorationParams.type is 'gutter'
deprecate("Decorations of `type: 'gutter'` have been renamed to `type: 'line-number'`.")
decorationParams.type = 'line-number'
@displayBuffer.decorateMarker(marker, decorationParams)
# Public: Get all the decorations within a screen row range.
@@ -1315,7 +1324,7 @@ class TextEditor extends Model
# * `endScreenRow` the {Number} end screen row (inclusive)
#
# Returns an {Object} of decorations in the form
# `{1: [{id: 10, type: 'gutter', class: 'someclass'}], 2: ...}`
# `{1: [{id: 10, type: 'line-number', class: 'someclass'}], 2: ...}`
# where the keys are {Marker} IDs, and the values are an array of decoration
# params objects attached to the marker.
# Returns an empty object when no decorations are found
@@ -1340,7 +1349,7 @@ class TextEditor extends Model
getLineDecorations: (propertyFilter) ->
@displayBuffer.getLineDecorations(propertyFilter)
# Extended: Get all decorations of type 'gutter'.
# Extended: Get all decorations of type 'line-number'.
#
# * `propertyFilter` (optional) An {Object} containing key value pairs that
# the returned decorations' properties must match.
@@ -1743,8 +1752,8 @@ class TextEditor extends Model
addCursor: (marker) ->
cursor = new Cursor(editor: this, marker: marker)
@cursors.push(cursor)
@decorateMarker(marker, type: 'gutter', class: 'cursor-line')
@decorateMarker(marker, type: 'gutter', class: 'cursor-line-no-selection', onlyHead: true, onlyEmpty: true)
@decorateMarker(marker, type: 'line-number', class: 'cursor-line')
@decorateMarker(marker, type: 'line-number', class: 'cursor-line-no-selection', onlyHead: true, onlyEmpty: true)
@decorateMarker(marker, type: 'line', class: 'cursor-line', onlyEmpty: true)
@emit 'cursor-added', cursor
@emitter.emit 'did-add-cursor', cursor
@@ -2881,18 +2890,14 @@ class TextEditor extends Model
@placeholderText = placeholderText
@emitter.emit 'did-change-placeholder-text', @placeholderText
# Extended: Retrieves the number of the row that is visible and currently at the
# top of the editor.
#
# Returns a {Number}.
getFirstVisibleScreenRow: ->
getFirstVisibleScreenRow: (suppressDeprecation) ->
unless suppressDeprecation
deprecate("This is now a view method. Call TextEditorElement::getFirstVisibleScreenRow instead.")
@getVisibleRowRange()[0]
# Extended: Retrieves the number of the row that is visible and currently at the
# bottom of the editor.
#
# Returns a {Number}.
getLastVisibleScreenRow: ->
getLastVisibleScreenRow: (suppressDeprecation) ->
unless suppressDeprecation
deprecate("This is now a view method. Call TextEditorElement::getLastVisibleScreenRow instead.")
@getVisibleRowRange()[1]
pixelPositionForBufferPosition: (bufferPosition, suppressDeprecation) ->
+25 -8
Ver Arquivo
@@ -252,10 +252,21 @@ class ThemeManager
userStylesheetPath = atom.styles.getUserStyleSheetPath()
return unless fs.isFileSync(userStylesheetPath)
@userStylesheetFile = new File(userStylesheetPath)
@userStylesheetFile.on 'contents-changed moved removed', => @loadUserStylesheet()
userStylesheetContents = @loadStylesheet(userStylesheetPath, true)
try
@userStylesheetFile = new File(userStylesheetPath)
@userStylesheetFile.on 'contents-changed moved removed', => @loadUserStylesheet()
catch error
message = """
Unable to watch path: `#{path.basename(userStylesheetPath)}`. Make sure
you have permissions to `#{userStylesheetPath}`.
On linux there are currently problems with watch sizes. See
[this document][watches] for more info.
[watches]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path
"""
atom.notifications.addError(message, dismissable: true)
userStylesheetContents = @loadStylesheet(userStylesheetPath, true)
@userStyleSheetDisposable = atom.styles.addStyleSheet(userStylesheetContents, sourcePath: userStylesheetPath, priority: 2)
loadBaseStylesheets: ->
@@ -298,11 +309,17 @@ class ThemeManager
else
@lessCache.read(lessStylesheetPath)
catch error
console.error """
Error compiling Less stylesheet: #{lessStylesheetPath}
Line number: #{error.line}
#{error.message}
"""
if error.line?
message = "Error compiling Less stylesheet: `#{lessStylesheetPath}`"
detail = """
Line number: #{error.line}
#{error.message}
"""
else
message = "Error loading Less stylesheet: `#{lessStylesheetPath}`"
detail = error.message
atom.notifications.addError(message, {detail, dismissable: true})
removeStylesheet: (stylesheetPath) ->
@styleSheetDisposablesBySourcePath[stylesheetPath]?.dispose()
+2 -1
Ver Arquivo
@@ -1,3 +1,4 @@
{find} = require 'underscore-plus'
Grim = require 'grim'
{Disposable} = require 'event-kit'
@@ -148,4 +149,4 @@ class ViewRegistry
throw new Error("Can't create a view for #{object.constructor.name} instance. Please register a view provider.")
findProvider: (object) ->
@providers.find ({modelConstructor}) -> object instanceof modelConstructor
find @providers, ({modelConstructor}) -> object instanceof modelConstructor
+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'
+93 -21
Ver Arquivo
@@ -1,12 +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'
@@ -44,7 +46,7 @@ class Workspace extends Model
@properties
paneContainer: null
fullScreen: false
destroyedItemUris: -> []
destroyedItemURIs: -> []
constructor: (params) ->
super
@@ -385,7 +387,7 @@ class Workspace extends Model
split = options.split
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: ->
@@ -423,7 +425,7 @@ class Workspace extends Model
activatePane = options.activatePane ? true
uri = atom.project.resolvePath(uri)
item = @getActivePane().itemForUri(uri)
item = @getActivePane().itemForURI(uri)
if uri
item ?= opener(uri, options) for opener in @getOpeners() when !item
item ?= atom.project.openSync(uri, {initialLine, initialColumn})
@@ -433,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`")
@@ -443,9 +445,22 @@ class Workspace extends Model
activatePane = options.activatePane ? true
if uri?
item = pane.itemForUri(uri)
item = pane.itemForURI(uri)
item ?= opener(uri, options) for opener in @getOpeners() when !item
item ?= atom.project.open(uri, options)
try
item ?= atom.project.open(uri, options)
catch error
switch error.code
when 'EFILETOOLARGE'
atom.notifications.addWarning("#{error.message} Large file support is being tracked at [atom/atom#307](https://github.com/atom/atom/issues/307).")
when 'EACCES'
atom.notifications.addWarning("Permission denied '#{error.path}'")
when 'EPERM', 'EBUSY'
atom.notifications.addWarning("Unable to open '#{error.path}'", detail: error.message)
else
throw error
return Q()
Q(item)
.then (item) =>
@@ -467,7 +482,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()
@@ -475,7 +490,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.
@@ -485,7 +500,7 @@ class Workspace extends Model
# ## Examples
#
# ```coffee
# atom.project.addOpener (uri) ->
# atom.workspace.addOpener (uri) ->
# if path.extname(uri) is '.toml'
# return new TomlEditor(uri)
# ```
@@ -495,8 +510,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)
@@ -508,6 +532,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
###
@@ -553,7 +605,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: ->
@@ -573,8 +625,14 @@ class Workspace extends Model
catch error
if error.message.endsWith('is a directory')
atom.notifications.addWarning("Unable to save file: #{error.message}")
else if error.message.startsWith('EACCES,')
atom.notifications.addWarning("Unable to save file: #{error.message.replace('EACCES, ', '')}")
else if error.code is 'EACCES' and error.path?
atom.notifications.addWarning("Unable to save file: Permission denied '#{error.path}'")
else if error.code is 'EPERM' and error.path?
atom.notifications.addWarning("Unable to save file '#{error.path}'", detail: error.message)
else if error.code is 'EBUSY' and error.path?
atom.notifications.addWarning("Unable to save file '#{error.path}'", detail: error.message)
else if error.code is 'EROFS' and error.path?
atom.notifications.addWarning("Unable to save file: Read-only file system '#{error.path}'")
else if errorMatch = /ENOTDIR, not a directory '([^']+)'/.exec(error.message)
fileName = errorMatch[1]
atom.notifications.addWarning("Unable to save file: A directory in the path '#{fileName}' could not be written to")
@@ -617,8 +675,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.
#
@@ -651,13 +713,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: ->
+1
Ver Arquivo
@@ -11,6 +11,7 @@
@import "workspace-view";
@import "bootstrap-overrides";
@import "badges";
@import "buttons";
@import "icons";
@import "links";
+65
Ver Arquivo
@@ -0,0 +1,65 @@
@import "ui-variables";
.badge {
display: inline-block;
line-height: 1;
vertical-align: middle;
font-weight: normal;
text-align: center;
white-space: nowrap;
border-radius: 1em;
&:empty {
display: none; // Hide when un-used
}
// Color ----------------------
.badge-color( @fg: @text-color-selected;
@bg: @background-color-selected; ) {
color: @fg;
background-color: @bg;
}
.badge-color();
&.badge-info { .badge-color(white, @background-color-info); }
&.badge-success { .badge-color(white, @background-color-success); }
&.badge-warning { .badge-color(white, @background-color-warning); }
&.badge-error { .badge-color(white, @background-color-error); }
// Size ----------------------
.badge-size( @size: @font-size; ) {
@padding: round(@size/4);
font-size: @size;
min-width: @size + @padding*2;
padding: @padding round(@padding*1.5);
}
.badge-size(); // default
// Fixed size
&.badge-large { .badge-size(18px); }
&.badge-medium { .badge-size(14px); }
&.badge-small { .badge-size(10px); }
// Flexible size
// The size changes depending on the parent element
// Best used for larger sizes, since em's can cause rounding errors
&.badge-flexible {
@size: .8em;
@padding: @size/2;
font-size: @size;
min-width: @size + @padding*2;
padding: @padding @padding*1.5;
}
// Icon ----------------------
&.icon {
font-size: round(@component-icon-size*0.8);
padding: @component-icon-padding @component-icon-padding*2;
}
}
+9
Ver Arquivo
@@ -12,3 +12,12 @@
background-color: @background-color-selected;
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit; // inherit from themes
}
-1
Ver Arquivo
@@ -19,7 +19,6 @@
@import "../node_modules/bootstrap/less/input-groups.less";
@import "../node_modules/bootstrap/less/navs.less";
@import "../node_modules/bootstrap/less/labels.less";
@import "../node_modules/bootstrap/less/badges.less";
@import "../node_modules/bootstrap/less/alerts.less";
@import "../node_modules/bootstrap/less/list-group.less";
@import "../node_modules/bootstrap/less/thumbnails.less";
+8 -18
Ver Arquivo
@@ -5,25 +5,15 @@ window.onload = function() {
var fs = require('fs');
var path = require('path');
// Patch fs.statSyncNoException/fs.lstatSyncNoException to fail for non-strings
// https://github.com/atom/atom-shell/issues/843
var statSyncNoException = fs.statSyncNoException;
var lstatSyncNoException = fs.lstatSyncNoException;
fs.statSyncNoException = function(pathToStat) {
if (pathToStat && typeof pathToStat === 'string')
return statSyncNoException(pathToStat);
else
return false;
};
fs.lstatSyncNoException = function(pathToStat) {
if (pathToStat && typeof pathToStat === 'string')
return lstatSyncNoException(pathToStat);
else
return false;
};
// 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);
+2
Ver Arquivo
@@ -12,6 +12,7 @@ atom-text-editor[mini] {
font-size: @input-font-size;
line-height: @component-line-height;
max-height: @component-line-height + 2; // +2 for borders
overflow: auto;
}
atom-overlay {
@@ -155,6 +156,7 @@ atom-text-editor {
}
.indent-guide {
display: inline-block;
box-shadow: inset 1px 0;
}
+1
Ver Arquivo
@@ -138,6 +138,7 @@
}
.indent-guide {
display: inline-block;
box-shadow: inset 1px 0;
}
-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%;