Comparar commits

...

1491 Commits

Autor SHA1 Mensagem Data
Nathan Sobo fc24d687dc Move the lines individually 2014-05-09 14:37:49 -06:00
Nathan Sobo f123a9f149 Use line number and soft wrap count as key for line numbers in gutter 2014-05-07 15:36:18 -06:00
Nathan Sobo 7159b095b1 Get specs passing; use px unit on all transform dimensions always 2014-05-07 15:31:00 -06:00
Nathan Sobo 822429812a Render each line as a texture on the GPU 2014-05-07 14:58:32 -06:00
Nathan Sobo 12b8055a46 Base the visible lines on the height instead of the clientHeight
Because overlay scrollbars are invisible unless scrolling and even
regular scrollbars can be transparent.
2014-05-07 14:39:42 -06:00
Nathan Sobo d8a1a84ccf Refresh scrollbars when overlay/classic style preferences changes 2014-05-07 14:38:14 -06:00
Nathan Sobo c8dccdfe9c Only refresh editor scrollbars on stylesheet changes that require it
If a stylesheet is added or removed, we check if it contains a selector
for scrollbars before refreshing anything.
2014-05-07 14:30:16 -06:00
Nathan Sobo 3ecc070a9d Emit stylesheet-added/removed from ThemeManager w/ CSSStyleSheet objects
This enables subscribers to detect not just that stylesheets have
changed, but specifically how they have changed. This is used by the
React editor component to only refresh scrollbars when a stylesheet
that actually contains selectors for scrollbar elements is added or
removed.
2014-05-07 14:30:16 -06:00
Nathan Sobo b4acb71d8e Default scrollbar height/width to 15 when it's measure as 0
A 0 measurement indicates that overlay scrollbars are enabled, so we
just fall back to 15px in that case so the user can hover directly over
the scrollbar to scroll.
2014-05-07 14:30:16 -06:00
Nathan Sobo 29a956a29d Hide and show scrollbars before measuring them after stylesheet changes
We measure the scrollbar-corner node when there's a stylesheet change,
but Chromium won't apply the new style if it was already visible before
the change. This commit hides and shows it before measuring so we get
accurate values.
2014-05-07 14:30:16 -06:00
Nathan Sobo 95feac4789 Explicitly assign dummy scrollbars to the correct width/height
Previously, dummy scrollbars were always 15px wide/tall. This caused
them to obscure the ability to click for the entire 15px region, even if
the actual scrollbar was styled to be much thinner. Now we explicitly
measure the size of scrollbars on mount and when the stylesheets change
and set the height/width explicitly.
2014-05-07 14:30:16 -06:00
Nathan Sobo dc6c6b2a53 Hide scrollbar when not scrollable in a given direction 2014-05-07 14:30:16 -06:00
Nathan Sobo 9defc0b70a Add a dummy scrollbar corner
Horizontal / vertical scrollbars render a 'corner' on the lower right
when they would otherwise overlap. I previously relied on drawing both
dummy scrollbars at their full width/height so the corner got rendered,
but that interfered with the display of the horizontal scrollbar in
certain circumstances because it was too wide to scroll. This commit
provides that behavior with an absolutely positioned div with the same
dimensions as the intersection of scrollbars when both are visible.
2014-05-07 14:30:16 -06:00
Nathan Sobo 9b7260d94d Don't allow spec window size to interfere with the size of the editor 2014-05-07 14:30:16 -06:00
Nathan Sobo 7e208bb413 Don't obscure last character of long lines with vertical scrollbar
This entailed quite a few changes to dial in scrollbars. The scrollbars
are now adjusted in size to account for the width of the opposite
scrollbar. If the width or height are not explicitly constrained and we
are scrollable in the opposite direction that is constrained, we account
for the width of the opposite scrollbar in assigning a natural height
or width based on the content.
2014-05-07 14:30:16 -06:00
Nathan Sobo 92737e2e9f Account for gutter width in scrollWidth of horizontal scrollbar
Because the scrollbar now spans the entire editor but the scrollable
area does not include the gutter, we need to add the current width of
the gutter to the scroll width of the horizontal scrollbar to allow
it to scroll to the end of the longest lines.
2014-05-07 14:30:16 -06:00
Nathan Sobo 2706490518 Remove stray return in spec 2014-05-07 14:30:16 -06:00
Nathan Sobo 4b9e001ca1 Update line number padding when max digits changes 2014-05-07 14:30:15 -06:00
Nathan Sobo ebeb0cc652 Remove logging 2014-05-07 14:30:15 -06:00
Nathan Sobo 333f88e2c3 Fix specs that broke when accounting for horizontal scrollbar height 2014-05-07 14:30:15 -06:00
Nathan Sobo aa2f5b09f9 Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we
can't actually scroll in that direction, causing the white square where
neither scrollbar overlaps to appear at the lower right corner.
2014-05-07 14:30:15 -06:00
Nathan Sobo d27c1d1e76 Update scrollTop to valid position when scrollbar disappears 2014-05-07 14:30:15 -06:00
Nathan Sobo 9e301aa988 Revert "Revert "Don't obscure the last line of the editor with the horizontal scrollbar""
This reverts commit 1d634e471e.
2014-05-07 14:30:15 -06:00
Nathan Sobo 88aec85f92 Upgrade pathwatcher to support windows builds 2014-05-07 12:24:02 -06:00
Kevin Sawicki 61cdee9743 Upgrade to language-less@0.9.0 2014-05-07 09:20:30 -07:00
Kevin Sawicki 15c3efa6e4 💄 Add variable names for clarity 2014-05-07 09:14:42 -07:00
Kevin Sawicki a1835efb4e Merge pull request #1988 from Ferk/master
Fix for source tarballs error on 'set-version' (not a git repository)
2014-05-07 09:12:49 -07:00
Kevin Sawicki 5e0f132d33 Merge pull request #1991 from evinugur/master
ignore Thumbs.db in workspace-view and in actual atom gitignore
2014-05-07 09:05:56 -07:00
Kevin Sawicki 2c7c4c95f2 Merge pull request #2013 from pborreli/typos
Fixed typos
2014-05-07 08:56:19 -07:00
Kevin Sawicki 81f115d3db Merge pull request #2006 from Heather/patch-1
Visual C++ 2010 should be SP1
2014-05-07 08:48:48 -07:00
Kevin Sawicki c4f872acff Upgrade to apm 0.51.0 2014-05-07 08:43:25 -07:00
Nathan Sobo b3dbb18889 Upgrade reactionary for cleanup / removal of unused 'class' feature 2014-05-07 09:23:51 -06:00
Cheng Zhao 02a278d80c Mention the mkdeb task, closes #1969. 2014-05-07 22:54:20 +08:00
Nathan Sobo c7954a4c5e Upgrade path watcher for variable name fix on windows 2014-05-07 08:15:51 -06:00
Cheng Zhao 61fff23be2 Upgrade to atom-shell@0.12.3 2014-05-07 16:31:37 +08:00
Pascal Borreli 7070ed8ae4 Fixed typos 2014-05-07 08:52:58 +01:00
Heather 101b18e408 Visual C++ 2010 should be SP1
else-way there will be "failure during conversion to COFF"
description on StackOverflow: http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval
2014-05-06 22:15:45 -07:00
Cheng Zhao f0bd3b1c20 Ignore the "paste" event, fixes #1945.
Somehow on Linux the "paste" event is emitted when user presses ctrl-v,
even if the ctrl-v has been captured by window event handler. This
should be a bug of Chromium.
2014-05-07 10:39:01 +08:00
Corey Johnson 921bf8501f Merge pull request #1993 from mattbelland/docs-grammar-fix
Remove unnecessary conjunction and spaces
2014-05-06 19:30:08 -07:00
Matt Belland 594a2d201b Remove unnecessary conjunction and spaces 2014-05-06 19:19:43 -07:00
Evin Ugur cb0ba55871 ignore Thumbs.db in workspace-view and in actual atom gitignore 2014-05-06 21:24:11 -04:00
Fernando C.V 27bcf046b1 Take version from package.json also when there's no .git directory (source releases) 2014-05-07 02:55:07 +02:00
Kevin Sawicki 44f19610b6 Add grunt.cmd 2014-05-06 17:03:19 -07:00
Kevin Sawicki a1d2e253ea Upgrade to apm 0.50.0 2014-05-06 16:53:33 -07:00
Kevin Sawicki a961a8f644 Upgrade to apm@0.49.0 2014-05-06 16:14:52 -07:00
probablycorey 86b7fec0bb Update build requirements in readme 2014-05-06 15:55:10 -07:00
Kevin Sawicki 6060e0d8a9 Upgrade to symbols-view@0.51.0 2014-05-06 15:37:41 -07:00
Kevin Sawicki c160601a9d Upgrade to spell-check@0.35.0 2014-05-06 15:15:32 -07:00
Kevin Sawicki 648441ee5c Update to scrollbar-style@0.3.0 2014-05-06 15:04:59 -07:00
Kevin Sawicki 03f0e084e1 Merge pull request #1978 from kelunik/master
Use headings to enable links
2014-05-06 15:03:49 -07:00
Niklas Keller ab57dc840f Use headings to enable links 2014-05-07 00:01:59 +02:00
Kevin Sawicki a308903735 Merge pull request #1975 from giodamelio/patch-1
Add message about 64bit to the Linux requirements fixes #1973
2014-05-06 14:53:24 -07:00
Gio d'Amelio b6cb604330 Add message about 64bit to the Linux requirements fixes #1973 2014-05-06 14:52:22 -07:00
Kevin Sawicki fb557e9b90 Merge pull request #1972 from dsine-de/patch-1
fixed Windows path slash
2014-05-06 14:32:17 -07:00
dsine-de 3180ab067c fixed Windows path slash 2014-05-06 23:31:31 +02:00
Kevin Sawicki fa759d8128 Upgrade to apm 0.48.0 2014-05-06 14:10:56 -07:00
Kevin Sawicki e9ed45671f Merge pull request #1935 from tombh/1814-linux-compat-show-error-on-startup
If atom.sh has non-zero exit show errors captured by nohup. Refers to #1814
2014-05-06 13:32:17 -07:00
Kevin Sawicki 8cc871f326 Merge pull request #1957 from bogdan-kulynych/master
Add node and npm versions to Linux build instructions, as mentioned in #1814
2014-05-06 12:48:16 -07:00
Corey Johnson 3651adbefd Upgrade to language-javascript@v0.25.0 2014-05-06 12:24:09 -07:00
Bogdan ff70ded25b Correct npm version 2014-05-06 22:04:12 +03:00
Bogdan 244c06b524 Add node and npm versions to Linux build instructions, as mentioned in #1814 2014-05-06 21:44:17 +03:00
Kevin Sawicki e7309b254c Merge pull request #1951 from bonh/master
Make sure gyp uses Python 2 (#1933)
2014-05-06 11:16:36 -07:00
Jeff Bonhag 0cdce9c665 Make sure gyp uses Python 2 (#1933)
gyp/npm uses /usr/bin/python to build, which is a problem on systems where
/usr/bin/python is Python 3 or higher.  Fortunately, you can tell npm which
Python to use.
2014-05-06 14:10:40 -04:00
Kevin Sawicki 7a10bf1c33 Indent install option 2014-05-06 10:35:53 -07:00
Kevin Sawicki a6d5a4ab5d Merge pull request #1941 from qJake/master
Add Git for Windows as Windows build requirement
2014-05-06 10:34:38 -07:00
Kevin Sawicki 68f3c98872 Upgrade to apm@0.47.0 2014-05-06 10:32:39 -07:00
qJake 0b8c0cc431 Add Git for Windows as Windows build requirement 2014-05-06 12:28:16 -05:00
Kevin Sawicki d9eaf8d334 Update to scrollbar-style@0.2.0 2014-05-06 10:24:58 -07:00
Corey Johnson 8d29ec4116 Prepare 0.95.0 release 2014-05-06 10:19:14 -07:00
Kevin Sawicki 806ff4e141 Resolve path to apm
Refs #1936
2014-05-06 09:56:03 -07:00
Corey Johnson 4b0ddbf2ab Upgrade to feedback@0.32.0 2014-05-06 09:55:45 -07:00
Thomas Buckley-Houston 1ea54f8c92 🐧 If atom.sh has non-zero exit show errors captured by nohup. Refers to #1814 2014-05-06 17:21:01 +01:00
Kevin Sawicki 31cb4c58c2 Upgrade to apm@0.46.0 2014-05-06 09:15:07 -07:00
Kevin Sawicki b9bffc32b0 Upgrade to release-notes@0.29.0 2014-05-06 09:15:07 -07:00
Corey Johnson b267a781da Upgrade to welcom@0.13.0 2014-05-06 09:11:24 -07:00
Corey Johnson 6f7209c68b Upgrade to feedback@0.31.0 2014-05-06 09:06:24 -07:00
Corey Johnson fb6782ef31 Update clone url in readme 2014-05-06 08:42:18 -07:00
Kevin Sawicki fae8aafc17 Merge pull request #1929 from pierredup/patch-1
Fix link to API in README
2014-05-06 08:31:18 -07:00
Pierre du Plessis ba38dddf4d Fix link to API in README 2014-05-06 17:29:37 +02:00
Kevin Sawicki 0a4600409a Merge pull request #1927 from aaronraimist/master
Updates Jasmine link
2014-05-06 08:26:38 -07:00
Aaron Raimist 706e4476d5 Updates Jasmine link
📝
Updates Jasmine link in CONTRIBUTING.md
2014-05-06 10:25:35 -05:00
Kevin Sawicki c113a0a217 Merge pull request #1926 from bfrohs/patch-1
Show code necessary to create emoji
2014-05-06 08:24:00 -07:00
Brandon Frohs ef05278537 Show code necessary to create emoji
Touch screens without `:hover` are unable to see the tooltip.
2014-05-06 11:22:01 -04:00
Kevin Sawicki 1254425ba8 Fix windows links 2014-05-06 08:11:32 -07:00
Corey Johnson e3641286e7 Merge pull request #1924 from atom/cj-readme-requirements
Update build requirements
2014-05-06 07:48:05 -07:00
Corey Johnson 3a03f470c7 Use .bat fence instead of .sh 2014-05-06 07:43:08 -07:00
Kevin Sawicki 4ea44d9612 Prepare 0.94.0 release 2014-05-06 07:03:21 -07:00
Kevin Sawicki 15c2540c29 Merge branch 'master' into cj-readme-requirements 2014-05-06 06:49:58 -07:00
Kevin Sawicki 112f90979c Upgrade to language-xml@0.12.0 2014-05-06 06:39:10 -07:00
Kevin Sawicki cbe73fd916 Read LICENSE.md as UTF8 2014-05-06 06:39:10 -07:00
Ivan Žužak 3ea28c8ed6 Upgrade to language-gfm@0.34.0 2014-05-06 15:33:58 +02:00
Cheng Zhao 5a219a9087 Upgrade to atom-shell@0.12.2 2014-05-06 10:22:39 +08:00
Kevin Sawicki 11eae4d5db Upgrade to language-gfm@0.33.0 2014-05-05 17:43:28 -07:00
Kevin Sawicki fe4016a49d 🐧 Mention separate build/install 2014-05-05 17:37:38 -07:00
Kevin Sawicki 0b786427f4 Set CFBundleTypeIconFile to file.icns
Closes #1726
2014-05-05 17:22:33 -07:00
Kevin Sawicki 4900dc6bcd Set LSHandlerRank to Alternate
This should prevent Atom from being the default editor for all these file
types and instead make it opt-in.

Closes #1808
2014-05-05 17:22:33 -07:00
Corey Johnson 31b06b2e47 Update script/build directions 2014-05-05 17:15:59 -07:00
Corey Johnson cf6d83a896 Update windows version requirement 2014-05-05 17:13:10 -07:00
Corey Johnson 637410a8c5 Upgrade to grunt-download-atom-shell@0.7.0 2014-05-05 17:10:35 -07:00
Corey Johnson 084e4ab830 Use previous windows readme directions 2014-05-05 16:18:32 -07:00
Corey Johnson 5a53b34697 Add more specific node details 2014-05-05 16:15:10 -07:00
Corey Johnson 8f3b76d3c9 Update Windows requirements 2014-05-05 16:13:38 -07:00
Kevin Sawicki f5df111b5c Add Linux platform note and keyring install command 2014-05-05 16:05:24 -07:00
Kevin Sawicki 1d31a10dc4 Include original LICENSE.md in generated file 2014-05-05 16:01:05 -07:00
Kevin Sawicki db61de6cf3 Add .md extension to generated license 2014-05-05 15:55:34 -07:00
Kevin Sawicki c75d36ef93 Implement application:open-license in AtomWindow
Allows the LICENSE.md file to be opened even when no windows are
open.

Closes #1624
2014-05-05 15:54:47 -07:00
Corey Johnson bb2527bbb8 Add stub linux and windows requirements 2014-05-05 15:49:29 -07:00
Corey Johnson eb31c6c85f Add OS X build requirements 2014-05-05 15:33:20 -07:00
Corey Johnson 546f81f2d0 Fix spacing 2014-05-05 15:33:03 -07:00
Kevin Sawicki 7bb6cd99eb Tweak README copy 2014-05-05 13:04:22 -07:00
Kevin Sawicki 3dbdaee25c Merge pull request #1898 from atom/open-source-release
Open Source Atom
2014-05-05 12:59:19 -07:00
Kevin Sawicki b458de0f2d Merge pull request #1921 from atom/ks-split-option-errors
Fix split option errors
2014-05-05 11:36:24 -07:00
Kevin Sawicki 240747ed76 💄 Tweak spec descriptions 2014-05-05 11:28:36 -07:00
Kevin Sawicki 8b5fd64dd4 Guard against PaneAxis as first child
Pane::findLeftmostSibling expected to return a Pane, not a PaneAxis
2014-05-05 11:28:36 -07:00
Kevin Sawicki 1c514bdc6b Split right when rightmost sibling is an axis
This was previously throwing an error when Workspace::open was called
with a split: right option and the rightmost sibling was a PaneAxis
since it was assuming findOrCreateRightmostSibling was always returning
a Pane, not a PaneAxis.
2014-05-05 11:28:36 -07:00
Kevin Sawicki f4d9abc789 Use ~ instead of ^ to support older npm versions 2014-05-05 11:07:43 -07:00
Kevin Sawicki e5197f6f0f Fench code block as sh 2014-05-05 11:06:36 -07:00
Kevin Sawicki 8f57246571 Upgrade to settings-view@0.114.0 2014-05-05 11:03:55 -07:00
Kevin Sawicki 7658107e3b Merge pull request #1920 from atom/new-brand-assets
New brand assets
2014-05-05 10:29:27 -07:00
Kevin Sawicki c33227830e Add file icon for all sizes 2014-05-05 10:22:28 -07:00
Kevin Sawicki 43f2153c86 Add icons for all sizes 2014-05-05 10:14:47 -07:00
Kevin Sawicki 084d84660a Update atom.icns with single 2x 512x512 2014-05-05 09:58:12 -07:00
Cameron McEfee 4120b34d22 larger icon graphic 2014-05-05 09:51:01 -07:00
Kevin Sawicki c4a0bce92f Upgrade to tabs@0.39.0 2014-05-05 09:49:44 -07:00
Kevin Sawicki 858c18114b Update file and app icons 2014-05-05 09:39:24 -07:00
Cameron McEfee 91f9302fc4 improve aliasing on the new icon 2014-05-05 09:33:02 -07:00
Kevin Sawicki 4f3bf04668 Update atom.icns with new icon 2014-05-05 09:19:17 -07:00
Kevin Sawicki 11c9417e8d Upgrade to scope-property-store@0.9.0 2014-05-05 08:51:59 -07:00
Kevin Sawicki db141d9d7f Upgrade to markdown-preview@0.69.0 2014-05-05 08:49:01 -07:00
Cameron McEfee 5624596c88 Update the icon png 2014-05-04 15:51:41 -07:00
Cameron McEfee cda7ca047c Logo in the docs 2014-05-04 15:48:25 -07:00
Cameron McEfee ac25ad3985 Logo in the readme 2014-05-04 15:42:45 -07:00
Kevin Sawicki 1bf4e7ab96 Upgrade to first-mate 1.5.3 2014-05-02 18:08:01 -07:00
Kevin Sawicki 49587ace05 Upgrade to tree-view@0.92.0 2014-05-02 11:12:10 -07:00
Ivan Žužak 54fb06d4b0 Upgrade to release-notes@0.28.0 2014-05-02 20:02:24 +02:00
Ivan Žužak 8f81b5dc63 Upgrade to find-and-replace@0.100.0 2014-05-02 20:00:47 +02:00
Kevin Sawicki d5e1649607 Upgrade to settings-view@0.113.0 2014-05-02 10:50:46 -07:00
Kevin Sawicki e2c1f6c0e2 Upgrade to markdown-preview@0.68.0 2014-05-02 10:16:01 -07:00
Kevin Sawicki 8ec7d1273c Cache handlerPath 2014-05-01 17:05:47 -07:00
Kevin Sawicki 7ffc5cc02b Terminate task before recreating 2014-05-01 17:05:28 -07:00
Kevin Sawicki aac27db552 Upgrade to grammar-selector@0.26.0 2014-05-01 16:04:45 -07:00
Kevin Sawicki 03acb1c40a Upgrade to markdown-preview@0.67.0 2014-05-01 15:38:38 -07:00
Kevin Sawicki 5eb332042e Merge pull request #1915 from atom/ks-safe-mode
Safe mode
2014-05-01 15:30:44 -07:00
Kevin Sawicki 66943c4820 Add application:open-safe command
This opens a new "safe mode" window similar to the application:open-dev
command
2014-05-01 15:20:22 -07:00
Kevin Sawicki 4ed9e34893 Tweak option description 2014-05-01 15:20:22 -07:00
Kevin Sawicki 4f4da78e54 Add --safe argument
This will launch Atom in "safe" mode where packages from ~/.atom
will not be loaded automatically or be resolveable by name.
2014-05-01 15:20:22 -07:00
Kevin Sawicki 832dfd057e Upgrade to tabs@0.38.0 2014-05-01 15:14:39 -07:00
Kevin Sawicki dd74280146 Set status to 0 if it is ignored
The statuses obtained via the background task do not include ignored
entries so don't put ignored entries into the cache when checking the
status individually.

This was causing the fuzzy finder to show ignored paths in the status
list view after an ignored file was saved.
2014-05-01 14:20:46 -07:00
Kevin Sawicki a7d1a68fb8 Upgrade to git-utils 1.3 2014-05-01 14:13:19 -07:00
Kevin Sawicki 6b8b454625 Upgrade to symbols-view@0.50.0 2014-05-01 13:12:05 -07:00
Kevin Sawicki 5c5b7df70d Upgrade to tree-view@0.91.0 2014-04-30 16:54:32 -07:00
Corey Johnson 7d3abda86f Fix Workspace::openLicense 2014-04-30 16:38:44 -07:00
Kevin Sawicki 7f824ffbb3 Merge pull request #1914 from atom/ks-open-to-column
Open to initial column
2014-04-30 16:21:49 -07:00
Corey Johnson 0b7475a4c1 Merge remote-tracking branch 'origin/master' into open-source-release
Conflicts:
	package.json
2014-04-30 16:11:44 -07:00
Kevin Sawicki cf62d3212c Use path.join instead of hard-coded separator 2014-04-30 16:07:26 -07:00
Kevin Sawicki b260cbb43a Call open on model instead of view 2014-04-30 16:07:26 -07:00
Kevin Sawicki 1367f08de8 Parse initial column from path to open argument 2014-04-30 16:07:26 -07:00
Kevin Sawicki 27b02a7981 Add initialColumn options to Workspace::open
This options works similarly to the existing initialLine option
2014-04-30 16:07:26 -07:00
Corey Johnson e62ae02c00 Update file.icns 2014-04-30 16:04:58 -07:00
Corey Johnson 233402dd33 Update atom icon 2014-04-30 15:52:13 -07:00
Corey Johnson 69821b7a6b Add .gitignore file to dot-atom.
This will help users who want to push their .atom directory to GitHub

Closes #1094
2014-04-30 14:41:23 -07:00
Kevin Sawicki efcffe5205 Remove unused grunt task 2014-04-30 14:31:43 -07:00
Kevin Sawicki 802e651b6e 📝 Link to apm repo 2014-04-30 14:18:11 -07:00
Kevin Sawicki 0e8b951050 Upper case pane to match File menu item 2014-04-30 14:10:41 -07:00
Corey Johnson 8ef97bd78e Add menu items for pane management on windows 2014-04-30 13:59:49 -07:00
Corey Johnson 6749988de1 Add menu items for pane management
Closes #1897
2014-04-30 13:57:37 -07:00
Kevin Sawicki 4a26f8f28b Merge pull request #1912 from atom/ks-whitespace-double-click
Whitespace double click
2014-04-30 10:10:26 -07:00
Kevin Sawicki a4ee412e96 Remove Math.max corrections to range
Editor::getTextInBufferRange will clip the specified range instead.
2014-04-30 09:58:37 -07:00
Kevin Sawicki 4f655d7de5 📝 Update comment to match behavior 2014-04-30 09:58:37 -07:00
Kevin Sawicki 33c02ef3e1 Mention double clicking in spec description 2014-04-30 09:58:37 -07:00
Kevin Sawicki aa4749f175 Select all adjacent whitespace on double click
Cursor::isSurroundedByWhitespace was use column 0 instead of the
position right before the cursor.
2014-04-30 09:58:37 -07:00
Kevin Sawicki 6ace49b0e8 Merge pull request #1911 from atom/ks-preserve-indentation-when-commenting
Preserve indentation when commenting
2014-04-30 09:58:17 -07:00
Kevin Sawicki 9cf642e910 Preserve indentation when commenting
Previously this happened only when the language did not have a
comment end pattern.
2014-04-30 09:50:11 -07:00
Kevin Sawicki 2990f36595 Remove unused publish release step 2014-04-30 09:43:01 -07:00
Kevin Sawicki 032fc86a4d Merge pull request #1913 from atom/ks-no-more-atom-master-builds
Stop uploading to atom-master-builds
2014-04-30 09:35:41 -07:00
Kevin Sawicki 868cbb680c Stop uploading to atom-master-builds
Packages using Travis now build against a release build
2014-04-30 09:29:05 -07:00
Kevin Sawicki 98d2aaf10e Upgrade to language-java@0.10.0 2014-04-30 09:17:00 -07:00
Kevin Sawicki f7dead17c0 Upgrade to markdown-preview@0.66.0 2014-04-30 09:09:15 -07:00
Cheng Zhao f3168b2672 Use "closed" event instead of "destroyed".
The meaning of "destroyed" event has changed since atom-shell v0.12.0,
fixes #1910.
2014-04-30 12:25:59 +08:00
Corey Johnson e8c62b501f Fix workspaceView spec 2014-04-29 16:59:15 -07:00
Nathan Sobo 6ff2b2a01e Fix undefined variables in tokenized-line-spec 2014-04-29 17:24:16 -06:00
Kevin Sawicki 960285a270 Unfocus EditorComponent spec 2014-04-29 16:11:20 -07:00
Kevin Sawicki 17cd979299 Upgrade to apm@0.45.0 2014-04-29 15:32:00 -07:00
Kevin Sawicki b5846f9755 Upgrade to atom-keymap@0.19.0
Closes #1908
2014-04-29 09:01:54 -07:00
Kevin Sawicki dd39ffdf3b Upgrade to settings-view@0.112.0 2014-04-29 08:25:04 -07:00
Cheng Zhao 368b871270 Merge pull request #1907 from atom/atom-shell-v0.12.0
Upgrade to atom-shell@0.12.0
2014-04-29 15:49:45 +08:00
Cheng Zhao 9c06b4d344 Some events of browser-window have changed. 2014-04-29 15:25:36 +08:00
Cheng Zhao f48241bc5e Use new IPC API of atom-shell. 2014-04-29 15:16:27 +08:00
Cheng Zhao a7b94e1709 Upgrade to atom-shell@0.12.0 2014-04-29 15:09:47 +08:00
probablycorey 3d2dedb49f Update the readme 2014-04-28 14:42:31 -07:00
probablycorey dd5ab8098e Use consistent version pattern
Use `^Z` `^Z.Z` or `^Z.Z.Z`
2014-04-28 14:27:11 -07:00
Kevin Sawicki f5b833c49c Upgrade to apm 0.43.0 2014-04-28 14:06:32 -07:00
Kevin Sawicki ba032be402 Upgrade to apm@0.42.0 2014-04-28 13:20:14 -07:00
Kevin Sawicki a96a448063 Upgrade to language-go@0.10.0 2014-04-28 10:52:12 -07:00
Kevin Sawicki faeed9f604 Upgrade to snippets@0.43.0 2014-04-25 14:57:07 -07:00
probablycorey 0a8f2422d3 Use public grunt-download-atom-shell 2014-04-24 17:37:24 -07:00
Kevin Sawicki 24dbe19a82 Upgrade to language-c@0.15.0 2014-04-24 16:45:44 -07:00
Kevin Sawicki 7d8901072c Upgrade to snippets@0.42.0 2014-04-24 16:23:23 -07:00
Kevin Sawicki 848a4e2052 Merge pull request #1904 from atom/ks-remove-apm-submodule
Remove apm submodule
2014-04-24 16:21:49 -07:00
Kevin Sawicki e8090b16f3 Move apm version to apm/package.json 2014-04-24 15:43:35 -07:00
Kevin Sawicki 950964eee3 Remove directory that no longer exists 2014-04-24 15:43:35 -07:00
Kevin Sawicki b403f76d81 Remove .gitmodules 2014-04-24 15:43:35 -07:00
Kevin Sawicki 8f2cdae0eb Install apm from npmjs.org 2014-04-24 15:43:35 -07:00
Corey Johnson fa4b3c8dea Merge pull request #1903 from atom/cj-add-deprecation-warning-to-specs
Remove all deprecated calls from core
2014-04-24 15:36:53 -07:00
Kevin Sawicki e76bbc0f13 Guard against deleted submodule 2014-04-24 15:12:08 -07:00
Corey Johnson c9a377d4ac Deprecate reopenItemSync 2014-04-24 14:28:09 -07:00
Corey Johnson c7e308bca0 Remove use of OpenSync from specs 2014-04-24 14:14:10 -07:00
Corey Johnson 5193e6e46b Upgrade to text-buffer@2.2.0 2014-04-24 14:13:57 -07:00
Kevin Sawicki 66628e8c52 Update broken link to publish doc 2014-04-24 13:56:14 -07:00
Corey Johnson bec65cf2ac Only fail on deprecations when core specs are run 2014-04-24 13:47:01 -07:00
Corey Johnson 606b249430 Upgrade to grim@0.10.0 2014-04-24 13:34:56 -07:00
Kevin Sawicki 8bc1b7e955 Prepare 0.93.0 release 2014-04-24 12:07:35 -07:00
Corey Johnson 2ceccf5239 Exclude EditorViews that are mini editors from WorkspaceView::eachEditorView
Fixes #1900
2014-04-24 09:26:04 -07:00
Nathan Sobo ad8bd98c9a Don't overwrite the file-scoped path variable 2014-04-24 10:13:01 -06:00
Nathan Sobo 6c4e138ec0 Upgrade to language-ruby@0.23.0 2014-04-24 09:52:45 -06:00
Kevin Sawicki 9ad1021c2d Upgrade to settings-view@0.111.0 2014-04-23 18:14:18 -07:00
Corey Johnson c03dec2783 Merge remote-tracking branch 'origin/master' into cj-add-deprecation-warning-to-specs 2014-04-23 16:51:14 -07:00
Corey Johnson 9d92a27ccf Remove deprecated method calls from project spec 2014-04-23 16:50:25 -07:00
Corey Johnson b652dc8fd8 Use workspace.open instead of project.open 2014-04-23 16:36:44 -07:00
Corey Johnson c1929540a3 Remove deprecated calls in pane view spec 2014-04-23 16:35:51 -07:00
Corey Johnson 1601423f30 Update deprecated calls in language mode spec 2014-04-23 16:31:00 -07:00
Corey Johnson 1de2c14e50 Use TextBuffer::getEndPosition 2014-04-23 16:30:38 -07:00
Corey Johnson c1907054b7 Remove deprecated methods from display buffer spec 2014-04-23 16:24:10 -07:00
Corey Johnson 5f524c1181 Remove deprecated calls from git spec 2014-04-23 16:22:44 -07:00
Corey Johnson b897603b66 Remove deprecated option from selection spec 2014-04-23 16:22:34 -07:00
Corey Johnson 0e5c530006 Remove rogue focused spec 2014-04-23 16:19:43 -07:00
Corey Johnson 4a60b5787a Remove deprecated calls from editor view spec 2014-04-23 16:18:48 -07:00
Corey Johnson 88cc69f87a Update enableKeymap spec helper 2014-04-23 16:18:36 -07:00
Corey Johnson 42e91defb9 Rename getEofPosition to getEndPosition 2014-04-23 16:06:32 -07:00
Nathan Sobo aeb5a84696 Do render indent guides for tokens with leading whitespace 2014-04-23 17:04:20 -06:00
Nathan Sobo 228836447c Only render trailing whitespace indent guides on whitespace-only lines
Fixes #1895
2014-04-23 16:58:10 -06:00
Kevin Sawicki 832cc40a7f Add .md extension 2014-04-23 15:36:57 -07:00
Corey Johnson d89b4534f1 Update the year 2014-04-23 15:35:33 -07:00
Corey Johnson 725f6f7cf2 Use MIT license 2014-04-23 15:34:29 -07:00
Kevin Sawicki b760d3e4fc Upgrade to markdown-preview@0.65.0 2014-04-23 13:21:51 -07:00
Nathan Sobo 1d634e471e Revert "Don't obscure the last line of the editor with the horizontal scrollbar"
This reverts commit babbdbf9e5.
2014-04-23 14:03:33 -06:00
Nathan Sobo babbdbf9e5 Don't obscure the last line of the editor with the horizontal scrollbar
This assumes the scrollbar is 15px high, which is incorrect when using
overlay scrollbars or when the scrollbar is styled to have a different
height. We'll need to measure it in a subsequent commit.
2014-04-23 13:59:35 -06:00
Nathan Sobo e9d820e8a8 💄 GutterComponent 2014-04-23 13:59:35 -06:00
Nathan Sobo 16e05347a7 Remove unneeded componentWillUnmount method
It's defined in the SubscriberMixin
2014-04-23 13:59:35 -06:00
Kevin Sawicki 2574ee5936 Prepare 0.92.0 release 2014-04-23 12:02:36 -07:00
Nathan Sobo 283966dbb9 Only autoscroll selections in the model when managing scroll position 2014-04-23 12:42:02 -06:00
Corey Johnson 38c25feee0 Remove deprecated calls to editor spec 2014-04-23 11:27:23 -07:00
Kevin Sawicki f8727ffa6f Store compile cache in ~/.atom/compile-cache 2014-04-23 10:59:23 -07:00
Kevin Sawicki 1f31918373 Upgrade to pathwatcher 1.2.1 for empty file fix 2014-04-23 09:35:08 -07:00
Nathan Sobo 104aa5efc7 Merge pull request #1883 from atom/ns-react-editor-view
React Editor View, Take 2
2014-04-23 10:06:00 -06:00
Nathan Sobo 7fe0f5b445 Make parameter names explicit in delegators 2014-04-23 09:56:49 -06:00
Corey Johnson a15bb260c0 Update call to TextBuffer::rangeForRow 2014-04-22 17:52:07 -07:00
Corey Johnson 6b833043db Removed references to the isReversed option 2014-04-22 17:51:44 -07:00
Kevin Sawicki c1260d68bb Restore window when opening path
Previously the window would stay minimized if it was triggered
from the command line and was already open.

Closes #1889
2014-04-22 16:58:53 -07:00
Corey Johnson b30a2c9442 Remove deprecated calls from workspace view spec 2014-04-22 16:51:50 -07:00
Corey Johnson 3eb99c9391 Remove deprecated call from spec helper 2014-04-22 16:51:38 -07:00
Kevin Sawicki 08748b5bad Upgrade to tabs@0.37.0 2014-04-22 16:48:55 -07:00
Corey Johnson 10636b96bc buildBufferSync can't be deprecated because TokenizedBuffer uses it 2014-04-22 16:48:01 -07:00
Corey Johnson b5ac7c89a3 Update spec to match its description 2014-04-22 16:47:17 -07:00
Corey Johnson 01298bb470 Fix deprecation message 2014-04-22 16:22:23 -07:00
Nathan Sobo 752aa9a8e9 Handle editor:page-up/down commands 2014-04-22 17:10:23 -06:00
Nathan Sobo e4639281f8 Handle 'editor:scroll-to-cursor' command
Add Editor::scrollToCursorPosition in the model layer
2014-04-22 17:10:23 -06:00
Nathan Sobo f53d489abb Add DisplayBuffer::scrollToScreen/BufferPosition
Also add delegators in Editor and ReactEditorView
2014-04-22 17:10:23 -06:00
Nathan Sobo 628c2f82bd Add scrollTop/scrollLeft shims to ReactEditorView 2014-04-22 17:10:23 -06:00
Nathan Sobo df8a6437a5 Set appended view to 'position: absolute' in ::appendToLinesView 2014-04-22 17:10:22 -06:00
Nathan Sobo 1f768a21f0 Update absolute position of lines and line numbers when text changes
When lines are inserted or removed, we need to manually shift the
on-screen lines since everything is absolutely positioned now.
2014-04-22 17:10:22 -06:00
Nathan Sobo b13385b281 Subscribe to focus events with DOM api to prevent bubbling behavior
Using React's onFocus property, focus events seemed to bubble when
editors inside the editor were focused, as is the case with the
autocomplete menu.
2014-04-22 17:10:22 -06:00
Nathan Sobo 68d74e7de0 Put the hidden input component on its own layer
This avoids combining its repaint with the scrollbar's cursor position
when the cursor moves.
2014-04-22 17:10:22 -06:00
Nathan Sobo c730e3c67e Ensure selections span the entire screen, even when lines are short
Also, pass scrollHeight and scrollWidth as props to child components
instead of calling the method to compute them in multiple components.
2014-04-22 17:10:22 -06:00
Nathan Sobo 22496ceeb1 WIP: Minimize paint when scrolling and composite lines with the GPU 2014-04-22 17:10:22 -06:00
Nathan Sobo a03f2f46ee Don't assume tokens match text nodes when measuring character widths 2014-04-22 17:10:22 -06:00
Nathan Sobo afec8f1ca0 Account for height of hidden input when positioning it 2014-04-22 17:10:22 -06:00
Nathan Sobo 43e6fb73f1 Focus react editor on attachment if it had focus previously 2014-04-22 17:10:22 -06:00
Nathan Sobo a271e52a4e Never assign a 0 height or width when measuring editor scroll view 2014-04-22 17:10:22 -06:00
Nathan Sobo 274ca33959 Don't measure height and width unless component is mounted
Since we measure in requestAnimationFrame, it's possible to request
measurement prior to be unmounted and have it occur afterward.
2014-04-22 17:10:22 -06:00
Nathan Sobo 10d6ec156f Unsubscribe EditorComponent before unmounting 2014-04-22 17:10:22 -06:00
Nathan Sobo 4e27e765d0 Measure width and height when window size changes
Since overflowchanged events are paused for a bit after updates to
prevent thrashing, this ensures the editor is still updated promptly
when resizing.
2014-04-22 17:10:22 -06:00
Nathan Sobo 168cda4f75 Pause measurement on overflowchanged during updates
Content updates trigger overflowchanged, but we're mainly using it to
detect when the editor component has been resized. Pausing measurement
during content updates makes them faster.
2014-04-22 17:10:21 -06:00
Nathan Sobo fdccc0bcc2 Measure DOM dimensions before rendering elements that depend on them
This commit breaks the initial render of the editor component into two
stages.

The first stage just renders the shell of the editor so the height,
width, line height, and default character width can be measured. Nothing
that depends on these values is rendered on the first render pass.

Once the editor component is mounted, all these values are measured and
we force another update, which fills in the lines, line numbers,
selections, etc.

We also refrain from assigning an explicit height and width on the
model if these values aren't explicitly styled in the DOM, and just
assume the editor will stretch to accommodate its contents.
2014-04-22 17:10:21 -06:00
Nathan Sobo d566726b9f Use negative z-indices so attached views are visible in react editor 2014-04-22 17:10:21 -06:00
Nathan Sobo e9f2a536ed Add more shims to ReactEditorView 2014-04-22 17:10:21 -06:00
Nathan Sobo 2532527a6a Add editor-colors class to EditorComponent 2014-04-22 17:10:21 -06:00
Nathan Sobo f10076c87d Prevent activation events from bubbling
The react editor is wrapped in another div with the class of .editor for
backward compatibility. This prevents activation events registered on
the .editor selector from being triggered twice.
2014-04-22 17:10:21 -06:00
Nathan Sobo 083f65ed5d Remove envify dependency 2014-04-22 17:10:21 -06:00
Nathan Sobo f59a8f1e68 Return function arg's result from Editor::batchUpdates 2014-04-22 17:09:45 -06:00
Nathan Sobo bef554709f Emit 'cursor:moved' event to update cursor position in status bar
Emitting the event *before* update, rather than after. This is because
we read from the DOM after update to measure new characters, which
forces layout, so emitting the event after measuring forces another
layout when the position is updated.
2014-04-22 17:09:45 -06:00
Nathan Sobo e5379515b9 Transfer focus to ReactComponent when wrapper view is focused 2014-04-22 17:09:45 -06:00
Nathan Sobo a0ff6f5325 Handle 'autoscroll' option in model when setting selected buffer range 2014-04-22 17:09:45 -06:00
Nathan Sobo dd4b6a6d28 Don't render empty selections 2014-04-22 17:09:45 -06:00
Nathan Sobo 51ee591282 Don't render cursors for non-empty selections 2014-04-22 17:09:45 -06:00
Nathan Sobo 19a5269a5f Remove metaprogrammed method delegators 2014-04-22 17:09:45 -06:00
Nathan Sobo 9b6fa967be Handle the editor:consolidate-selections command in the React editor 2014-04-22 17:09:45 -06:00
Nathan Sobo 201e00aa83 Don't measure new lines when scrolling with the mousewheel
It impacts scrolling performance. We can measure when scrolling comes
to a halt.
2014-04-22 17:09:44 -06:00
Nathan Sobo f02d956362 Preserve the only the target screen row when scrolling via mousewheel
When the target of a mousewheel event is removed, it breaks velocity
scrolling.

Previously, we were preserving the entire screen range when scrolling
with the mouse wheel, which caused a lot of DOM nodes to accumulate. Now
we only preserve the individual line and line number associated with the
target of the mousewheel event, moving them just off screen below all
the on-screen lines and line numbers. This keeps the number of DOM nodes
limited while retaining velocity effects.
2014-04-22 17:09:44 -06:00
Nathan Sobo 798739f837 Use beforeRemove instead of non-existent beforeDetach 2014-04-22 17:09:44 -06:00
Nathan Sobo 216d561c79 Delay creating range and node iterator until we actually need to measure 2014-04-22 17:09:44 -06:00
Nathan Sobo 6607f99c6c Use padding-top/bottom rather than spacer divs in lines and gutter
It creates a simpler DOM structure.
2014-04-22 17:09:44 -06:00
Nathan Sobo 3a42346e5e Pause cursor blink as part of the overall editor update
This ensures we don't perform two updates of the cursors component when
cursors move as part of a larger change, such as typing text.
2014-04-22 17:09:44 -06:00
Nathan Sobo ae9f79bfc4 Only add indent guide to trailing whitespace on whitespace-only lines 2014-04-22 17:09:44 -06:00
Nathan Sobo 5a9a3c62e1 Implement shouldComponentUpdate for LinesComponent
We accumulate pending changes and pass them to the lines and the gutter
to help them determine whether to update. The lines only update if the
visible row range changed or if there was a change in the visible row
range.
2014-04-22 17:09:44 -06:00
Nathan Sobo d678f367db Clear cursor blink interval when editor component unmounts 2014-04-22 17:09:44 -06:00
Nathan Sobo febfb120c8 Fix typo 2014-04-22 17:09:44 -06:00
Nathan Sobo addbe80e8a Update the gutter if the scrollTop has changed 2014-04-22 17:09:44 -06:00
Nathan Sobo b96abfffb7 Add more displayNames 2014-04-22 17:09:44 -06:00
Nathan Sobo a6f2e926fe Upgrade to underscore-plus@1.2.1 for optimized isEqualForProperties 2014-04-22 17:09:44 -06:00
Nathan Sobo 550a4ce906 Use isEqualForProperties in LinesComponent to decide when to re-measure 2014-04-22 17:09:43 -06:00
Nathan Sobo 1a56b487a1 Stop propagation of input events to prevent react from doing extra work
React seems to be handling these events when they bubble to the root of
the document. We want to avoid wasting time on this.
2014-04-22 17:09:43 -06:00
Nathan Sobo 4fa9c64c2b Drop batchedUpdates on input since we're batching in the model anyway 2014-04-22 17:09:43 -06:00
Nathan Sobo 56e5fb7a63 Set process.env.NODE_ENV to 'production' to speed up React 2014-04-22 17:09:43 -06:00
Nathan Sobo efa72bcb1c Implement shouldComponentUpdate for GutterComponent
Only update the gutter when the visible row range has changed or if
a screen lines change has occurred within the visible row range.
2014-04-22 17:09:43 -06:00
Nathan Sobo 033db8997b Batch updates when moving cursors
This ensures that updates associated with autoscroll and cursor movement
get combined.
2014-04-22 17:09:43 -06:00
Nathan Sobo 64a487eebb Implement shouldComponentUpdate for ScrollbarComponent
It checks that the incoming scrollTop/Left and scrollHeight/Width differ
from their current values. The scrollTop/Left value are updated in
the component properties to always reflect the state of the DOM when
scrolling or when assigning a new value.
2014-04-22 17:09:43 -06:00
Nathan Sobo ddc677fb30 Batch multiple view updates with Editor::batchUpdates 2014-04-22 17:09:43 -06:00
Nathan Sobo fe6a007774 Call requestUpdate instead of forceUpdate so we can track all updates 2014-04-22 17:09:43 -06:00
Nathan Sobo 48d90e3dfc Funnel cursor and selection updates through EditorComponent 2014-04-22 17:09:43 -06:00
Nathan Sobo f457b41a81 Assign a key to cursor and selection components 2014-04-22 17:09:43 -06:00
Nathan Sobo 93388c2048 Make Cursor and Selection models for automatic id assignment 2014-04-22 17:09:43 -06:00
Nathan Sobo 66f3f2d883 Add displayName to components 2014-04-22 17:09:42 -06:00
Nathan Sobo 3657dc0bf4 💄 2014-04-22 17:09:42 -06:00
Nathan Sobo 274288161d Make line number components immutable 2014-04-22 17:09:42 -06:00
Nathan Sobo 0d03e388f1 💄 spec description 2014-04-22 17:09:42 -06:00
Nathan Sobo 507106d35b 💄 method order 2014-04-22 17:09:42 -06:00
Nathan Sobo eeba559ec7 Add a SelectionsComponent containing all selections 2014-04-22 17:09:42 -06:00
Nathan Sobo 14bfa90004 Extract a CursorsComponent containing all cursors 2014-04-22 17:09:42 -06:00
Nathan Sobo 0ec6cbe141 💄 method order 2014-04-22 17:09:42 -06:00
Nathan Sobo e952ab2e02 Extract a LinesComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo 5c2eb053d8 Extract an EditorScrollView component 2014-04-22 17:09:42 -06:00
Nathan Sobo aee552476a Call onScroll with the current scrollTop/Left in ScrollbarComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo 355abef2cf Manage update of scrollbar scroll positions in ScrollbarComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo cec62c56a6 Extract a ScrollbarComponent 2014-04-22 17:09:41 -06:00
Nathan Sobo 35ea4e6de4 Extract gutter to its own component 2014-04-22 17:09:41 -06:00
Nathan Sobo 8c266957f1 Isolate CSS changes to a single selector 2014-04-22 17:09:41 -06:00
Nathan Sobo f1f93f2f70 Spy on setInterval explicitly when needed in EditorComponent spec 2014-04-22 17:09:41 -06:00
Nathan Sobo de773e4f75 Revert "Remove setInterval spy. It's now spied in the spec helper w/ setTimeout"
This reverts commit 930f1d7f018bb9949b0ee0e4ca7330a8a4ce0ec7.

I actually don't want to globally spy on setInterval because it interferes with
expected behaviors and eventually I'd like both of these to be opt-in.
2014-04-22 17:09:41 -06:00
Nathan Sobo 205e10fd09 Fix undefined variable references rendering lines 2014-04-22 17:09:41 -06:00
Nathan Sobo ca4dd5a29a Explicitly disable use of react editor in specs 2014-04-22 17:09:41 -06:00
Nathan Sobo 2517765821 Rename 'core.useNewEditor' to 'core.useReactEditor' and default to false 2014-04-22 17:09:41 -06:00
Nathan Sobo 4b9871fa13 Enable advanced scroll management only when editor is used by react view
This preserves the original behavior of the editor model with respect
to scroll position and autoscroll unless it's being used by the react
component, which flips the ::manageScrollPosition flag to true.
2014-04-22 17:09:41 -06:00
Nathan Sobo 28dd7d4acd Treat all whitespace lines as not having leading whitespace
Instead it's treated as all trailing whitespace, as it was originally.
2014-04-22 17:09:41 -06:00
Nathan Sobo e3eb51c135 Don't expect trailing whitespace invisibles on soft-wrapped lines
Now that trailing whitespace status of tokens is assigned at
construction time, we no longer render invisibles at the end of
soft-wrapped lines. Pretty sure this is not a behavior we wanted anyway.
2014-04-22 17:09:41 -06:00
Nathan Sobo 9ec38ddb0d Remove setInterval spy. It's now spied in the spec helper w/ setTimeout 2014-04-22 17:09:41 -06:00
Nathan Sobo 7a4dc0b9a4 Eliminate duplicate key to pass coffeelint 2014-04-22 17:09:40 -06:00
Nathan Sobo 6b4ce5f205 Add shims to get git-diff-view working 2014-04-22 17:09:40 -06:00
Nathan Sobo 9a3f8022ad Add shims to get bracket matcher working 2014-04-22 17:09:40 -06:00
Nathan Sobo a2a625a7bb Add ReactEditorView::getPane for backward-compatibility 2014-04-22 17:09:40 -06:00
Nathan Sobo 495b1571ca Add 'editor' class to ReactEditorView wrapper for backward compatibility 2014-04-22 17:09:40 -06:00
Nathan Sobo c862ccbc56 Add command listeners to SpacePen wrapper for backward compatibility
This is the only way to integrate with the command palette currently.
2014-04-22 17:09:40 -06:00
Nathan Sobo 59709a92ba Include SpacePen wrapper view in spec
During the transition to React, it will be easier if the EditorComponent
assumes it's rendered inside the ReactEditorView. This will make it
easier to test compatibility with existing editor APIs.
2014-04-22 17:09:40 -06:00
Nathan Sobo 022f5ca219 Replace previous character when inserting accented characters 2014-04-22 17:09:40 -06:00
Nathan Sobo 96ebb9bf03 Correctly position cursor on mousedown when editor is scrolled left 2014-04-22 17:09:40 -06:00
Nathan Sobo 95b24fb933 Position the hidden input on the most recent cursor when in view
We won't position the hidden input out of the scroll view's bounds to
prevent Chromium's autoscrolling behavior.
2014-04-22 17:09:40 -06:00
Nathan Sobo 9bdc78df2e Correctly render lines containing only whitespace 2014-04-22 17:09:40 -06:00
David Graham & Nathan Sobo 241731f9c8 Render indent guides on empty lines 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 6997adece9 Associate TokenizedLines with an ::indentLevel
This can be used to render the appropriate number of indent guide spans
for empty lines.
2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo d0a917ed14 Prevent scrollLeft/scrollTop from going out of bounds 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 7fc2e0b540 Wire up the editor.showIndentGuide setting 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 1c48f60e42 Render indent guide for react editors on non-empty lines 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 6b10fcc2f8 Rely on token's knowledge of its own leading/trailing whitespace status
Previously, we were determining this at render time. But its baked into
the state of tokens when TokenizedLines are constructed now so we no
longer need to compute it when rendering.
2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo cf27826156 Mark tokens on whitespace-only lines as having leading whitespace
This makes it easy to decide to render the indent guide for a token. If
the token has leading whitespace, we can render it.
2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 5e38add177 Only mark trailing whitespace on the last segment of a soft-wrapped line 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo b4af0a79d0 Mark tokens with leading/trailing whitespace when building TokenizedLine 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 616b9e4b7d 💄 Rename breakOutLeadingWhitespace to breakOutLeadingSoftTabs 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 985662b8f0 Only scroll in one direction a time with the mousewheel 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo cfdea7e73f Update the scrollLeft of the model when the horizontal scrollbar changes 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo 48135a1e8d Update the horizontal scrollbar when scrollLeft changes in the model 2014-04-22 17:09:38 -06:00
Nathan Sobo 81233a696b Set default horizontalScrollMargin 2014-04-22 17:09:38 -06:00
Nathan Sobo 84bb624b5b Set x-transform of .scroll-view-content based on the model's scrollLeft 2014-04-22 17:09:38 -06:00
Nathan Sobo 171631d20f Autoscroll cursors horizontally at the model layer
Still need to respect the horizontal scroll position in the editor view
2014-04-22 17:09:38 -06:00
Nathan Sobo 486a7937b5 Render • instead of line number for soft-wrapped lines 2014-04-22 17:09:38 -06:00
Nathan Sobo 1162af61ed Render a basic gutter 2014-04-22 17:09:38 -06:00
Nathan Sobo a931aaff53 Remove temporary cursor visibility styling 2014-04-22 17:09:38 -06:00
Nathan Sobo 0fd8c5441c 💄 spec organization 2014-04-22 17:09:38 -06:00
Nathan Sobo f5551929d8 Account for half-visible lines in DisplayBuffer::getVisibleRowRange
We need to add 1 to the editor's height in lines, because it's possible
to have *partially visible* lines at the top and the bottom.
2014-04-22 17:09:38 -06:00
Nathan Sobo 4a501a7c31 Fix incorrect triple-click spec 2014-04-22 17:09:38 -06:00
Nathan Sobo 44413912bc Assign fontSize based on editor.fontSize config key 2014-04-22 17:09:38 -06:00
Nathan Sobo d0c61eb2be Pause cursor blinking when the cursor moves 2014-04-22 17:09:38 -06:00
Nathan Sobo 5c9a5cdc85 Emit 'cursors-moved' from editor when one or more cursors move 2014-04-22 17:09:37 -06:00
Nathan Sobo 2b0ef68255 Blink cursors always. Still need to pause blinking when moving. 2014-04-22 17:09:37 -06:00
Nathan Sobo f60f9b9f4f Add 'is-focused' class to editor when hidden input is focused 2014-04-22 17:09:37 -06:00
Nathan Sobo 4f10500102 Select lines on triple-click 2014-04-22 17:09:37 -06:00
Nathan Sobo 096afcf6f3 Finalize selections on mouseup 2014-04-22 17:09:37 -06:00
Nathan Sobo 2204571ef5 Select words on double-click 2014-04-22 17:09:37 -06:00
Nathan Sobo cbad8a56ec Don't start the animation loop until the mouse starts dragging
Previously, the animation loop would run multiple times prior to the
the mouseup event on click. We only want to select to the current mouse
position if the mouse is actually dragged.
2014-04-22 17:09:37 -06:00
Nathan Sobo c4be3069f7 Select on mouse drag 2014-04-22 17:09:37 -06:00
Nathan Sobo accee294dc Test against real mousedown events dispatched on the .lines DOM node 2014-04-22 17:09:37 -06:00
Nathan Sobo 1239ab540f 💄 spec descriptions 2014-04-22 17:09:37 -06:00
Nathan Sobo 5a0d7e716b When cmd-clicking, add a new cursor at the nearest screen position 2014-04-22 17:09:37 -06:00
Nathan Sobo af9355e4e6 Add Editor::getSelectedScreenRanges 2014-04-22 17:09:37 -06:00
Nathan Sobo 7738e74df0 When shift-clicking, select to the clicked position 2014-04-22 17:09:36 -06:00
Nathan Sobo 3a433f734c Move the cursor on single click 2014-04-22 17:09:36 -06:00
Nathan Sobo b0ad5e2f69 💄 2014-04-22 17:09:36 -06:00
Nathan Sobo 0c960552f0 Batch updates on input events 2014-04-22 17:09:36 -06:00
Nathan Sobo 8772e96935 Temporarily remove '.editor' class from react editor wrapper
This will prevent warnings from packages during testing.
2014-04-22 17:09:36 -06:00
Nathan Sobo e24196c0ef Require React directly rather than via reactionary
Reactionary is just a tiny helper library that can rely on the react
installed by the requiring application instead.
2014-04-22 17:09:36 -06:00
Nathan Sobo b879221a96 💄 Clarify variable name 2014-04-22 17:09:05 -06:00
Nathan Sobo 97a353b31a Measure each line with a fresh range
Recycling the range leads to strange timing-related measurement errors
in certain cases.
2014-04-22 17:09:05 -06:00
Nathan Sobo 57e2cf80f4 💄 Reorganize spec 2014-04-22 17:09:05 -06:00
Nathan Sobo 669586c11b 💄 2014-04-22 17:09:05 -06:00
Nathan Sobo 5b79bb7f66 Wait longer to clear preserved lines after mousewheel events 2014-04-22 17:09:05 -06:00
Nathan Sobo fd2ed9a1bc Prevent scroll event feedback loops after scrolling via the model layer
When scrolling via the model layer, such as happens on autoscroll due to
moving the cursor, we update the scroll position of the fake vertical
scrollbar manually. When we receive the scroll event that results from
this, we want to do nothing. The best way to determine whether we're
getting a "real" scroll event from the user or feedback from setting
the scrollTop ourselves is to compare the scrollTop to what's in the
model. If the values are equal, there's no need to request an animation
frame to assign it. This improves performance.
2014-04-22 17:09:04 -06:00
Nathan Sobo 95bf08dfa0 Eliminate overlayer by preserving lines during mousewheel events
Previously, the overlayer served as a permanent target for mousewheel
events that would never be removed by scrolling. This is because the
velocity scrolling effect on a trackpad is implemented by repeating
events on the original mousewheel event target. If this target is
removed, the events stop repeating and the velocity effect is ruined.
Now we refrain from removing any lines until mousewheel events stop
flowing.
2014-04-22 17:09:04 -06:00
Nathan Sobo 3d3b72a954 Render selections 2014-04-22 17:09:04 -06:00
Nathan Sobo 724babdcb6 Only update vertical scrollbar's scrollTop if it has changed 2014-04-22 17:09:04 -06:00
Nathan Sobo bad2cebd6e Add Editor::setSelectedScreenRange 2014-04-22 17:09:04 -06:00
Nathan Sobo 565b611c18 Do a better job imitating the old SpacePen-based editor 2014-04-22 17:09:04 -06:00
Nathan Sobo 1b8f23722b Correctly close scope spans when rendering line HTML 2014-04-22 17:09:04 -06:00
Nathan Sobo ab02d5f25f Update the vertical scroll bar when scrollTop changes in the model 2014-04-22 17:09:04 -06:00
Nathan Sobo e472d7b038 Add autoscrolling with react editor view
Its implemented in the model to restrict touching of the DOM.
2014-04-22 17:09:04 -06:00
Nathan Sobo ba83b0ede0 Update height of DisplayBuffer from editor component on overflow changed 2014-04-22 17:09:04 -06:00
Nathan Sobo 96e6ddac2e Prevent out-of-bounds scrollTop assignment on DisplayBuffer 2014-04-22 17:09:04 -06:00
Nathan Sobo 08bd03b706 Opt in to editor view only when core.useNewEditor is true 2014-04-22 17:09:04 -06:00
Nathan Sobo 2f42f23ec6 Revert changes to editor-view 2014-04-22 17:09:03 -06:00
Nathan Sobo 5a8ca1ae66 Move screen-related properties to DisplayBuffer
Scroll positions, height, width, line height. We force update when one
of these observed properties changes.
2014-04-22 17:09:03 -06:00
Nathan Sobo 9898cbc52e Remove space-pencil dependency 2014-04-22 17:09:03 -06:00
Nathan Sobo 53cc5c9856 Base cursor x position on char widths stored in DisplayBuffer
Whenever new lines are added to the screen, we measure and store any
unseen scope/character combinations in the DisplayBuffer.
2014-04-22 17:09:03 -06:00
Nathan Sobo 148a9f0248 Add DisplayBuffer::pixelPositionForScreenPosition
This bakes character width tracking into display buffer directly, which
moves us toward a world where all rendering decisions can be made in the
model to strictly control DOM reads.
2014-04-22 17:09:03 -06:00
Nathan Sobo 48e2302ccb Handle almost all editor commands in EditorComponent 2014-04-22 17:09:03 -06:00
Nathan Sobo 6327094696 Transfer focus from editor component to its hidden input 2014-04-22 17:09:03 -06:00
Nathan Sobo c4fdb54650 Update editor component when a visible selection is removed 2014-04-22 17:09:03 -06:00
Nathan Sobo a55c329226 💄 2014-04-22 17:09:03 -06:00
Nathan Sobo e365e51a2b Render all visible cursors 2014-04-22 17:09:03 -06:00
Nathan Sobo c44fd62eb1 Update cursor view when selection screen position changes 2014-04-22 17:09:03 -06:00
Nathan Sobo 9c2d321327 Break out selection, cursor, and input components 2014-04-22 17:09:02 -06:00
Nathan Sobo 70e5880b1d Start on cursor rendering 2014-04-22 17:09:02 -06:00
Nathan Sobo 61d9ff4ba4 Put the hidden input in the overlayer
The overlayer is absolutely positioned to exactly fill the scroll-view.
If we can retain this strategy and never give the input a position that
exceeds the bounds of the overlayer, we can guarantee that it never
forces the scroll position of the scroll view to change when it is
focused due to the browsers default behavior.
2014-04-22 17:09:02 -06:00
Nathan Sobo e4c1bf10f5 Handle basic input 2014-04-22 17:09:02 -06:00
Nathan Sobo c2858fcae2 Use overflow: hidden for editor 2014-04-22 17:09:02 -06:00
Nathan Sobo fddd411279 Use className instead of class
Might as well go with the flow
2014-04-22 17:09:02 -06:00
Nathan Sobo 2dda577d7c Improve TokenizedLine::getScopeTree specs and fix bug 2014-04-22 17:09:02 -06:00
Nathan Sobo 958bc638d7 Improve scrolling performance 2014-04-22 17:09:02 -06:00
Nathan Sobo 33ed403818 Update editor with tokenized lines when it appears on screen. 2014-04-22 17:09:02 -06:00
Nathan Sobo 3c69fd2d49 Handle mouse wheel and make some tweaks to improve scroll performance 2014-04-22 17:09:02 -06:00
Nathan Sobo a134a60ce8 Render the entire editor with React. Handle vertical scrolling.
The space-pen view is now a simple wrapper around the entire React
component to integrate it cleanly into our existing system. React
components can't adopt existing DOM nodes, otherwise I would just have
the react component take over the entire view instead of wrapping.
2014-04-22 17:09:02 -06:00
Nathan Sobo 9c49a2d970 Use reactionary helper for creating virtual DOM elements 2014-04-22 17:09:01 -06:00
Nathan Sobo 8cd9160ed5 Add space-pencil dependency 2014-04-22 17:09:01 -06:00
Nathan Sobo 8ad13d3045 Add a real spec for visible line rendering in the react editor view 2014-04-22 17:09:01 -06:00
Nathan Sobo cc8ba2d679 Update the rendered lines when the screen lines change 2014-04-22 17:09:01 -06:00
Nathan Sobo da36d5f40f Start experimenting with an EditorView that renders content with React 2014-04-22 17:09:01 -06:00
Corey Johnson 3bd7bfcbf1 Merge remote-tracking branch 'origin/master' into cj-add-deprecation-warning-to-specs 2014-04-22 16:06:04 -07:00
Kevin Sawicki 9904a9a197 Upgrade to pathwatcher 1.2 2014-04-22 14:40:13 -07:00
Corey Johnson 3e94c0be22 Remove deprecated methods from window spec 2014-04-22 14:19:13 -07:00
Corey Johnson db0cce6234 Remove focused spec 2014-04-22 14:19:01 -07:00
Corey Johnson f3d4cbbd8f Remove unnecessary fat arrows 2014-04-22 14:15:56 -07:00
Corey Johnson 81df4ed238 Change Workspace::reopenItemSync to use promises 2014-04-22 14:15:07 -07:00
Corey Johnson 7b756ec3f3 Remove calls to openSync from the workspace-spec 2014-04-22 11:24:27 -07:00
Kevin Sawicki 7250a9e407 Upgrade to base16-tomorrow-dark-theme@0.15.0 2014-04-22 11:19:17 -07:00
Kevin Sawicki 1a02b2ec98 Upgrade to atom-light-syntax@0.17.0 2014-04-22 11:06:32 -07:00
Corey Johnson 0d95718d1f Remove focused spec 2014-04-22 11:04:14 -07:00
Corey Johnson 1da23e8d04 Remove deprecations from atom-spec 2014-04-22 11:01:21 -07:00
Corey Johnson 43792d019a Output deprecation message 2014-04-22 11:01:05 -07:00
Corey Johnson ec0b4a2dc6 Move deprecation output to its own function 2014-04-22 10:44:25 -07:00
Kevin Sawicki 94c860e936 Upgrade to language-sass@0.10.0 2014-04-22 10:43:11 -07:00
Kevin Sawicki 1aeb32eb81 Upgrade to first-mate 1.5.2
Refs atom/language-make#6
2014-04-22 10:27:20 -07:00
Corey Johnson 1083136dec Don't allow specs that call deprecated methods to pass 2014-04-22 10:11:52 -07:00
Corey Johnson e450e61248 Fix broken spec 2014-04-22 10:01:24 -07:00
Corey Johnson fd7951b2c6 Remove focused spec 2014-04-22 09:51:15 -07:00
Kevin Sawicki 743e79b659 Look at first character instead of indexOf call 2014-04-22 09:35:30 -07:00
Kevin Sawicki 3d10c3856b Replace all periods with a single space
Refs atom/language-make#6
2014-04-22 09:33:17 -07:00
Kevin Sawicki d5df83e872 Upgrade to language-sass@0.9.0 2014-04-21 10:40:28 -07:00
Kevin Sawicki 248948b217 Prepare 0.91.0 release 2014-04-21 09:44:01 -07:00
Kevin Sawicki 7d3553659a Update to apm 0.40.0 2014-04-21 09:32:53 -07:00
Corey Johnson 28dad3a01a Upgrade command-palette and deprecation-cop 2014-04-21 09:24:23 -07:00
Corey Johnson be872c2fdd Merge pull request #1868 from atom/cj-deprecation-cop
Add deprecation-cop dependency
2014-04-18 16:08:32 -07:00
Corey Johnson 526d87c355 Merge branch 'cj-remove-deprecated-calls' into cj-deprecation-cop 2014-04-18 15:57:28 -07:00
Corey Johnson cbeb0187da Merge remote-tracking branch 'origin/master' into cj-deprecation-cop 2014-04-18 15:56:40 -07:00
Kevin Sawicki 7c614c6c79 Upgrade to base16-tomorrow-dark-theme@0.14.0 2014-04-18 15:55:59 -07:00
Corey Johnson f4f0b4be72 Upgrade text-buffer and atom-keymap 2014-04-18 15:50:30 -07:00
Corey Johnson 3e27beeafa Update packages 2014-04-18 15:50:30 -07:00
Corey Johnson 4a6b70d261 Use Marker::get/setProperties 2014-04-18 15:50:30 -07:00
Corey Johnson 5917f71685 Use KeymapManager::findKeyBindings 2014-04-18 15:50:30 -07:00
Corey Johnson fb42c499b1 Use KeymapManager::handleKeyboardEvent 2014-04-18 15:50:30 -07:00
Corey Johnson 1583271e2f Use setTextInRange instead of change 2014-04-18 15:50:30 -07:00
Corey Johnson 020e22a13d Merge remote-tracking branch 'origin/master' into cj-deprecation-cop 2014-04-18 15:49:55 -07:00
Kevin Sawicki a37a7e0a76 Upgrade to language-javascript@0.24.0 2014-04-18 13:45:52 -07:00
Kevin Sawicki d1b4d0f9f2 Upgrade to language-javascript@0.23.0 2014-04-18 13:16:34 -07:00
Kevin Sawicki fb111dd0f4 Upgrade to language-css@0.16.0 2014-04-18 11:43:49 -07:00
Kevin Sawicki 1392deb29c Upgrade to language-css@0.15.0 2014-04-18 11:24:29 -07:00
Kevin Sawicki 2dafc5eaa1 Upgrade to language-less@0.8.0 2014-04-18 11:08:50 -07:00
Corey Johnson a407b0107a Remove deprecated call to keystroke 2014-04-18 10:43:27 -07:00
Corey Johnson 36c3c38047 Don't rename deprecated method 2014-04-18 10:43:27 -07:00
Corey Johnson e56317bd64 Use paneView as var name instead of pane 2014-04-18 10:43:27 -07:00
Corey Johnson da49751f24 Remove usage of PaneContainerView::getActivePaneView 2014-04-18 10:43:27 -07:00
Kevin Sawicki 762559d2b7 Upgrade to bracket-matcher@0.33.0 2014-04-18 10:02:10 -07:00
Kevin Sawicki 2a0070ef10 Upgrade to bracket-matcher@0.32.0 2014-04-18 09:45:44 -07:00
Kevin Sawicki 7c7de4436e Merge pull request #1879 from atom/ks-move-compile-cache-to-dot-atom
Move compile cache to ~/.atom/compile-cache
2014-04-17 18:54:30 -07:00
Kevin Sawicki 87afa50477 💄 Add space after comma 2014-04-17 18:35:54 -07:00
Kevin Sawicki 2e71e2fa4b Remove unneeded mkdir call 2014-04-17 18:34:59 -07:00
Kevin Sawicki b537ba8864 Use fs-plus isFileSync method 2014-04-17 18:34:10 -07:00
Kevin Sawicki c156119882 Store compiled coffee files with js extension 2014-04-17 18:32:22 -07:00
Kevin Sawicki fea958c8e4 Clean ~/.atom/compile-cache 2014-04-17 18:32:22 -07:00
Kevin Sawicki 8e0a695f7c Store less cache in ~/.atom/compile-cache 2014-04-17 18:32:22 -07:00
Kevin Sawicki 47f99cd74e Store coffee/cson cache in ~/.atom/compile-cache 2014-04-17 18:32:22 -07:00
Kevin Sawicki 0eb5fd4c3b Merge pull request #1878 from atom/ks-mutate-selected-text-public
Make Editor::mutateSelectedText public
2014-04-17 18:31:42 -07:00
Kevin Sawicki 0c01de350d 📝 Shorten and tweak comment 2014-04-17 18:23:40 -07:00
Kevin Sawicki 77641f138b Make Editor::mutateSelectedText public 2014-04-17 18:23:01 -07:00
probablycorey f24843a928 Upgrade grim and deprecation-cop 2014-04-17 17:59:12 -07:00
probablycorey 03ab77c60b Merge commit '690fc7180a9f1dc5dfc77f8b2b31e866ce79510c' into cj-deprecation-cop 2014-04-17 17:57:36 -07:00
Nathan Sobo ec0ec3bb16 Upgrade to text-buffer@2.0.3 to fix Array::map + parseInt gotcha 2014-04-17 16:38:18 -06:00
Kevin Sawicki 690fc7180a Defer requiring of $ in Package
This is needed in the case that the package manager is being used
in the browser process to open a URL.

Closes #1869
2014-04-17 13:53:00 -07:00
Kevin Sawicki 02553bf8e2 Upgrade to fs-plus 2.2.2
Refs #1877
2014-04-17 13:34:23 -07:00
Kevin Sawicki 81646532b4 Ignore non-string core.themes config entries
Previously exceptions would be raised downstream if invalid theme
names were returned from ThemeManager::getEnabledThemeNames

Closes #1877
2014-04-17 13:33:51 -07:00
Kevin Sawicki 1e7c80aebf Merge pull request #1876 from atom/ks-config-default-api
Add Config::getDefault API
2014-04-17 13:33:39 -07:00
Kevin Sawicki 27fe5b784c 📝 Use package instead of plugin in example 2014-04-17 13:24:34 -07:00
Kevin Sawicki 9b2901583e 📝 Clean up docs 2014-04-17 13:24:34 -07:00
Kevin Sawicki 408665d7d2 Add Config::isDefault(keyPath) 2014-04-17 13:24:34 -07:00
Kevin Sawicki 6ec58e1163 Rename value var to defaultValue 2014-04-17 13:24:34 -07:00
Kevin Sawicki 541ffa5057 💄 Combine specs 2014-04-17 13:24:34 -07:00
Kevin Sawicki 0ea683e0b5 💄 Move expect up one line 2014-04-17 13:24:34 -07:00
Kevin Sawicki f12004d27b Add object to default value spec 2014-04-17 13:24:34 -07:00
Kevin Sawicki 35d268fcf8 Use _.isEqual when comparing value to default 2014-04-17 13:24:34 -07:00
Kevin Sawicki 20c3ca21e3 Add Config::getDefault(keyPath) 2014-04-17 13:24:34 -07:00
Nathan Sobo 37d2e00f4e Upgrade to text-buffer@2.0.2 to fix next marker id when deserializing 2014-04-17 13:33:28 -06:00
Kevin Sawicki 5bf9bbe764 Merge pull request #1875 from atom/ks-context-menu-without-focus
Allow context menu to work without focus
2014-04-17 12:00:25 -07:00
Kevin Sawicki e37fc316fb Remove unneeded ?
AtomWindow always has a non-null browserWindow property
2014-04-17 11:42:57 -07:00
Kevin Sawicki 9128041c20 Include AtomWindow in command options
This ensures that all application commands can use it instead of relying
on the focused window.
2014-04-17 11:36:19 -07:00
Kevin Sawicki 020c5e795a Remove unneeded . 2014-04-17 11:24:53 -07:00
Kevin Sawicki be3a6bc6d0 Send context menu commands without focused window
The context menu always knows what window it is bound to so
start supporting running context menus on non-focused windows.

Previously these would either fail silently or log an error
if focusedWindow() returned null and the command wasn't guarding
against it.
2014-04-17 11:24:53 -07:00
Kevin Sawicki 142bb4b615 Upgrade to markdown-preview@0.64.0 2014-04-17 11:18:49 -07:00
Kevin Sawicki ddf7bb5303 Upgrade to settings-view@0.110.0 2014-04-16 17:55:05 -07:00
Kevin Sawicki 442342937f Upgrade to markdown-preview@0.63.0 2014-04-16 13:43:25 -07:00
Kevin Sawicki a967e52f68 Autoscroll when moving lines up/down
Closes #1829
2014-04-16 12:43:51 -07:00
Kevin Sawicki c475e89a3e Remove duplicate tilde
Closes #1866
2014-04-16 12:07:43 -07:00
Kevin Sawicki 58da88b71a Upgrade to apm v0.39.0 2014-04-16 10:55:50 -07:00
Kevin Sawicki 71328f21bd Upgrade to language-go@0.9.0 2014-04-16 10:03:30 -07:00
Kevin Sawicki a1b0f6c25d Upgrade to settings-view@0.109.0 2014-04-16 09:29:09 -07:00
Nathan Sobo fdccc2dae4 Prepare 0.90.0 release 2014-04-16 10:20:11 -06:00
Corey Johnson 1246f8ed20 Merge pull request #1871 from atom/cj-remove-deprecated-calls
Remove deprecated calls
2014-04-16 09:02:41 -07:00
Nathan Sobo fb56817895 Prepare 0.89.0 release 2014-04-16 09:58:38 -06:00
Nathan Sobo b6d8d5d100 Prepare 0.88.0 release 2014-04-16 09:56:24 -06:00
Corey Johnson 8eb23dbe5c Merge remote-tracking branch 'origin/master' into cj-remove-deprecated-calls
Conflicts:
	package.json
2014-04-16 08:54:50 -07:00
Nathan Sobo 34f624c895 Unsubscribe from the editor model with ::unsubscribe 2014-04-15 19:07:57 -06:00
Nathan Sobo d554b7fd03 Remove scopes from event names in subscriptions 2014-04-15 18:50:36 -06:00
Nathan Sobo a61dff6e21 🚱 Unsubscribe from Editor when EditorView is removed
This replaces calls to `@editor.on` with `@subscribe @editor`. That
causes us to correctly unsubscribe when the editor is removed, avoiding
a memory leak.
2014-04-15 18:46:20 -06:00
Corey Johnson 47b820ce7d Merge pull request #1872 from atom/cj-remove-github-auth-token
Remove github auth token methods
2014-04-15 16:55:25 -07:00
Corey Johnson 33557b87eb Upgrade to feedback@0.30.0 2014-04-15 16:26:21 -07:00
Corey Johnson aed0c16acc Remove github auth token methods 2014-04-15 16:16:01 -07:00
Corey Johnson b4c8cb4bf9 Use Workspace::getActivePaneItem 2014-04-15 15:31:56 -07:00
Corey Johnson 8988d55d25 Upgrade to find-and-replace@0.98.0 2014-04-15 15:27:24 -07:00
Corey Johnson 5824b127ed Update multiple packages 2014-04-15 15:23:25 -07:00
Corey Johnson d6ec73886f Add PaneContainer::getActivePane 2014-04-15 14:55:28 -07:00
Corey Johnson 411cf579f4 Add Workspace::getActivePaneItem 2014-04-15 14:35:31 -07:00
Corey Johnson ad0ed7e634 Don't use of deprecated methods internally 2014-04-15 14:07:07 -07:00
Corey Johnson 7c00e02b1a Deprecate PaneContainerView::getActivePane
Use PaneContainerView::getActivePaneView instead.
2014-04-15 14:04:20 -07:00
Corey Johnson e6040972d8 Update multiple packages. 2014-04-15 14:03:46 -07:00
Corey Johnson ac2f723aba Use PaneContainerViews::getPaneViews 2014-04-15 13:13:53 -07:00
Corey Johnson ecfb505144 Merge pull request #1851 from atom/cj-move-functionality-to-workspace-part-II
Move functionality from Project to Workspace Part II
2014-04-15 11:45:46 -07:00
Corey Johnson 326d1dce14 Upgrade to deprecation-cop@0.2.0 2014-04-15 11:29:47 -07:00
Corey Johnson c2f87fb73b Add deprecation-cop dependency 2014-04-14 14:59:20 -07:00
Kevin Sawicki 1245835e96 Upgrade to fuzzy-finder@0.49.0 2014-04-14 11:10:45 -07:00
Kevin Sawicki e174bdfa40 Upgrade to language-ruby@0.22.0 2014-04-14 10:29:05 -07:00
Cheng Zhao 3d8bc89c42 Upgrade to atom-shell@0.11.10 2014-04-15 00:56:50 +08:00
Kevin Sawicki 5fc6524493 Upgrade to link@0.22.0 2014-04-14 09:34:54 -07:00
Kevin Sawicki 6e6c93e6bb Upgrade to markdown-preview@0.62.0 2014-04-14 09:16:42 -07:00
Kevin Sawicki fd48ad1c67 Upgrade to language-todo@0.10.0 2014-04-14 09:04:03 -07:00
Kevin Sawicki 5163166990 Upgrade to fuzzy-finder@0.48.0 2014-04-14 09:00:08 -07:00
Corey Johnson 54b60a5253 Don't assume atom.workspace is always defined 2014-04-14 08:49:03 -07:00
Kevin Sawicki ff1d07bec9 Upgrade to keybinding-resolver@0.17.0 2014-04-12 09:47:18 -07:00
Kevin Sawicki 6d56283448 Upgrade to tree-view@0.89.0 2014-04-11 12:29:32 -07:00
Corey Johnson 6dfbd5733d Fix spec 2014-04-11 11:14:46 -07:00
Corey Johnson e56fa3ec4f Use PaneContainer to keep the state of open editors 2014-04-11 11:10:00 -07:00
Corey Johnson fe0d714710 Fix inconsistent indentation 2014-04-11 10:51:56 -07:00
Kevin Sawicki 7c1a7f52a5 📝 Use TomDoc in src/browser/ files 2014-04-11 10:50:33 -07:00
Kevin Sawicki 590c6be33d Add back dialog require used for path prompting
Closes #1861
2014-04-11 10:42:49 -07:00
Kevin Sawicki f1ca7fdbfd Upgrade to open-on-github@0.28.0 2014-04-11 10:40:18 -07:00
Kevin Sawicki a8b135b4bc Merge pull request #1859 from atom/ks-newline-above-indent-level
Only alter indentation when it is too low
2014-04-11 10:39:50 -07:00
Kevin Sawicki 1afdd62a5d Only alter indentation when it is too low
Previously insert newline above would use the current line's
indent level which could be the less than the proper level if the
newline should be further indented based on the increase indent
pattern being used.
2014-04-11 10:07:50 -07:00
Corey Johnson d47e8fc583 Fix indentation error 2014-04-11 09:45:54 -07:00
Corey Johnson 3644a36d67 Clearing a selection will also finalize the selection
Fixes #1843
2014-04-11 09:44:57 -07:00
Cheng Zhao bb98b3ef38 Upgrade to atom-shell@0.11.9 2014-04-11 20:03:47 +08:00
Cheng Zhao 356a7b014a Merge pull request #1856 from atom/cz-open-folder
Add "Open Folder" menu on Linux and Windows
2014-04-11 03:38:13 +00:00
Cheng Zhao 1ea0ef4ea2 Show both "Open File" and "Open Folder" menu on Linux and Windows.
These two platforms do not have a dialog that can select both files and
folders, so we have to use two menu items for two dialogs.
2014-04-11 11:29:38 +08:00
Cheng Zhao f37ca3e19c Add application:open-file and application:open-folder command. 2014-04-11 11:29:38 +08:00
Kevin Sawicki 8afd90b9f8 Upgrade to tree-view@0.88.0 2014-04-10 17:44:19 -07:00
Corey Johnson 613e05f4ac Merge pull request #1855 from atom/cj-remember-last-window-dimensions
Remember last window dimensions
2014-04-10 16:39:01 -07:00
Kevin Sawicki 068eeca862 Upgrade to language-sql@0.8.0 2014-04-10 15:34:36 -07:00
Corey Johnson 0502afb0c3 Merge pull request #1848 from atom/cj-auto-update-no-breaky
Make auto-updating more resilient
2014-04-10 14:52:20 -07:00
Corey Johnson e1491ca154 Merge remote-tracking branch 'origin/master' into cj-remember-last-window-dimensions 2014-04-10 14:49:34 -07:00
Corey Johnson e9a975fd92 Don't use version as a method 2014-04-10 14:42:51 -07:00
Kevin Sawicki 1459123b15 Prepare 0.86.0 release 2014-04-10 14:38:53 -07:00
Kevin Sawicki 9996eb825f Upgrade to git-diff@0.28.0 2014-04-10 14:16:58 -07:00
Corey Johnson 10392942d5 Merge remote-tracking branch 'origin/master' into cj-auto-update-no-breaky 2014-04-10 14:10:15 -07:00
Kevin Sawicki c452d05f44 Upgrade to open-on-github@0.27.0 2014-04-10 13:59:51 -07:00
Kevin Sawicki 1043f75c72 Merge pull request #1857 from atom/ks-touch-strategy
Update text-buffer for new touch invalidation strategy
2014-04-10 13:59:18 -07:00
Kevin Sawicki ec69bb5ffe Upgrade to spell-check@0.33.0 2014-04-10 13:31:38 -07:00
Kevin Sawicki 41cc0ecab4 Upgrade to text-buffer 2.0.1 2014-04-10 13:09:59 -07:00
Kevin Sawicki 67f8ddc314 Upgrade to text-buffer 2.0 2014-04-10 13:09:59 -07:00
Kevin Sawicki 10d626d63a Upgrade to language-coffee-script@0.22.0 2014-04-10 12:23:11 -07:00
Kevin Sawicki 2ec526508b Upgrade to find-and-replace@0.97.0 2014-04-10 11:34:57 -07:00
Cheng Zhao 6017ff585f Do not use deprecated app.exit API. 2014-04-10 17:33:26 +08:00
Cheng Zhao e6d656830f Upgrade to atom-shell@0.11.8 2014-04-10 15:59:59 +08:00
Kevin Sawicki 1a15c3394e Upgrade to find-and-replace@0.96.0 2014-04-09 15:42:09 -07:00
Kevin Sawicki b328a69f50 Check that label exists when comparing to other items
Previously separators would be removed when merging menus that
contained multiple separators.

Refs atom/find-and-replace#159
2014-04-09 11:39:38 -07:00
Kevin Sawicki e9ee6dca25 Upgrade to fuzzy-finder@0.47.0 2014-04-09 11:02:01 -07:00
Corey Johnson a2f73fd6b0 Remove unneeded fat arrows 2014-04-09 10:13:09 -07:00
Kevin Sawicki 9f09173d0f Upgrade to fs-plus 2.2.1 2014-04-09 10:03:16 -07:00
Kevin Sawicki 1e052c1113 Upgrade to markdown-preview@0.61.0 2014-04-09 09:29:01 -07:00
probablycorey b72bb4ab65 Fix default size bug 2014-04-08 17:27:52 -07:00
Kevin Sawicki 24f751ec83 Upgrade to keybinding-resolve@0.16.0 2014-04-08 17:14:24 -07:00
probablycorey d72e3d9c81 Add AtomWindow::getWindowDimensions 2014-04-08 17:11:20 -07:00
Kevin Sawicki 0aeb32ad70 Upgrade to language-javascript@0.22.0 2014-04-08 17:03:32 -07:00
probablycorey 3393583b72 Use windowDimensions from load settings if they exist 2014-04-08 16:57:52 -07:00
probablycorey 6fcd905d4f Use windowDimensions instead of initialSize 2014-04-08 16:57:18 -07:00
probablycorey 993534337c Update restoreWindowDimensions 2014-04-08 15:26:08 -07:00
probablycorey 03814246ef Rename to storeDefaultWindowDimensions 2014-04-08 15:25:49 -07:00
probablycorey 053965602c Apply default dimensions 2014-04-08 14:19:03 -07:00
probablycorey b45c1c7548 Store the default windows position.
Based on the last closed window or the last focused window
2014-04-08 12:35:36 -07:00
Kevin Sawicki e96d821653 Upgrade to language-coffee-script@0.21.0 2014-04-08 11:23:35 -07:00
Kevin Sawicki e3448b0a46 Upgrade to atom-light-ui@0.24.0 2014-04-08 11:06:57 -07:00
probablycorey 63a80a4d4d Revert "Revert "Merge pull request #1844 from atom/cj-move-functionality-to-workspace""
This reverts commit 87d008c337.
2014-04-08 10:52:19 -07:00
Kevin Sawicki d07eea405f Upgrade to feedback@0.29.0 2014-04-08 10:44:35 -07:00
probablycorey 87d008c337 Revert "Merge pull request #1844 from atom/cj-move-functionality-to-workspace"
This reverts commit 2d7dda066c, reversing
changes made to 96e3c63291.
2014-04-08 10:44:08 -07:00
Kevin Sawicki 4a55c90c63 Upgrade to markdown-preview@0.60.0 2014-04-08 10:34:16 -07:00
Kevin Sawicki 7bce6cb10a Upgrade to language-html@0.19.0 2014-04-08 09:58:45 -07:00
Kevin Sawicki 32499351dc Upgrade to language-xml@0.11.0 2014-04-08 09:57:59 -07:00
Corey Johnson 2d7dda066c Merge pull request #1844 from atom/cj-move-functionality-to-workspace
Move functionality from Project to Workspace
2014-04-08 09:52:29 -07:00
probablycorey 837f3c553f Don't explode the array 2014-04-08 09:07:55 -07:00
Cheng Zhao 96e3c63291 Show console when window error happened, fixes #1805. 2014-04-08 15:27:41 +08:00
Cheng Zhao d5da396c0f Upgrade to atom-shell@0.11.7 2014-04-08 15:27:41 +08:00
probablycorey 4b089b62a6 Destructure item instead of calling it i 2014-04-07 17:01:11 -07:00
probablycorey be8514b864 Use _.clone instead of new Array 2014-04-07 16:56:35 -07:00
probablycorey e826b66dd2 Don't destructure underscore 2014-04-07 16:56:17 -07:00
Nathan Sobo 83d6fc2374 Upgrade to atom-keymap@0.17.0 to keep default action on abortKeyBinding 2014-04-07 17:20:38 -06:00
Kevin Sawicki ecdaf48308 Upgrade to find-and-replace@0.95.0 2014-04-07 16:11:10 -07:00
probablycorey a79885eafb Add 'the' 2014-04-07 15:43:53 -07:00
probablycorey a3c9a65838 Remove redundant non-public documentation 2014-04-07 15:35:25 -07:00
probablycorey 8ca5d6db35 Remove trailing whitespace 2014-04-07 15:29:15 -07:00
probablycorey 980c17e50c Pass current version to AutoUpdateManager 2014-04-07 15:28:42 -07:00
Kevin Sawicki c9bf8f04b8 Upgrade to bracket-matcher@0.30.0 2014-04-07 15:23:38 -07:00
probablycorey 6613b9fd4d Don't send autoUpdateManager to ApplicationMenu 2014-04-07 15:19:48 -07:00
probablycorey 3168751c97 Enable Restart and Install Update item 2014-04-07 15:04:06 -07:00
probablycorey 6bc471cef1 Only emit window:update-available event after window is loaded 2014-04-07 14:55:50 -07:00
probablycorey 4b3240eeee Use EventEmitter instead of emissary
To be consistent with other browser process classes
2014-04-07 14:55:12 -07:00
probablycorey 1f9de98eb2 Make AtomWindow emit window:loaded 2014-04-07 14:54:27 -07:00
probablycorey 7eea30fa7f Make new windows receive previously triggered update-available events 2014-04-07 14:26:07 -07:00
probablycorey 63e51af87d Move window_udpate-evailable emitter to method 2014-04-07 14:25:35 -07:00
probablycorey bbc6433a75 Update comment 2014-04-07 14:18:16 -07:00
probablycorey d4ae836225 Use hidden menu items for update processes 2014-04-07 14:17:44 -07:00
probablycorey 789f29e0b5 AutoUpdateManager barely works 2014-04-07 12:25:55 -07:00
Kevin Sawicki c584c158d7 Upgrade to language-python@0.15.0 2014-04-07 11:54:13 -07:00
Kevin Sawicki d63c4f88fd Upgrade to go-to-line@0.19.0 2014-04-07 11:49:42 -07:00
Kevin Sawicki db327b92f3 🐧 Use alt-shift-up/down for cursors 2014-04-07 11:41:08 -07:00
Kevin Sawicki cd01e6f2ad Upgrade to grammar-selector@0.24.0 2014-04-07 11:34:44 -07:00
Kevin Sawicki b1be4e9183 Upgrade to tree-view@0.87.0 2014-04-07 11:29:44 -07:00
Kevin Sawicki 009a142273 Upgrade to link@0.21.0 2014-04-07 11:26:57 -07:00
Kevin Sawicki f0f00fd317 🐧 Map F11 to toggle full screen 2014-04-07 11:21:00 -07:00
probablycorey f5ea098417 Don't overwrite menu item's metadata field 2014-04-07 11:04:55 -07:00
probablycorey 82081aa5e9 Rename methods 2014-04-07 10:21:37 -07:00
probablycorey 33adaab8b1 Add getMenu method 2014-04-07 10:21:25 -07:00
probablycorey e21a1339a2 Use AutoUpdateManager 2014-04-07 10:20:32 -07:00
Kevin Sawicki b90849fa66 Upgrade to autoflow@0.16.0 2014-04-07 09:39:47 -07:00
probablycorey 23d3405ae7 Rename to AutoUpdateManager
So it isn't confused with Atom Shell's auto-updater class
2014-04-07 09:38:36 -07:00
probablycorey d39c422da9 Add content to AutoUpdater 2014-04-07 09:37:44 -07:00
Kevin Sawicki 053c0f703a Upgrade to language-gfm@0.31.0 2014-04-07 09:31:55 -07:00
probablycorey 1c91bd3100 Create AutoUpdater class 2014-04-07 09:14:35 -07:00
Kevin Sawicki 0ffb5da515 Upgrade to language-coffee-script@0.20.0 2014-04-07 09:03:47 -07:00
Kevin Sawicki b7db7f6c99 Upgrade to lanuage-gfm@0.30.0 2014-04-07 09:01:34 -07:00
Kevin Sawicki cae9782e24 Upgrade to language-xml@0.10.0 2014-04-07 08:49:29 -07:00
Kevin Sawicki 5dbab7bb89 Upgrade to language-make@0.10.0 2014-04-07 08:48:30 -07:00
Cheng Zhao ceab8e8166 Upgrade to atom-shell@0.11.6 2014-04-07 22:58:28 +08:00
Cheng Zhao 97cb440a7c Click on dock should open a new window when there is no window opened.
Fixes #1779.
2014-04-07 16:42:13 +08:00
Cheng Zhao fcdb42dbe4 Do not build source maps when compiling coffee scripts.
Since we do not ship coffee script sources and source map files in final
build, the source maps generated here actually have no use, and would
cause lots of networking erros since each compiled .js would try to load
their corresponding source map file.

This doesn't affect dev mode because it has its own way to generate
source maps on the fly.

Closes #1836.
2014-04-05 19:30:18 +08:00
probablycorey 11a91fb974 Move editor-created specs to Workspace 2014-04-04 15:31:44 -07:00
probablycorey 1d426e8fd2 Move editor-created event to Workspace 2014-04-04 15:31:44 -07:00
probablycorey 6f0094e6ce Move editor removal specs to Workspace 2014-04-04 15:31:44 -07:00
probablycorey 915cad39e8 Set atom.workspace in Workspace spec 2014-04-04 15:31:44 -07:00
probablycorey d8f0743888 Fix bug in Project::getEditors 2014-04-04 15:31:44 -07:00
probablycorey 7685b27218 Move editor tracking to workspace 2014-04-04 15:31:20 -07:00
probablycorey 3aab0b7f51 Fix problem with Workspace::eachEditor 2014-04-04 15:31:01 -07:00
probablycorey 2f5735e264 Use existing remove method 2014-04-04 15:31:01 -07:00
probablycorey 56bea31b5e Move Project::eachEditor to Workspace::eachEditor 2014-04-04 15:31:01 -07:00
probablycorey 52d5e205c7 Update Workspace::getOpeners 2014-04-04 15:30:22 -07:00
probablycorey 0f5f6c8657 Move openers to workspace 2014-04-04 15:30:22 -07:00
Corey Johnson 7457be2805 Merge pull request #1824 from atom/cj-warn-deprecations
Add deprecation warnings
2014-04-04 15:08:11 -07:00
probablycorey 86842658c0 Use skinny arrows 2014-04-04 14:56:10 -07:00
probablycorey d0276e60b5 Remove periods 2014-04-04 14:52:48 -07:00
Kevin Sawicki 18d6a56e82 Set maxTokensPerLine to 100
Previously this default lived in firs-mate but it belongs here since
it is an Atom limitation to tokenize responsively.
2014-04-04 14:46:42 -07:00
probablycorey 59108322e7 Merge remote-tracking branch 'origin/master' into cj-warn-deprecations
Conflicts:
	package.json
2014-04-04 14:43:54 -07:00
Kevin Sawicki 665088ce27 Prepare 0.85.0 release 2014-04-04 14:39:33 -07:00
Kevin Sawicki 79399a3c5a 💄 Remove extra newline 2014-04-04 14:03:51 -07:00
Kevin Sawicki 4659b95d36 Upgrade to language-coffee-script@0.19.0 2014-04-04 12:05:51 -07:00
Kevin Sawicki bdf73cd198 Merge pull request #1840 from atom/ks-newline-above-indent
Use current indent level for newline above
2014-04-04 10:59:06 -07:00
Kevin Sawicki 6e422d5428 Move cursor to end of line when on first row
This line may be indented now so move the cursor to the
end of the indentation.
2014-04-04 10:47:25 -07:00
Kevin Sawicki e464c4f047 Use current indent level for newline above
Previously Editor::insertNewlineAbove would put the cursor
at position 0 if there were empty lines above the current line
regarding of the indent level of the cursor's current line.

Now the indent level of the current line is always used for the newline
above when the editor.autoIndent config is enabled.
2014-04-04 10:47:25 -07:00
Kevin Sawicki 4610c4446a Upgrade to fuzzy-finder@0.46.0 2014-04-04 10:47:14 -07:00
Kevin Sawicki 156ca14ea6 Upgrade to language-html@0.18.0 2014-04-04 10:15:22 -07:00
Kevin Sawicki cebb27154d Merge pull request #1837 from atom/ks-comment-line-with-only-whitespace
Use cursor indent level if commenting single line
2014-04-04 09:30:05 -07:00
Kevin Sawicki afe6685ce8 Merge pull request #1833 from atom/ks-backspace-on-first-line
Allow backspace to beginning of word on first line
2014-04-04 09:28:51 -07:00
Kevin Sawicki 148e143255 Merge pull request #1832 from atom/ks-dont-save-config-when-setting-defaults
Don't call Config::save when setting defaults
2014-04-04 09:18:24 -07:00
Kevin Sawicki 96d1c84f62 Upgrade to open-on-github@0.26.0 2014-04-04 09:12:48 -07:00
Kevin Sawicki f40ecccdcc Upgrade to markdown-preview@0.59.0 2014-04-03 19:10:23 -07:00
Kevin Sawicki 03b9713547 Upgrade to language-gfm@0.29.0 2014-04-03 19:08:43 -07:00
Kevin Sawicki 9fb364026e Initialize upstream object for all submodules 2014-04-03 18:48:32 -07:00
Kevin Sawicki 1aa64a9d80 Use cursor indent level if commenting single line
Previously commenting a line of all whitespace would insert
the comment at column 0 on the line since blank lines are
ignored when calculating the minimum indent level.
2014-04-03 18:26:50 -07:00
Kevin Sawicki 2ea09aa6b6 Upgrade to status-bar@0.39.0 2014-04-03 17:55:41 -07:00
Kevin Sawicki 76ce150448 Prepare 0.84.0 release 2014-04-03 15:46:07 -07:00
Kevin Sawicki 1d01ff0797 Upgrade to scoped-property-store 0.8 2014-04-03 15:28:54 -07:00
Kevin Sawicki a1d78a1062 Upgrade to first-mate 1.5.1 2014-04-03 14:32:07 -07:00
Kevin Sawicki 3ac41a544a Upgrade to language-coffee-script@0.18.0 2014-04-03 14:07:30 -07:00
Kevin Sawicki 3e24d045e5 Allow backspace to beginning of word on first line
Previously this would fail when only whitespace was to the
left of the cursor.
2014-04-03 12:04:22 -07:00
Kevin Sawicki 143738033b Upgrade to tabs@0.34.0 2014-04-03 11:33:19 -07:00
Kevin Sawicki f153cbb41f Don't call Config::save when setting defaults
Instead just emit an updated event, saving is not needed
because only the defaults are changing.
2014-04-03 11:00:45 -07:00
Kevin Sawicki f1ed5dedd7 Upgrade to settings-view@0.107.0 2014-04-03 10:41:13 -07:00
probablycorey e58c2d8368 Fix WorkSpace typo 2014-04-03 10:37:20 -07:00
probablycorey bcf1781040 Upgrade to grim@0.6.0 2014-04-03 10:17:27 -07:00
probablycorey 0b0dbbe4ee Add window:log-deprecation-warnings command 2014-04-03 10:12:04 -07:00
Kevin Sawicki c9e297a511 Upgrade to markdown-preview@0.58.0 2014-04-03 09:53:42 -07:00
Kevin Sawicki 18082f7cdc Upgrade to language-c@0.14.0 2014-04-03 09:28:08 -07:00
probablycorey ca016ce116 Update Grim 2014-04-03 09:19:02 -07:00
Nathan Sobo bb59e46267 Prepare 0.83.0 release 2014-04-03 10:01:50 -06:00
Nathan Sobo 86c4b99eab Upgrade to emissary@1.2.1 to make memory leaks less likely
This patch version nulls out the Subscription::emitter and ::callback
when subscriptions are cancelled, so even if a reference is retained to
them the resources they formerly referenced are released.
2014-04-03 09:25:08 -06:00
Nathan Sobo a1e1a00f9f Upgrade to whitespace@0.22.0 to fix a memory leak 2014-04-03 09:23:49 -06:00
Kevin Sawicki 53996e7bb0 Upgrade to open-on-github@0.25.0 2014-04-02 17:15:14 -07:00
Kevin Sawicki f88c71e1a1 Upgrade to open-on-github@0.24.0 2014-04-02 17:14:08 -07:00
Kevin Sawicki 2cccbff509 Upgrade to markdown-preview@0.56.0 2014-04-02 17:01:54 -07:00
Kevin Sawicki b173fcdd59 Default workspace classes when array is empty 2014-04-02 16:42:25 -07:00
Corey Johnson 7b6c62ab5e Merge pull request #1826 from atom/cj-workspace-spec
Add atom.workspace to all specs
2014-04-02 16:14:06 -07:00
Kevin Sawicki 809e57cb84 Remove unimplemented about menu 2014-04-02 16:13:45 -07:00
Kevin Sawicki de16ed6250 Remove special handling of Shift modifier
atom-keymap now handles this automatically when
normalizing.
2014-04-02 16:13:38 -07:00
Corey Johnson 606160d312 Use unless 2014-04-02 16:04:14 -07:00
Kevin Sawicki 78e990d1f9 Add minimize/maxmize to AtomWindow 2014-04-02 14:38:20 -07:00
Corey Johnson d47cc6fa0b Remove explicit atom.workspace.destroy call 2014-04-02 14:36:32 -07:00
Kevin Sawicki 8f3951fbd8 Only register first responder handlers on Mac OS X 2014-04-02 14:34:25 -07:00
Kevin Sawicki e09486d425 Upgrade to symbols-view@0.49.0 2014-04-02 14:25:42 -07:00
Corey Johnson 662f252912 Workspace is destroyed automatically 2014-04-02 14:19:27 -07:00
Corey Johnson 784d22368e Remove unneeded ? 2014-04-02 14:19:06 -07:00
Kevin Sawicki a40660d125 Upgrade to symbols-view@0.48.0 2014-04-02 14:18:49 -07:00
Kevin Sawicki af632df48b Upgrade to language-python@0.14.0 2014-04-02 14:16:05 -07:00
Corey Johnson 4a35c9a1af Merge remote-tracking branch 'origin/master' into cj-workspace-spec 2014-04-02 14:09:24 -07:00
Corey Johnson f90f48e3f0 Use atom.workspace if one exists 2014-04-02 14:08:00 -07:00
Kevin Sawicki 9c6a3c3d03 Move editor:transpose to darwin keymap
ctrl-t should be the fuzzy finder on linux.
2014-04-02 14:05:39 -07:00
Kevin Sawicki 4bccb81656 Add 🐧 to CONTRIBUTING.md 2014-04-02 14:03:31 -07:00
Kevin Sawicki 870e80446f 🐧 Remove extra .. for symlink path 2014-04-02 14:02:25 -07:00
Corey Johnson 4165a69fed Change destroy order 2014-04-02 14:02:21 -07:00
Kevin Sawicki 93d9a00819 Delete correct apm symlink when installing 2014-04-02 13:41:44 -07:00
Kevin Sawicki a3789411de Remove symlink before creating a new one 2014-04-02 13:40:33 -07:00
Kevin Sawicki 2b6b40bda7 Upgrade to atom-keymap 0.16.0 2014-04-02 13:28:59 -07:00
Corey Johnson 61ae185494 Create workspace after project 2014-04-02 13:23:50 -07:00
Corey Johnson 0eae68973b Merge pull request #1817 from atom/cj-harmony
Let's go full harmony!
2014-04-02 13:15:53 -07:00
Corey Johnson 6f2695388c Add destroy method 2014-04-02 12:12:56 -07:00
Corey Johnson 0c12f712c9 Add atom.workspace to every spec
We add project to every spec, I'd like to add workspace so that we can
move all the opener logic to workspace.
2014-04-02 12:03:01 -07:00
Corey Johnson 727d1cf4aa Merge remote-tracking branch 'origin/master' into cj-harmony 2014-04-02 11:04:01 -07:00
Corey Johnson 9324b538f7 Upgrade to grim@0.3.0 2014-04-02 10:10:28 -07:00
Kevin Sawicki 5aff4a042b 🐧 Add application:open-dev keybinding 2014-04-02 10:03:06 -07:00
Kevin Sawicki e36bc5bc9f Upgrade to git-utils 1.2.2 2014-04-02 09:44:31 -07:00
Kevin Sawicki 1a88937f5a Upgrade to oniguruma 1.0.6 2014-04-02 09:32:12 -07:00
Kevin Sawicki 5737593957 Merge pull request #1819 from atom/ks-linux
Linux tweaks
2014-04-02 09:08:02 -07:00
Kevin Sawicki d61d8bea86 Only install on darwin 2014-04-02 08:58:34 -07:00
Kevin Sawicki 062974882b Use 755 instead of 777 2014-04-02 08:58:34 -07:00
Kevin Sawicki 8415ddcb49 Upgrade to new icon 2014-04-02 08:58:19 -07:00
Kevin Sawicki 64f392a380 Install commands on linux 2014-04-02 08:58:19 -07:00
Kevin Sawicki fce09f9bfe 🐧 Make /usr/local/share/atom/atom executable 2014-04-02 08:58:19 -07:00
Kevin Sawicki f04ce025f4 🐧 Set permissions to 777 when installing 2014-04-02 08:57:55 -07:00
Kevin Sawicki 57844c2ca4 Upgrade apm for linux download fix 2014-04-02 08:57:55 -07:00
Kevin Sawicki 91433cfe90 git ignore *~ files 2014-04-02 08:57:55 -07:00
Kevin Sawicki 86423698b1 Merge pull request #1822 from atom/cz-linux-keymaps
Add keymaps for modules on Linux
2014-04-02 08:52:05 -07:00
Kevin Sawicki 7dda8e1b80 Upgrade to language-ruby@0.21.0 2014-04-02 08:46:34 -07:00
Nathan Sobo 70cd6a6bc3 💄 Use CoffeeScript :: notation in specs
Going to add another spec on a branch and prefer to stick with our new
convention.
2014-04-02 07:58:48 -06:00
Nathan Sobo 6e9217be5f Reenable disable display-buffer-marker specs 2014-04-02 07:50:24 -06:00
Cheng Zhao 3d8c916a72 🐧 Install apm in deb package. 2014-04-02 18:19:42 +08:00
Cheng Zhao cae9c96622 🐧 Use correct email address for deb package. 2014-04-02 17:53:04 +08:00
Cheng Zhao aaf283ceaa Upgrade to settings-view@0.106.0 2014-04-02 17:51:33 +08:00
Cheng Zhao 4bac60ad94 Upgrade to background-tips@0.10.0 2014-04-02 17:43:40 +08:00
Cheng Zhao cc2e87b784 🐧 Match sublime's quit menu. 2014-04-02 15:14:06 +08:00
Cheng Zhao 363fb0d66e Upgrade to symbols-view@0.47.0 2014-04-02 15:03:04 +08:00
Cheng Zhao 2d2295dcc6 Upgrade to tree-view@0.86.0 2014-04-02 15:02:02 +08:00
Cheng Zhao bf3daeccc5 Upgrade to styleguide@0.28.0 2014-04-02 15:01:36 +08:00
Cheng Zhao 63d5caebbc Upgrade to find-and-replace@0.94.0 2014-04-02 14:55:26 +08:00
Cheng Zhao 3ac3a89fa5 Upgrade to fuzzy-finder@0.45.0 2014-04-02 14:52:12 +08:00
Cheng Zhao af6d7204f9 Upgrade to command-palette@0.20.0 2014-04-02 14:51:20 +08:00
Cheng Zhao 642671161d Merge pull request #1821 from atom/atom-shell-v0.11.5
Upgrade to atom-shell@0.11.5
2014-04-02 06:37:47 +00:00
Cheng Zhao b2fdc25c83 🐧 Hide the 'Install update' menu. 2014-04-02 14:27:03 +08:00
Cheng Zhao 893a3f63dd 🐧 Add arch in the deb package. 2014-04-02 14:26:29 +08:00
Cheng Zhao 271b104120 🐧 Fix normalized menu item label. 2014-04-02 14:26:10 +08:00
Cheng Zhao 247eec44d5 Upgrade to atom-shell@0.11.5 2014-04-02 14:24:30 +08:00
Kevin Sawicki d064c27faf Upgrade to spell-check@0.32.0 2014-04-01 17:56:40 -07:00
probablycorey 8c6ed69176 Upgrade to Grim@0.2.0 2014-04-01 16:59:24 -07:00
probablycorey 56222a072a Add deprecation warnings 2014-04-01 16:59:16 -07:00
Kevin Sawicki 1021979d98 Don't bundle pegjs examples 2014-04-01 16:53:14 -07:00
Kevin Sawicki fcc4376cdd Upgrade to language-php@0.14.0 2014-04-01 16:45:06 -07:00
probablycorey afbf011103 Add Grim dependency 2014-04-01 15:59:54 -07:00
Kevin Sawicki e858f74a17 Upgrade to language-ruby@0.20.0 2014-04-01 15:54:49 -07:00
probablycorey 58dc45d496 Go full harmony!
Using the --harmony flag gives us all of the harmony functionality and it didn't
affect start time (~1360ms for both) or spec run time (~1:10 for both).
2014-04-01 15:31:55 -07:00
Kevin Sawicki 3029dc8d2a Upgrade to settings-view@0.105.0 2014-04-01 15:28:25 -07:00
Nathan Sobo 11d7562c12 Document unset! and native! directives in keymap system 2014-04-01 10:27:35 -06:00
Nathan Sobo b8b95d537b Upgrade to atom-keymaps@0.15.0 for unset! directive 2014-04-01 10:27:21 -06:00
Nathan Sobo 9ec342a545 Merge pull request #1811 from atom/ns-rename-keymap
Refer to files containing key bindings as keymaps instead of the global
2014-04-01 10:25:02 -06:00
Kevin Sawicki cf60b1fde3 Use terser ^ instead of >= < style ranges 2014-04-01 18:11:35 +02:00
Kevin Sawicki 556cdfd300 Upgrade to language-go@0.8.0 2014-04-01 18:11:35 +02:00
Ivan Zuzak c566e7f1f3 use cmd instead of meta in docs 2014-04-01 18:11:23 +02:00
Kevin Sawicki 366312dee8 Upgrade to tabs@0.33.0 2014-03-31 18:13:58 -07:00
probablycorey 1acc6bfadf Upgrade to keybinding-resolver@0.15.0 2014-03-31 17:37:30 -07:00
probablycorey 9fd21ce2e1 Upgrade to keybinding-resolver@0.14.0 2014-03-31 16:54:24 -07:00
Kevin Sawicki 5525e046e9 Upgrade to bracket-matcher@0.29.0 2014-03-31 16:52:55 -07:00
Kevin Sawicki 68e1e36347 Upgrade to settings-view@0.104.0 2014-03-31 16:12:04 -07:00
Nathan Sobo 199a0f7089 Use official atom-keymap@0.14.0 release 2014-03-31 17:00:26 -06:00
Nathan Sobo 65564e2012 Rename atom.keymap to atom.keymaps 2014-03-31 16:28:55 -06:00
Nathan Sobo d612a71af5 Upgrade to atom-keymap@0.14.0 and account for renamed methods 2014-03-31 16:01:31 -06:00
Nathan Sobo 477624387f Upgrade to keymap@0.13.0 for new events 2014-03-31 15:46:15 -06:00
Ben Ogle bf686101dc Upgrade to git-diff@0.27.0 2014-03-31 13:44:29 -07:00
Ben Ogle b348ef633c Upgrade to styleguide@0.27.0 2014-03-31 13:36:29 -07:00
Kevin Sawicki 68022837b4 Upgrade to language-gfm@0.28.0 2014-03-31 13:03:39 -07:00
Kevin Sawicki 537981ff62 Prepare 0.82.0 release 2014-03-31 11:44:52 -07:00
Kevin Sawicki 5bc339afae Relativize path in isSubmodule working dir check
This will handle case insensitive filesystems correctly.
2014-03-31 11:34:06 -07:00
Kevin Sawicki 4e9871a26a Upgrade to git-utils 1.2.1 2014-03-31 11:14:34 -07:00
Nathan Sobo e334d2b640 Upgrade to scoped-property-store@0.7.0 to allow + in scope strings 2014-03-31 11:51:41 -06:00
Kevin Sawicki c7efaef1be Upgrade to bracket-matcher@0.28.0 2014-03-31 10:03:01 -07:00
Kevin Sawicki ad751a1a2a Upgrade to language-ruby@0.19.0 2014-03-31 09:33:37 -07:00
Kevin Sawicki fad21c6d3e Upgrade to fuzzy-finder@0.44.0 2014-03-31 09:08:53 -07:00
Kevin Sawicki 373a7a6d04 Add missing focusedWindow method
This regressed when this code was moved in here in
6d50d05336 and was somehow
still triggereable since it was reported to atom@github.com
2014-03-28 15:55:04 -07:00
Kevin Sawicki 0742909953 Upgrade to settings-view@0.103.0 2014-03-28 15:24:03 -07:00
Kevin Sawicki 25fcd25c32 Prepare 0.81.0 release 2014-03-28 15:05:55 -07:00
probablycorey 0fe4258a44 Upgrade to tabs@0.32.0 2014-03-28 14:25:09 -07:00
probablycorey 0727c8efab Upgrade to language-gfm@v0.27.0 2014-03-28 14:25:09 -07:00
Kevin Sawicki 7198740b26 Merge pull request #1803 from atom/ks-case-insensitive
Fix case insensitive issues with Git
2014-03-28 14:21:08 -07:00
Kevin Sawicki 634a12470b Upgrade to tree-view@0.85.0 2014-03-28 14:02:27 -07:00
Kevin Sawicki 940145be7a Add spec for Git::getDirectoryStatus 2014-03-28 14:01:21 -07:00
Kevin Sawicki fca03552e2 Relativize directory path before checking statuses 2014-03-28 13:54:13 -07:00
Kevin Sawicki f42e880804 Upgrade to fuzzy-finder@0.43.0 2014-03-28 13:51:11 -07:00
Kevin Sawicki 341c474dfa Upgrade to status-bar@0.38.0 2014-03-28 13:49:53 -07:00
Kevin Sawicki c3a1831959 Use Git::getCachedPathStatus in spec 2014-03-28 13:34:21 -07:00
Kevin Sawicki dde1a0b2eb 📝 Add missing the 2014-03-28 13:27:17 -07:00
Kevin Sawicki ecfddc1523 Doc that path is relative to parent repo 2014-03-28 13:21:21 -07:00
Kevin Sawicki 13b59213eb Cached statuses using relative path keys
This added a Git::getCachedPathStatus API to access this data
now that properly relativizes paths to the repository's working
directory.
2014-03-28 13:19:28 -07:00
Kevin Sawicki c0bb3b07c6 Upgrade to git-utils 1.2 2014-03-28 12:47:52 -07:00
Kevin Sawicki c804c5ada3 Upgrade to fs-plus 2.2 2014-03-28 12:47:34 -07:00
Kevin Sawicki 0816e923f9 Upgrade to pathwatcher 1.1.1 2014-03-28 12:47:14 -07:00
Kevin Sawicki 5d30e30a63 Upgrade to language-ruby@0.18.0 2014-03-28 09:46:40 -07:00
Kevin Sawicki 89fdffdfdc Upgrade to settings-view@0.102.0 2014-03-28 09:03:50 -07:00
Corey Johnson 8f089a5ce1 Upgrade to settings-view@0.101.0 2014-03-27 17:31:00 -07:00
Corey Johnson f3bc2310f0 Upgrade to welcome@0.12.0 2014-03-27 17:20:19 -07:00
Corey Johnson bd9cabea75 Upgrade to settings-view@0.100.0 2014-03-27 16:47:57 -07:00
Nathan Sobo 2520b3f85a Merge pull request #1781 from atom/ns-property-selectors
Don't use the DOM to look up scoped properties
2014-03-27 12:04:19 -06:00
Nathan Sobo 22b967adf5 Upgrade to tree-view@0.84.0 hoping to fix the flaky specs 2014-03-27 11:56:43 -06:00
Nathan Sobo cb514d10d5 Upgrade to atom-keymap@0.12.0 to reject invalid bindings and warn 2014-03-27 11:55:52 -06:00
Kevin Sawicki 9e3b67b4b9 Upgrade to language-python@0.13.0 2014-03-27 10:25:25 -07:00
Kevin Sawicki 49556e2aa8 Upgrade to spell-check@0.31.0 2014-03-27 10:18:50 -07:00
Kevin Sawicki 94e70d3f25 Upgrade to language-gfm@0.26.0 2014-03-27 09:55:51 -07:00
Kevin Sawicki 05c47bd3c0 Prepare 0.80.0 release 2014-03-27 09:44:50 -07:00
Cheng Zhao 5b6fe70b7e Ship with hunspell dictionaries on Linux and Windows. 2014-03-27 19:28:26 +08:00
Cheng Zhao 424bf706e9 Upgrade to apm@0.37.0 2014-03-27 16:51:06 +08:00
Kevin Sawicki b1feb9cf2f Upgrade to spell-check@0.30.0 2014-03-26 18:45:10 -07:00
Kevin Sawicki 6948183270 Only add keybindings when command is present 2014-03-26 17:34:09 -07:00
Kevin Sawicki 4aa612e70c Upgrade to language-coffee-script@0.17.0 2014-03-26 16:11:05 -07:00
Corey Johnson d146faae1d Merge pull request #1799 from atom/cj-calculate-invisibles-correctly
Calculate invisibles correctly
2014-03-26 15:58:17 -07:00
Corey Johnson aa02bc1aaf Remove window.debugContent
Whoops!
2014-03-26 14:16:24 -07:00
Corey Johnson f9eb8e3466 Merge remote-tracking branch 'origin/master' into cj-calculate-invisibles-correctly 2014-03-26 14:14:23 -07:00
Kevin Sawicki 18e13cfc3b Upgrade to language-html@0.17.0 2014-03-26 14:02:00 -07:00
Corey Johnson c46238f795 Add spec 2014-03-26 13:57:12 -07:00
Corey Johnson 50e045212b Measure the rendered char width instead of the buffer char
If invisibles are turned on, the buffer char and the rendered char
may differ in size. For example, if `☃` is used as the tab invisible 
its width is probably larger than the width of a `\t`

Closes #1724
2014-03-26 13:57:04 -07:00
Nathan Sobo d5c831c64b Merge branch 'master' of https://github.com/atom/atom into ns-property-selectors 2014-03-26 14:14:29 -06:00
Ivan Žužak 75b355d632 Upgrade to markdown-preview@0.54.0 2014-03-26 19:29:52 +01:00
Corey Johnson dcf4394741 Upgrade to find-and-replace@0.93.0 2014-03-26 09:46:49 -07:00
Kevin Sawicki 36a6ecdd9a Upgrade to bracket-matcher@0.27.0 2014-03-26 09:04:25 -07:00
Cheng Zhao d8dfea00d0 Upgrade to atom-shell@0.11.4 2014-03-26 14:22:05 +08:00
Nathan Sobo 9784d49667 Merge branch 'master' of https://github.com/atom/atom into ns-property-selectors
Conflicts:
	package.json
2014-03-25 21:21:44 -06:00
Kevin Sawicki cb76c698e7 Upgrade to spell-check@0.29.0 2014-03-25 18:37:02 -07:00
Kevin Sawicki 9d2957a7c9 Upgrade to language-html@0.16.0 2014-03-25 18:22:48 -07:00
probablycorey 92a722495b Upgrade to text-buffer@1.4.6 2014-03-25 15:46:54 -07:00
Ben Ogle 30a2e5d902 Upgrade to scandal@0.15.2 2014-03-25 15:38:35 -07:00
Ben Ogle 409d5c7783 Upgrade to git-diff@0.26.0 2014-03-25 14:16:30 -07:00
Kevin Sawicki 9f567051fb Upgrade to underscore-plus 1.1.2 2014-03-25 13:51:40 -07:00
Kevin Sawicki 624c7baf44 Upgrade to settings-view@0.98.0 2014-03-25 13:10:25 -07:00
Kevin Sawicki 2671d8bd46 Upgrade to markdown-preview@0.52.0 2014-03-25 12:56:35 -07:00
Nathan Sobo 8b928d9320 Merge branch 'master' into ns-property-selectors 2014-03-25 13:24:03 -06:00
Kevin Sawicki 27ddcfcbcb Prepare 0.79.0 release 2014-03-25 11:08:06 -07:00
Nathan Sobo 48798dead9 Upgrade to scoped-property-store@0.6.0 for :not pseudoclasses 2014-03-25 12:03:31 -06:00
Kevin Sawicki 0adae86b4d Don't set line height on mini editors 2014-03-25 10:55:32 -07:00
Kevin Sawicki 92283cabfa Prepare 0.78.0 release 2014-03-25 10:27:28 -07:00
Kevin Sawicki a4774ada84 Upgrade to emissary 1.2 2014-03-25 10:00:46 -07:00
Kevin Sawicki e6bcf7ec6e Upgrade to text-buffer 1.4.5 2014-03-25 09:51:05 -07:00
Kevin Sawicki 27ef1f8749 Upgrade to pathwatcher 1.1 2014-03-25 09:50:52 -07:00
Kevin Sawicki 8ee1c2b591 Upgrade to symbols-view@0.46.0 2014-03-25 09:48:29 -07:00
Kevin Sawicki f6f659aec6 Upgrade to snippets@0.40.0 2014-03-25 09:47:44 -07:00
Kevin Sawicki 61372241f7 Upgrade to markdown-preview@0.51.0 2014-03-25 09:46:50 -07:00
Kevin Sawicki d398d89de9 Upgrade to dev-live-reload@0.30.0 2014-03-25 09:45:57 -07:00
Kevin Sawicki af4a2340c4 Upgrade to archive-view@0.30.0 2014-03-25 09:44:53 -07:00
Kevin Sawicki 2d9791d61a Upgrade to language-objective-c@0.11.0 2014-03-25 09:29:46 -07:00
Kevin Sawicki f874ec7cb6 Upgrade to language-ruby@0.17.0 2014-03-25 09:29:46 -07:00
Cheng Zhao 9e4baad701 Merge pull request #1796 from atom/atom-shell-v0.11.3
Upgrade to atom-shell@0.11.3
2014-03-25 12:20:40 +00:00
Cheng Zhao 59b711447c Upgrade to atom-shell@0.11.3 2014-03-25 20:11:28 +08:00
Cheng Zhao 2bb4866e1a Merge pull request #1789 from atom/linux-package
Add task to create .deb package
2014-03-25 07:42:01 +00:00
Cheng Zhao 72ceaf772d 🐧 Use startup notification. 2014-03-25 15:41:00 +08:00
Cheng Zhao 2da9ee0cee 🐧 Add icon file in deb package. 2014-03-25 15:41:00 +08:00
Cheng Zhao 9c070cd71d 🐧 Add desktop file. 2014-03-25 15:40:59 +08:00
Cheng Zhao 6f068f14fd Do not hard code build dir. 2014-03-25 15:40:59 +08:00
Cheng Zhao 67d8db8b9a 🐧 Add mkdeb task to create debian package. 2014-03-25 15:40:59 +08:00
Cheng Zhao 03b9a25897 Add description field to package.json.
It would be used when generating packages.
2014-03-25 15:40:59 +08:00
Cheng Zhao 645fc1511a Do not add parameter in shebang string.
On Linux "#!/usr/bin/env node --harmony_collections" is unfortunately
not recognized by system.
2014-03-25 15:40:43 +08:00
Cheng Zhao ae1d3b1e80 🐧 Search atom from installed position. 2014-03-25 15:40:43 +08:00
Cheng Zhao 627a839779 Fix grunt install. 2014-03-25 15:40:43 +08:00
Cheng Zhao 5151faea3d Use unix style install. 2014-03-25 15:40:43 +08:00
Cheng Zhao eb1bed118f No need to parse args before passing to nslog. 2014-03-25 15:40:43 +08:00
Nathan Sobo fd6476e4d1 Update to underscore-plus@1.1.1 to match scoped-property-store 2014-03-24 19:47:39 -06:00
Nathan Sobo d62b3d5236 Upgrate to tree-view@0.84.0 for flaky spec fix 2014-03-24 19:41:22 -06:00
Nathan Sobo bb6aa5eedb Add deprecated atom.syntax.scopedProperties for settings-view
This is used to determine which snippets apply to the current package.
We should really come up with a different approach, but for now this
preserves compatibility.
2014-03-24 19:22:52 -06:00
Kevin Sawicki e9f4820dd4 Upgrade to symbols-view@0.45.0 2014-03-24 17:17:46 -07:00
Nathan Sobo 6bd73f2647 Upgrade to scoped-property-store@0.4.0 to upgrade underscore-plus
There's something weird going on and I can't figure it out. I feel like
there's a bad version of underscore-plus cached somewhere on CI.
2014-03-24 18:05:46 -06:00
Nathan Sobo d816eca300 Merge branch 'master' into ns-property-selectors 2014-03-24 18:01:44 -06:00
Kevin Sawicki 03d4fdb890 Upgrade to snippets@0.39.0 2014-03-24 16:49:19 -07:00
Nathan Sobo 4aa6e78a4e Use scoped-properties-store for faster property lookup
Previously we were creating DOM elements on every keystroke to look for
certain properties. Now it happens entirely in JavaScript.
2014-03-24 17:45:07 -06:00
Nathan Sobo 7ecb0dcd4b Upgrade to legal-eagle@0.4.0 to accept slick's MIT license 2014-03-24 16:56:27 -06:00
Nathan Sobo 1cdec9386c Modernize serialization docs 2014-03-24 16:19:06 -06:00
Kevin Sawicki ba8f6bccec Upgrade to snippets@0.38.0 2014-03-24 15:13:53 -07:00
Kevin Sawicki 22c8746ed6 Upgrade to status-bar@0.37.0 2014-03-24 14:27:32 -07:00
Nathan Sobo 96503f74e4 Upgrade to atom-keymap@0.11.0 for better native! handling
We weren't clearing the queued keystrokes when aborting partial match
due to encountering a native! binding.
2014-03-24 14:55:35 -06:00
Justin Palmer 7fb3396f65 Merge pull request #1795 from atom/line-height-config
Line height config option
2014-03-24 13:42:41 -07:00
Kevin Sawicki 66fa40b29e Upgrade to language-xml@0.9.0 2014-03-24 13:35:03 -07:00
Kevin Sawicki b5aefc6f5e Upgrade to language-gfm@0.25.0 2014-03-24 12:53:50 -07:00
Justin Palmer cf590685b9 remove lineHeight getter
Nothing is using it and we can add it back once the need arises.
2014-03-24 12:52:01 -07:00
Justin Palmer a604bfcdf1 remove trailing whitespace 2014-03-24 11:42:32 -07:00
Justin Palmer c389bccfa0 update editor view specs to account for lineHeight 2014-03-24 11:37:58 -07:00
Justin Palmer ce02dcf5a5 clarify docs around lineHeight 2014-03-24 11:37:38 -07:00
Justin Palmer d3d38c0312 rename editorLineHeight to lineHeight 2014-03-24 11:28:15 -07:00
Justin Palmer 95d097dd7b 1.3 best represents the previous default line height 2014-03-24 10:59:19 -07:00
Justin Palmer 47f3b562b5 add getter for editorLineHeight 2014-03-24 10:58:58 -07:00
Justin Palmer 5eb12e671b add config option for explicitly setting the editor line height 2014-03-24 10:58:26 -07:00
Kevin Sawicki 023cb2ea55 Prepare 0.77.0 release 2014-03-24 10:54:56 -07:00
probablycorey 98ea42d808 Update docs on window:reloading 2014-03-24 09:38:40 -07:00
probablycorey 4e3a46ee71 Use correct keybinding for window:reload 2014-03-24 09:12:59 -07:00
Cheng Zhao 9ebc5fa30e Merge pull request #1786 from atom/atom-shell-v0.11.2
Upgrade to atom-shell@0.11.2
2014-03-24 09:58:16 +00:00
Cheng Zhao 810ca750cd Upgrade to atom-shell@0.11.2 2014-03-24 17:51:56 +08:00
Nathan Sobo 424652e27c Also ensure editor is *visible* before recalculating dimensions 2014-03-21 17:33:39 -06:00
Nathan Sobo 831beceaac Upgrade to keybinding-resolver@0.12.0 to improve typing performance 2014-03-21 13:58:47 -06:00
Nathan Sobo 2daf026967 Merge pull request #1777 from atom/ns-optimize-editor-rendering
Remove extra reflow and options object allocation from editor view updates
2014-03-21 13:12:54 -06:00
Nathan Sobo dbd6a98bbe Upgrade to atom-keymap@0.10.0 for better 'native!' handling
If a native! binding is encountered, we honor it even if there are
partially matching multi-stroke bindings.
2014-03-21 11:31:57 -06:00
Kevin Sawicki a4ffdeb842 Upgrade to oniguruma 1.0.4 2014-03-21 10:26:37 -07:00
Kevin Sawicki 9b6194c5a4 Upgrade to language-html@0.15.0 2014-03-21 10:11:56 -07:00
Nathan Sobo 8e4573677d Upgrade to atom-dark-ui@0.26.0 for scrollbar styling 2014-03-21 10:48:47 -06:00
Nathan Sobo 61e9befbe7 Favor the most recent matching binding when selecting app menu shortcuts
We sending every binding matching the `body` selector to the browser
process, but it only selects the first. Since we scan the bindings in
chronological order, we need to unshift bindings to the front of the
array so the most recently defined bindings are loaded first.
2014-03-21 10:42:04 -06:00
Kevin Sawicki 0f50c40a93 Upgrade to markdown-preview@0.50.0 2014-03-21 09:34:00 -07:00
Kevin Sawicki 907f8c34ac Upgrade to language-gfm@0.24.0 2014-03-21 09:32:49 -07:00
Kevin Sawicki c178d4c874 Upgrade to apm 0.36.0 2014-03-21 08:29:41 -07:00
Kevin Sawicki 233fd44b01 Upgrade to language-gfm@0.23.0 2014-03-20 17:57:24 -07:00
Kevin Sawicki ab88edaa02 Merge pull request #1774 from atom/ks-support-submodules
Support submodules in Git class
2014-03-20 17:32:16 -07:00
Nathan Sobo 50c25d9e44 Read scrollView width prior to touching the DOM to prevent reflow 2014-03-20 18:02:04 -06:00
Nathan Sobo 9be593d390 Eliminate options object for suppressAutoscroll
It's a single option used only internally. Let's not allocate an object
for it.
2014-03-20 18:02:04 -06:00
Kevin Sawicki 318c43931c Upgrade to git-utils 1.1.1 2014-03-20 17:01:53 -07:00
Kevin Sawicki 244fc33f49 Support submodules inside submodules from isSubmodule 2014-03-20 16:36:10 -07:00
Kevin Sawicki f83f5263a9 💄 Reorder keys 2014-03-20 16:10:10 -07:00
Kevin Sawicki 3266dde2e3 📝 Add missing d 2014-03-20 16:10:10 -07:00
Kevin Sawicki 3428ee335a 💄 2014-03-20 16:10:10 -07:00
Kevin Sawicki db6b4d7b81 Support submodules in more methods 2014-03-20 16:10:10 -07:00
Kevin Sawicki 1c195987c1 Load submodule statuses in handler 2014-03-20 16:10:09 -07:00
Kevin Sawicki 4913714a61 Fall back to root repo for submodule check 2014-03-20 16:10:09 -07:00
Kevin Sawicki 8e2856465c Handle submodules in getDiffStats/isSubmodule 2014-03-20 16:10:09 -07:00
Kevin Sawicki 868c7a3908 Compute status of submodules 2014-03-20 16:10:09 -07:00
Kevin Sawicki afaf91ebde Add path argument to handle submodules correct 2014-03-20 16:10:09 -07:00
Kevin Sawicki c92fe1452b Upgrade to git-utils 1.1 2014-03-20 16:10:09 -07:00
Kevin Sawicki 2bde128fed Make serialization version independent of app version
Previously when deserializing the version of the serialized state
was compared to the app version causing the serialized state be discarded
each time Atom was updated.

Now the cached app version variable is different than the serialization
version allow them to drift accordingly without loss of serialized state.
2014-03-20 16:09:16 -07:00
Kevin Sawicki 89461505b5 Prepare 0.76.0 release 2014-03-20 15:54:42 -07:00
Kevin Sawicki 85df5e61e5 Upgrade to settings-view@0.97.0 2014-03-20 15:22:32 -07:00
Kevin Sawicki 5e477ff984 Upgrade to apm 0.35.0 2014-03-20 15:12:47 -07:00
Kevin Sawicki 2baf9eda61 Upgrade to apm 0.34.0 2014-03-20 15:05:47 -07:00
Kevin Sawicki 7d6d8175b9 Upgrade to apm 0.33.0 2014-03-20 14:57:23 -07:00
Kevin Sawicki 0fdda032cc Guard against interval firing after editor is destroyed 2014-03-20 14:41:16 -07:00
Kevin Sawicki c82d0f8c1c Upgrade to tree-view@0.83.0 2014-03-20 14:39:17 -07:00
Nathan Sobo 65ff108615 Warn and exit if script/bootstrap is run with wrong node version 2014-03-20 13:05:49 -06:00
Nathan Sobo 075611eb65 Don't recalculate dimensions on stylesheet changes for detached editors 2014-03-20 12:19:34 -06:00
Kevin Sawicki b82537b020 Upgrade to git-utils 1.0.1 2014-03-20 10:54:33 -07:00
Kevin Sawicki 06fee4636a Prepare 0.75.0 release 2014-03-20 10:10:40 -07:00
Kevin Sawicki 5fe1af3239 Upgrade to language-ruby-on-rails@0.12.0 2014-03-20 09:26:13 -07:00
Kevin Sawicki bf6cc3d384 Upgrade to tree-view@0.82.0 2014-03-20 09:21:21 -07:00
Kevin Sawicki b4a4ba91b0 Upgrade to settings-view@0.96.0 2014-03-20 09:13:20 -07:00
Kevin Sawicki 271776944a Merge pull request #1769 from atom/bump-apm
update apm submodule to 0.32.0
2014-03-20 09:04:09 -07:00
Nathan Sobo b1d5a3d75f Merge pull request #1772 from atom/ns-update-editor-dimensions
Update editor properly when line height or char width change via a stylesheet
2014-03-20 10:01:08 -06:00
Nathan Sobo bd68790a10 Cleanup stylesheets added during spec in afterEach 2014-03-19 21:51:08 -06:00
Nathan Sobo f0a7663447 Recalculate line-height and char-width when stylesheets change
If either of these dimensions change, we request a display update for
the editor.
2014-03-19 21:37:26 -06:00
Kevin Sawicki db627d65c7 Upgrade to language-html@0.14.0 2014-03-19 18:18:25 -07:00
Cheng Zhao a9f581797a Upgrade to minidump@0.5.x
This will generate symbols from .dSYM file if we have one.
2014-03-20 09:14:42 +08:00
Kevin Sawicki 763291230d Upgrade to bookmars@0.22.0 2014-03-19 17:49:26 -07:00
Kevin Sawicki 55a77a34bd Upgrade to language-gfm@0.22.0 2014-03-19 17:47:26 -07:00
Kevin Sawicki f4f975c6b7 Upgrade to image-view@0.32.0 2014-03-19 16:33:03 -07:00
Nathan Sobo 2d26382510 Emit 'stylesheet-changed' from atom.themes
Whenever stylesheets are applied or removed.
2014-03-19 15:51:36 -06:00
Kevin Sawicki c5cd56a99e Upgrade to language-toml@0.12.0 2014-03-19 14:50:25 -07:00
Nathan Sobo 24943dd526 Avoid sending arguments object to child process.
The arguments variable is not a real array, and gets screwed up when
sending it to the child process. This updates it to send an array
instead.

Thanks to @lackac!

Refs atom/terminal#23.
2014-03-19 15:40:35 -06:00
Kevin Sawicki 8b32e30ee7 Upgrade to language-todo@0.9.0 2014-03-19 14:37:22 -07:00
Kevin Sawicki 72c99be0f2 Upgrade to whitespace@0.21.0 2014-03-19 14:26:59 -07:00
Kevin Sawicki 10ac1f6ae8 Upgrade to language-gfm@0.21.0 2014-03-19 14:05:44 -07:00
Kevin Sawicki 524170534c Upgrade to language-gfm@0.20.0 2014-03-19 13:32:05 -07:00
Kevin Sawicki d542f35336 Upgrade to fuzzy-finder@0.42.0 2014-03-19 10:56:09 -07:00
Kevin Sawicki 697ba53c6b Upgrade to settings-view@0.95.0 2014-03-19 10:50:51 -07:00
Kevin Sawicki 148a8bad2e Merge pull request #1771 from atom/ks-dont-trim-leading-whitespace-on-newline
Ignore leading whitespace when auto-indenting a newline
2014-03-19 10:24:05 -07:00
Daniel Hengeveld 7a344b91aa update apm submodule to 0.32.0 2014-03-19 10:15:50 -07:00
Kevin Sawicki 5783350484 📝 Tweak option comment 2014-03-19 10:06:10 -07:00
Kevin Sawicki 9fce23d5ac Update option to preserveLeadingWhitespace 2014-03-19 10:05:34 -07:00
Kevin Sawicki 7c17c99b9e Update spec description 2014-03-19 10:05:34 -07:00
Kevin Sawicki ff560bc3a3 Update spec to not be before whitespace 2014-03-19 10:05:34 -07:00
Kevin Sawicki 61f01f4713 📝 Add through 2014-03-19 10:05:34 -07:00
Kevin Sawicki 2e8c0234bb Tweak spec description 2014-03-19 10:05:34 -07:00
Kevin Sawicki 8e62d772b3 Ignore leading whitespace when auto-indenting a newline
Refs atom/language-less#1
2014-03-19 10:05:34 -07:00
Kevin Sawicki 532cfb5775 Upgrade to tree-view@0.81.0 2014-03-19 09:19:56 -07:00
Kevin Sawicki f912eb805d Add npm as build dependency
This switches script/bootstrap to use a locally installed npm so that
the version of npm being used to bootstrap apm is now managed in
build/package.json instead of whatever version is installed globally on the
machine running script/bootstrap.

Closes #1770
2014-03-19 08:41:08 -07:00
Cheng Zhao 6838ff8ea2 Merge pull request #1762 from atom/linux-build
Make Atom build on Linux
2014-03-19 01:40:11 +00:00
Kevin Sawicki 8aa2c40bbf Don't capture whitespace group in comment patterns
This was causing corruption when uncommenting XML since the fact that
it was being captured was throwing off the index used into the match.

Closes atom/language-xml#3
2014-03-18 18:19:59 -07:00
Kevin Sawicki c2d603769e Upgrade to language-hyperlink@0.9.0 2014-03-18 17:29:50 -07:00
Nathan Sobo 3710d85e63 Upgrade to atom-keymap@0.9.0 to improve pending mode timeout behavior 2014-03-18 18:12:41 -06:00
Kevin Sawicki 12a72302d9 Upgrade to bracket-matcher@0.26.0 2014-03-18 09:41:35 -07:00
Kevin Sawicki 2c70f0dc27 Upgrade to language-html@0.13.0 2014-03-18 09:05:27 -07:00
Kevin Sawicki 6165c65a51 Upgrade to language-todo@0.8.0 2014-03-18 09:02:48 -07:00
Kevin Sawicki 3ea3f64214 Upgrade to language-php@0.13.0 2014-03-18 09:01:37 -07:00
Cheng Zhao 08601d32a3 Upgrade to atom-shell@0.11.1 2014-03-18 17:57:34 +08:00
Cheng Zhao 0ae1f6858c Upgrade to apm@0.31.0 2014-03-18 17:02:31 +08:00
Cheng Zhao f2e5b480e1 Fix specs on Mac. 2014-03-18 16:32:34 +08:00
Cheng Zhao 19ab197bc1 🐧 Make atom.sh work. 2014-03-18 16:27:43 +08:00
Cheng Zhao 8bf1464b64 Fix setting NODE_PATH in specs window. 2014-03-18 15:57:16 +08:00
Cheng Zhao 0ee3421cbc Merge branch 'master' into linux-build 2014-03-18 15:54:52 +08:00
Cheng Zhao a18536e8a4 🐧 Add keymap. 2014-03-18 15:51:13 +08:00
Cheng Zhao cc2e1eecd3 Still set NODE_PATH since tasks may need it. 2014-03-18 15:38:57 +08:00
Cheng Zhao 87b95128f9 Do not rely on NODE_PATH env. 2014-03-18 15:34:24 +08:00
Cheng Zhao 344a56b47a 🐧 Add menu. 2014-03-18 14:12:25 +08:00
Cheng Zhao da8d055817 🐧 Quit when all windows are closed. 2014-03-18 14:09:43 +08:00
Nathan Sobo c07272633f Merge pull request #1760 from atom/ns-extract-keymap
Extract and improve Keymap
2014-03-17 22:40:38 -06:00
Nathan Sobo b26e0d42d5 Merge branch 'master' into ns-extract-keymap 2014-03-17 22:28:14 -06:00
Nathan Sobo 8ee4e927a1 Unspy setTimeout in an attempt to fix flaky spec 2014-03-17 22:27:26 -06:00
Cheng Zhao 7eaa3cb2b6 Upgrade to grunt-download-atom-shell@0.6.1 2014-03-18 12:24:22 +08:00
Cheng Zhao 696928540c Upgrade to keytar@1.x 2014-03-18 12:18:08 +08:00
Cheng Zhao b33f36d30a Update apm: Fix keytar on Linux. 2014-03-18 12:17:20 +08:00
Nathan Sobo 179b392a49 Merge branch 'master' into ns-extract-keymap 2014-03-17 21:59:20 -06:00
Nathan Sobo 857f19c382 Upgrade to image-view@0.31.0 to fix flakey spec 2014-03-17 21:58:21 -06:00
Nathan Sobo 8a333208a2 Upgrade to atom-keymap@0.8.0 2014-03-17 13:51:25 -06:00
Nathan Sobo ff23f62c3e Move jQuery.Event::abortKeyBinding to keymap-extensions 2014-03-17 13:05:47 -06:00
Nathan Sobo dcdc9d6b90 Construct Keymap with options object 2014-03-17 13:05:47 -06:00
Nathan Sobo 3d28f957c7 Export Keymap from keymap-extensions 2014-03-17 13:05:47 -06:00
Nathan Sobo 2eb2aa5bef Rename season variable to CSON for consistency 2014-03-17 13:05:46 -06:00
Nathan Sobo 371820fd59 Use ^ prefix for pathwatcher dependency 2014-03-17 13:05:46 -06:00
Nathan Sobo 596c584ef1 Add atom-keymap classes to the docs grunt task 2014-03-17 13:05:46 -06:00
Nathan Sobo 27a1577021 Upgrade to atom-keymap@0.6.0 for bug fixes 2014-03-17 13:05:46 -06:00
Nathan Sobo 8f2745c248 Remove old keymap-spec. It has been supplanted by the atom-keymap npm 2014-03-17 13:05:46 -06:00
Nathan Sobo 1c964d05f8 💄 spec helper's keydownEvent 2014-03-17 13:05:46 -06:00
Nathan Sobo 2dcbf7f751 Replace Keymap subclass with keymap-extensions 2014-03-17 13:05:46 -06:00
Nathan Sobo 067f73da38 Defend against jQuery-wrapped targets in keydownEvent spec helper 2014-03-17 13:05:46 -06:00
Nathan Sobo ae324c13a6 Upgrade to atom-keymap@0.5.0 to support keybinding resolver 2014-03-17 13:05:46 -06:00
Nathan Sobo 9a488adbb9 Suggest people bind to .workspace instead of body 2014-03-17 13:05:46 -06:00
Nathan Sobo 4c0f1efec6 Set the keymap default target to atom.workspaceView's DOM element 2014-03-17 13:05:46 -06:00
Nathan Sobo 8974cb5f34 Make a quick and dirty subclass of the Keymap from the npm 2014-03-17 13:05:46 -06:00
Nathan Sobo cb303a3149 Depend on atom-keymap npm and a compatible pathwatcher version 2014-03-17 13:05:45 -06:00
Kevin Sawicki c44628a5b1 Upgrade to language-ruby-on-rails@0.11.0 2014-03-17 11:52:17 -07:00
Kevin Sawicki fb1effc654 Upgrade to language-html@0.12.0 2014-03-17 11:50:17 -07:00
Kevin Sawicki 5ab213b854 Upgrade to language-javascript@0.21.0 2014-03-17 10:34:47 -07:00
Kevin Sawicki bbf738635c Upgrade to language-php@0.12.0 2014-03-17 10:27:07 -07:00
Cheng Zhao 705d3e9fbc Do not run grunt install on Linux by default.
On Linux we usually separate build from install, and only run install
with sudo when needed.
2014-03-17 07:44:58 +00:00
Cheng Zhao 6bd3728548 Fix grunt on Linux. 2014-03-17 07:28:36 +00:00
Cheng Zhao 7d997f6d9a Use multi-platform-node branch of apm. 2014-03-17 04:11:31 +00:00
Cheng Zhao e919eb3eba Upgrade to atom-shell@0.11.0 2014-03-16 14:05:06 +00:00
Nathan Sobo c2b2096c8c Merge pull request #1761 from atom/enable_graphics_switching
Enable automatic graphics switching
2014-03-15 19:17:52 -06:00
Lincoln Stoll 46638d2ea1 Enable automatic graphics switching 2014-03-15 19:24:40 +01:00
Kevin Sawicki fdb08517d3 Prepare 0.74.0 release 2014-03-14 09:37:27 -07:00
Kevin Sawicki f272962562 Upgrade to settings-view@0.94.0 2014-03-14 09:14:50 -07:00
Kevin Sawicki 9e661d8a99 Upgrade to find-and-replace@0.92.0 2014-03-13 18:23:40 -07:00
Kevin Sawicki 43c0b79273 Upgrade to tabs@0.31.0 2014-03-13 18:01:44 -07:00
Corey Johnson 96e96c3c7f Merge pull request #1757 from atom/cj-shhhhh
Don't show error messages for version and help cli options
2014-03-13 17:42:19 -07:00
probablycorey 15c51b4417 Redirect help and version stderr to /dev/null
Closes #1580 based on @zcbenz's suggestion.
2014-03-13 15:00:24 -07:00
Kevin Sawicki 6c93ca0e42 Prepare 0.73.0 2014-03-13 14:52:47 -07:00
probablycorey a3cb98a3d3 Shorten the spec-directory description 2014-03-13 14:38:05 -07:00
Kevin Sawicki 31ecd39f08 Don't echo app location 2014-03-13 12:41:08 -07:00
probablycorey 4d986b8417 Upgrade to image-view@0.30.0 2014-03-13 11:48:04 -07:00
Kevin Sawicki 2d14c06089 Merge pull request #1756 from atom/ks-mousemove-out-of-control
Stop out of control mouse move listener
2014-03-13 11:36:10 -07:00
Corey Johnson 7746ad0b13 Merge pull request #1753 from atom/cj-fixup-shell-script
Don't assume Atom is in /Applications when using the CLI
2014-03-13 11:26:16 -07:00
probablycorey 1cbaf8d1f5 Added comments because shell scripts can be confusing 2014-03-13 11:14:26 -07:00
Kevin Sawicki cb41e2c41a Remove unneeded do -> block 2014-03-13 11:00:24 -07:00
probablycorey 2fd71f2fa8 Use mdfind to locate Atom.app if it isn't in /Applications 2014-03-13 10:57:55 -07:00
Kevin Sawicki 37d67e8a83 Add spec for dragging with editor hidden 2014-03-13 10:56:31 -07:00
Kevin Sawicki 2f8e67d679 Add event.which to 1 in more specs 2014-03-13 10:49:34 -07:00
Kevin Sawicki 22dc165a25 Set event.which to 1 in specs 2014-03-13 10:47:03 -07:00
Kevin Sawicki ebfe50aafc Keep mouse move handler from going out of control
Previously the editor could be hidden and the mouse move handler
would start logging errors since it will still trying to compute
positions based on the move events still firing on the document.

Now the display property is checked in the handler and also the selection
is finalized when a move event occurs and the button is no longer pressed.

Closes #1755
2014-03-13 10:33:18 -07:00
Kevin Sawicki de58936ed1 Upgrade to settings-view@0.93.0 2014-03-13 10:03:45 -07:00
Kevin Sawicki eba2abd5d9 📝 Doc save, saveAs, and getPath as public 2014-03-13 09:21:06 -07:00
Kevin Sawicki 864ab0c095 Use file path in save as dialog
Previously the dirname of the file path was used which caused the
save dialog to not be filled in with the current file name

Closes #1748
2014-03-12 18:41:50 -07:00
Kevin Sawicki de3d424f51 Map cmd-shift-backspace to editor:backspace-to-beginning-of-line
Closes #1752
2014-03-12 18:16:52 -07:00
Kevin Sawicki 68c2c18d83 Don't allow the tab length to go below 1
Closes #1751
2014-03-12 18:00:11 -07:00
probablycorey 54907455fe Add ~/Desktop 2014-03-12 17:44:00 -07:00
probablycorey ba8ab21a0d Search for the Atom app in the usual locations when using the atom cli
Sorta closes #1595
2014-03-12 17:10:36 -07:00
Corey Johnson f272d9abde Upgrade to solarized-dark-syntax@0.14.0 2014-03-12 14:00:39 -07:00
Corey Johnson 972f194388 Upgrade to tree-view@0.80.0 2014-03-12 13:44:15 -07:00
Kevin Sawicki adb2f31e7f Kill associated processes on will-quit
Previously processes were only killed when the window was destroyed.

This affected `atom --wait` when using cmd-q to quit the app.

Closes #1679
2014-03-12 12:51:47 -07:00
Corey Johnson ccfd239ad1 Upgrade to autosave@0.13.0 2014-03-12 11:28:36 -07:00
Kevin Sawicki 6fc56b9372 Upgrade to language-coffee-script@0.16.0 2014-03-12 11:27:21 -07:00
Kevin Sawicki 9072a6da7a Upgrade to language-javascript@0.20.0 2014-03-12 11:24:11 -07:00
Kevin Sawicki d39547097c Upgrade to symbols-view@0.44.0 2014-03-12 11:22:48 -07:00
Kevin Sawicki 3b2f58fa22 Upgrade to symbols-view@0.43.0 2014-03-12 10:34:27 -07:00
Kevin Sawicki cbddc4eb6f Revert "Upgrade to language-php@0.12.0"
This reverts commit 96a0c1039a.
2014-03-12 10:34:13 -07:00
Kevin Sawicki 96a0c1039a Upgrade to language-php@0.12.0 2014-03-12 10:33:46 -07:00
Kevin Sawicki 1390bef626 Upgrade apm to v0.30.0 2014-03-12 10:30:58 -07:00
Kevin Sawicki e70a2ab3de Upgrade to language-ruby@0.16.0 2014-03-12 10:11:20 -07:00
Kevin Sawicki e0d1bdc072 Upgrade to language-todo@0.7.0 2014-03-12 10:07:18 -07:00
Kevin Sawicki 79c60d3884 Upgrade to language-php@0.11.0 2014-03-12 09:59:29 -07:00
Kevin Sawicki 1e85bc66b4 Upgrade to language-javascript@0.19.0 2014-03-12 09:58:53 -07:00
Kevin Sawicki 0d633a1e27 Upgrade to fs-plus 2.0.4 2014-03-12 09:55:21 -07:00
Kevin Sawicki 0759f6a1fd Upgrade to whitespace@0.20.0 2014-03-12 09:35:21 -07:00
Nathan Sobo 99b5675c4e Ensure position is a Point in Selection::selectToPosition
Fixes #1750
2014-03-11 20:42:42 -06:00
Nathan Sobo 4f7957183c Upgrade to text-buffer@1.4.4 to fix problems serializing MarkerPatches 2014-03-11 20:35:01 -06:00
Kevin Sawicki 2de18d3c4d 📝 Add examples for atom.workspaceView 2014-03-11 18:23:59 -07:00
Kevin Sawicki fecf13e2df Upgrade to text-buffer 1.4.3 2014-03-11 18:11:01 -07:00
Kevin Sawicki 31e44d50e4 Upgrade to symbols-view@0.42.0 2014-03-11 17:34:29 -07:00
Kevin Sawicki c28aeeac4a Upgrade to snippets@0.37.0 2014-03-11 17:33:31 -07:00
Kevin Sawicki 5649de6cd1 Upgrade to markdown-preview@0.49.0 2014-03-11 17:25:59 -07:00
Kevin Sawicki 26a649abda Upgrade to dev-live-reload@0.29.0 2014-03-11 17:24:07 -07:00
Kevin Sawicki 3b02ae1ce9 Upgrade to archive-view@0.29.0 2014-03-11 17:21:39 -07:00
Kevin Sawicki 13278c3d40 Upgrade to whitespace@0.19.0 2014-03-11 17:16:58 -07:00
Kevin Sawicki 17760a458a Upgrade to pathwatcher@0.19.0 2014-03-11 16:53:36 -07:00
Kevin Sawicki 282814fe59 Upgrade to archive-view@0.28.0 2014-03-11 16:36:56 -07:00
Kevin Sawicki 35fb02fce9 Upgrade to pathwatcher@0.18.0 2014-03-11 16:28:22 -07:00
Kevin Sawicki 7286c339c8 Upgrade to first-mate 1.4.2 2014-03-11 16:22:54 -07:00
Kevin Sawicki b956fa4d1f Upgrade to fuzzy-finder@0.41.0 2014-03-11 16:15:30 -07:00
Kevin Sawicki 8cb66895f0 Check that activations events are present
Having an empty array, object, or string will now be treated
as no activation events.

This was reported as being confusing since people were just clearing
the array generated by the package generator but their packages weren't
activating.
2014-03-11 16:15:30 -07:00
probablycorey 3a9584b840 Upgrade to tree-view@0.79.0 2014-03-11 15:48:21 -07:00
Kevin Sawicki 5d20a518ae Upgrade to first-mate 1.4.1 2014-03-11 14:30:35 -07:00
Kevin Sawicki bd3dc453ef Wrap command line arguments in quotes
Closes #1639
2014-03-11 13:35:19 -07:00
Kevin Sawicki 151d22c325 Destroy items on pane:close
Previously pane:close would do nothing because of the guards in
Pane::destroy.

Also renames the menu to Close Pane to be more accurate.

Closes #1686
2014-03-11 13:22:03 -07:00
Kevin Sawicki d6433a67c8 Incluse JavaScript specs when loading suite
Closes #1615
2014-03-11 13:01:28 -07:00
Kevin Sawicki be561f0e5e 📝 Update styleguide keybinding
Closes #1628
2014-03-11 12:29:23 -07:00
Kevin Sawicki 1f6d90319b Upgrade to settings-view@0.92.0 2014-03-11 12:20:12 -07:00
Kevin Sawicki eca63364a6 Upgrade to find-and-replace@0.91.0 2014-03-11 12:20:12 -07:00
Nathan Sobo 38f25160d6 Upgrade to q@1.0.1, which doesn't need loophole to avoid CSP errors 2014-03-11 13:18:56 -06:00
Kevin Sawicki 28ce023164 Upgrade to setting-view@0.91.0 2014-03-11 11:39:14 -07:00
Kevin Sawicki 10b3d56682 Upgrade to oniguruma 1.0.3 2014-03-11 11:30:27 -07:00
probablycorey 945011f9e3 Add data to the same jquery object that is appended to the list.
Closes #1747
2014-03-11 11:20:03 -07:00
Nathan Sobo d7c6cd68b9 Merge pull request #1741 from atom/cz-first-responder-menu
Send command to first responder when no window is focused
2014-03-11 11:10:36 -06:00
Cheng Zhao ed4c3fde2d Merge pull request #1742 from atom/atom-shell-v0.10.7
Upgrade to atom-shell@0.10.7
2014-03-11 14:21:43 +00:00
Cheng Zhao c5db1c33a0 Upgrade to atom-shell@0.10.7 2014-03-11 22:12:59 +08:00
Cheng Zhao d719ea74dd Send command to first responder when no window is focused. 2014-03-11 15:31:54 +08:00
Kevin Sawicki 996defaadb Merge pull request #1740 from atom/ks-cson-safe-grunt
Safe CSON during build
2014-03-10 18:56:36 -07:00
Kevin Sawicki 86cd7f7a01 Handle non-integer indentation level values
This was already occurring when using hard tabs but soft tabs still
had issues.

Refs atom/language-c#7
2014-03-10 18:45:18 -07:00
Kevin Sawicki a79090c65a Unfocus spec 2014-03-10 18:43:38 -07:00
Kevin Sawicki 86c720af81 Normalize all tabs, not just the first one
Refs atom/language-javascript#10
2014-03-10 17:57:10 -07:00
Ben Ogle a9becd5cc8 Upgrade to solarized-dark-syntax@0.13.0 2014-03-10 17:52:38 -07:00
Kevin Sawicki 1e327699b8 Upgrade to grunt-cson@0.8.0 2014-03-10 17:24:32 -07:00
Nathan Sobo 0ba9425bb6 Upgrade to archive-view 0.27.0 to suppress CSP errors requiring 'q'
archive-view indirectly depends on a different version of 'q' and so it
isn't requiring the deduped version that already has its warnings
suppressed in atom.coffee.
2014-03-10 17:06:12 -06:00
probablycorey 7d19b839d9 Upgrade to metrics@0.32.0 2014-03-10 13:16:01 -07:00
probablycorey e1a9f0a533 Upgrade to metrics@0.31.0, again 2014-03-10 12:14:29 -07:00
Kevin Sawicki f6d0051446 Prepare 0.72.0 release 2014-03-10 11:46:37 -07:00
Kevin Sawicki 126df1fa03 Upgrade to tree-view@0.78.0 2014-03-10 11:18:56 -07:00
Kevin Sawicki 0a72d9539f Upgrade to atom-dark-ui@0.25.0 2014-03-10 11:13:08 -07:00
Kevin Sawicki 60ecbe054e Upgrade to wrap-guide@0.18.0 2014-03-10 11:02:43 -07:00
Kevin Sawicki 5a3fa18863 Upgrade to atom-light-syntax@0.16.0 2014-03-10 10:53:55 -07:00
probablycorey bea4f2abde Revert "Upgrade to metrics@0.31.0"
This reverts commit c80d3eea47.

Conflicts:
	package.json
2014-03-10 10:44:11 -07:00
Ivan Žužak 3fc2ca3d77 Merge pull request #1738 from atom/izuzak/upgrade-underscore-plus
Upgrade to underscore-plus@1.0.5
2014-03-10 18:34:34 +01:00
Kevin Sawicki 29fcc4727a Upgrade to language-javascript@0.18.0 2014-03-10 10:34:33 -07:00
Kevin Sawicki ddb973b03a Upgrade to markdown-preview@0.48.0 2014-03-10 10:23:39 -07:00
Kevin Sawicki c2b05f9956 Upgrade to tabs@0.30.0 2014-03-10 10:10:25 -07:00
Ivan Žužak 7fd452102f Upgrade to underscore-plus@1.0.5
See: https://github.com/atom/underscore-plus/commit/31c7cb6d50922a5237523f1282f0607679eff563
2014-03-10 18:09:03 +01:00
probablycorey c80d3eea47 Upgrade to metrics@0.31.0 2014-03-10 09:42:14 -07:00
Nathan Sobo 8421edbb72 Upgrade find-and-replace to 0.90.0 to avoid security policy exceptions 2014-03-10 10:40:59 -06:00
Kevin Sawicki 03587f54be Upgrade to tree-view@0.77.0 2014-03-10 09:39:38 -07:00
Kevin Sawicki dac7760018 Upgrade to atom-light-ui@0.23.0 2014-03-10 09:21:32 -07:00
Kevin Sawicki bd28d5d7b1 Upgrade to atom-dark-ui@0.24.0 2014-03-10 09:18:49 -07:00
Kevin Sawicki 34df19b204 Prepare 0.71.0 release 2014-03-10 09:06:17 -07:00
Kevin Sawicki 6e824dadf2 Upgrade to tabs@0.29.0 2014-03-10 08:52:35 -07:00
Cheng Zhao c50cfc1714 Upgrade to pathwatcher@0.17.0 2014-03-10 12:13:50 +08:00
Nathan Sobo d0fcd573bd Merge pull request #1702 from atom/enable-csp
initial attempt at CSP policy to see what breaks
2014-03-08 02:20:22 +02:00
Nathan Sobo 79089ced97 💄 whitespace 2014-03-07 17:19:53 -07:00
Nathan Sobo aa6811a088 Upgrade to loophole@0.3.0 for bugfix 2014-03-07 17:13:11 -07:00
Nathan Sobo dd27a35039 Silence CSP warnings from q's feature detection 2014-03-07 17:01:51 -07:00
Kevin Sawicki f3b696c5ec Upgrade to status-bar@0.36.0 2014-03-07 15:57:21 -08:00
Nathan Sobo 8405041f64 Merge branch 'master' into enable-csp
Conflicts:
	package.json
2014-03-07 16:46:00 -07:00
probablycorey a372993c44 Only listen of update events once when checking for update. 2014-03-07 15:39:44 -08:00
Nathan Sobo 909e0d7312 Remove defunct 'autoIndentOnPaste' option from customizing-atom docs 2014-03-07 13:39:36 -07:00
Kevin Sawicki e8503f7ddc Upgrade to tree-view@0.76.0 2014-03-07 12:02:08 -08:00
Kevin Sawicki 42a6caf7dc Upgrade to tree-view@0.75.0 2014-03-07 11:34:47 -08:00
Nathan Sobo eaffb12ffb Upgrade to text-buffer@1.4.2 to honor persistent: true marker param 2014-03-07 12:20:15 -07:00
Kevin Sawicki 105e0d3c82 Upgrade to tabs@0.28.0 2014-03-07 11:10:22 -08:00
Kevin Sawicki 534a36c7e1 Upgrade to settings-view@0.90.0 2014-03-07 11:08:07 -08:00
Cheng Zhao b5b8f757b2 Merge pull request #1728 from atom/atom-shell-v0.10.6
Upgrade to atom-shell@0.10.6
2014-03-07 14:11:24 +00:00
Cheng Zhao 10e3dfbfdb Upgrade to atom-shell@0.10.6 2014-03-07 22:05:09 +08:00
Nathan Sobo bfdcbbe9f1 Upgrade to snippets@0.36.0 for CSP support in dev-mode 2014-03-06 19:19:04 -07:00
Nathan Sobo 5d49839236 Don't require loophole unless we need it. Won't happen in production. 2014-03-06 19:13:27 -07:00
Nathan Sobo e6508237e7 Merge pull request #1710 from atom/ns-duplicate-multiple-lines
Handle multiple lines and multiple selections with the editor::duplicate-lines command
2014-03-07 04:01:59 +02:00
Nathan Sobo 2d4797c84e Define allowUnsafeEval in an npm module 2014-03-06 18:56:09 -07:00
Nathan Sobo 392516e60f Delegate activateNextPane correctly 2014-03-06 18:32:24 -07:00
Nathan Sobo d09a2d0772 Merge branch 'master' into ns-duplicate-multiple-lines
Conflicts:
	package.json
2014-03-06 18:16:48 -07:00
Nathan Sobo 2bd5c10f09 Merge branch 'master' into enable-csp 2014-03-06 18:14:25 -07:00
Nathan Sobo 5c910113a3 Depend on text-buffer 1.4.1 since there was a regression in 1.4.0 2014-03-06 18:10:32 -07:00
Kevin Sawicki c591a2e098 Upgrade to language-javascript@0.17.0 2014-03-06 16:26:12 -08:00
Kevin Sawicki b5acc9b093 Upgrade to language-css@0.13.0 2014-03-06 16:17:42 -08:00
Kevin Sawicki 5b6f8ff0f6 Upgrade to wrap-guide@0.17.0 2014-03-06 15:59:03 -08:00
Kevin Sawicki d530d0a4d5 Upgrade to language-html@0.11.0 2014-03-06 15:36:05 -08:00
Kevin Sawicki 211ce4b2d3 Prepare 0.70.0 release 2014-03-06 15:21:34 -08:00
Kevin Sawicki 1800438a77 Upgrade to spell-check@0.28.0 2014-03-06 15:04:47 -08:00
Kevin Sawicki 1eda9a839a Upgrade to first-mate 1.4 2014-03-06 14:40:31 -08:00
Kevin Sawicki e3cc400ac2 Upgrade to language-java@0.9.0 2014-03-06 14:37:55 -08:00
Nathan Sobo b9b3d021cc Add private method docs to DisplayBuffer::outermostFoldsInBufferRange 2014-03-06 15:31:14 -07:00
Nathan Sobo 6e202e18d8 💄 more comment formatting 2014-03-06 15:29:25 -07:00
Kevin Sawicki 750b57859a Upgrade apm for theme convert fix 2014-03-06 14:27:24 -08:00
Kevin Sawicki 7ba520fea1 Upgrade to language-javascript@0.16.0 2014-03-06 14:26:28 -08:00
Nathan Sobo da85a07dae 💄 comment formatting 2014-03-06 15:17:34 -07:00
Corey Johnson 01851523a0 Upgrade to text-buffer@1.4.0 2014-03-06 14:13:06 -08:00
Nathan Sobo eda744f07f Pluralize "Duplicate Lines" menu item 2014-03-06 14:55:15 -07:00
Nathan Sobo 4acfe11af1 Remove previous duplicate-line specs from editor-view-spec 2014-03-06 14:49:20 -07:00
Nathan Sobo 85824c5df6 Handle last buffer line in Editor::duplicateLines 2014-03-06 14:48:52 -07:00
Nathan Sobo 20a0c27111 Rename duplicate-line to duplicate-lines (but retain deprecated method)
Might as well make the name accurate while it's early.
2014-03-06 14:36:25 -07:00
Nathan Sobo 76200884d5 Preserve folds when duplicating lines 2014-03-06 13:16:16 -07:00
Nathan Sobo ce4ce55b29 Make outermostFoldsForBufferRowRange exclusive of end row 2014-03-06 12:52:27 -07:00
Nathan Sobo 66f6e38788 Fix ::translateToBufferMarkerAttributes reference 2014-03-06 12:42:16 -07:00
Nathan Sobo d97a0a3324 Add DisplayBuffer::outermostFoldsInBufferRowRange 2014-03-06 12:36:42 -07:00
Nathan Sobo 63f5a0a324 💄 Rename attributes to params to match TextBuffer naming 2014-03-06 12:32:17 -07:00
Nathan Sobo f0837bb98b 📝 Improve DisplayBuffer::findMarkers docs 2014-03-06 12:31:55 -07:00
Corey Johnson 0f98a72876 Merge pull request #1717 from atom/cj-fix-updater-bug
Fix updater bug
2014-03-06 11:24:56 -08:00
Corey Johnson 1dd59204e9 Only released versions should check for updates
Fixes atom/release-notes#6
2014-03-06 10:51:47 -08:00
Kevin Sawicki decae725a6 Upgrade to bracket-matcher@0.25.0 2014-03-06 10:44:21 -08:00
Kevin Sawicki 6c92d45ff3 Upgrade to first-mate 1.3 2014-03-06 10:34:57 -08:00
Corey Johnson 272dd4a076 Don't trigger window:update-available on new windows
This was causing people to see `undefined` release notes. In the 
future we can store the release notes, but since anything related to
updates and the browser process takes a lot of time to fix I'm holding
off on that improvement.
2014-03-06 10:25:12 -08:00
Corey Johnson 626ebe380e Use proper variable name 2014-03-06 10:14:02 -08:00
Kevin Sawicki f86ce48d65 Upgrade to grammar-selector@0.23.0 2014-03-06 10:12:58 -08:00
Kevin Sawicki ef92cca9db Upgrade to first-mate 1.2.1 2014-03-06 10:03:26 -08:00
Corey Johnson aa71810bfb Merge pull request #1716 from atom/cj-package-naming-doc
Tell people to avoid using the atom- prefix
2014-03-06 09:41:04 -08:00
Kevin Sawicki 22c47ac648 Prepare 0.69.0 release 2014-03-06 09:41:01 -08:00
Kevin Sawicki e592528937 Upgrade to snippets@0.35.0 2014-03-06 09:06:59 -08:00
Corey Johnson 1fdb49f314 Avoid using the atom- prefix 2014-03-06 08:50:18 -08:00
Nathan Sobo aff37d1ae4 WIP: Add failing spec for duplicating folds when duplicating lines 2014-03-06 00:29:35 -07:00
Nathan Sobo a0234d0cc6 Handle empty selections on folded lines 2014-03-06 00:07:59 -07:00
Nathan Sobo 8a77acb51e Duplicate multiple selections and multiple lines; folds are broken 2014-03-05 23:29:28 -07:00
Nathan Sobo 690bbbd14c 💄 Fix indentation level of the last describe in editor-spec
I think I screwed it up in the last commit
2014-03-05 21:34:31 -07:00
Nathan Sobo 9c9bb2f192 💄 Flatten the structure of editor-spec
Previously there were 2 top-level describes:

"with an initial line option"
"with default options"

The default options describe contained almost all the specs, so this
commit just creates the editor again in a single spec about the
initialLine option and peels off a layer.
2014-03-05 21:32:11 -07:00
Nathan Sobo 23a40fe051 💄 Move specs for Editor::reloadGrammar to editor-spec 2014-03-05 21:23:39 -07:00
Kevin Sawicki 5d9cd662fc Upgrade to autocomplete@0.27.0 2014-03-05 17:59:25 -08:00
Kevin Sawicki 6c01589d3b Upgrade to language-css@0.12.0 2014-03-05 17:49:26 -08:00
probablycorey 820dde8ad2 Upgrade to image-view@0.29.0 2014-03-05 17:47:43 -08:00
Kevin Sawicki 3de4d63f44 Upgrade to language-python@0.12.0 2014-03-05 17:44:54 -08:00
Kevin Sawicki e1df82e0c3 Upgrade to language-ruby@0.15.0 2014-03-05 17:41:31 -08:00
Kevin Sawicki c1985b4a10 Upgrade to markdown-preview@0.47.0 2014-03-05 17:40:04 -08:00
Kevin Sawicki 1ca9ce4db3 Upgrade to markdown-preview@0.46.0 2014-03-05 17:30:14 -08:00
Kevin Sawicki 636705bd70 Upgrade apm for template tweaks 2014-03-05 17:12:55 -08:00
Kevin Sawicki 153dcd8ad3 Upgrade to snippets@0.34.0 2014-03-05 17:10:37 -08:00
Kevin Sawicki f2c2fe11b4 Upgrade to language-shellscript@0.8.0 2014-03-05 17:07:03 -08:00
Kevin Sawicki 7a2c4fa5cc Upgrade to markdown-preview@0.45.0 2014-03-05 17:03:01 -08:00
Kevin Sawicki 923816ca8e Upgrade to language-objective-c@0.10.0 2014-03-05 16:57:14 -08:00
Kevin Sawicki 23d0b7b89e Upgrade to bracket-matcher@0.24.0 2014-03-05 16:56:41 -08:00
Kevin Sawicki a6b35f3a22 Upgrade to spell-check@0.27.0 2014-03-05 16:42:05 -08:00
Kevin Sawicki 87fb39c8a5 Upgrade to language-php@0.10.0 2014-03-05 16:28:24 -08:00
Kevin Sawicki 4d188a79fb Merge pull request #1706 from atom/ks-first-mate-1-point-2
Upgrade to first-mate@1.2
2014-03-05 16:18:26 -08:00
Kevin Sawicki a02b807dad Upgrade to first-mate@1.2 2014-03-05 16:04:54 -08:00
Kevin Sawicki e0fa9d0213 Merge pull request #1697 from atom/ks-serialize-project
Serialize project
2014-03-05 15:18:20 -08:00
Kevin Sawicki 35ad8abf4c Add expect for project state 2014-03-05 15:06:19 -08:00
Kevin Sawicki 372ca374cc Serialize project 2014-03-05 15:06:19 -08:00
Corey Johnson 75b6e94be1 Merge pull request #1699 from atom/cj-convert-keystrokes-using-shift
Converts keystrokes with alpha chars using shift
2014-03-05 15:00:42 -08:00
Kevin Sawicki f912d0ef88 Upgrade to update-package-dependencies@0.6.0 2014-03-05 10:39:53 -08:00
probablycorey 1bf8a01d0b Upgrade to whitespace@0.18.0 2014-03-05 10:26:16 -08:00
Nathan Sobo 5e8213d45f Add atom.allowUnsafeEval loophole and disable unsafe-eval again
With Node.js baked in, there's no water-tight way to prevent users from
evaluating code at runtime, at least with CSP alone. This is because
node exposes a 'vm' module that allows scripts to be compiled. There's
also `module._compile`, etc.

I think a reasonable compromise is to protect users from eval'ing code
by accident. This commit adds an atom.allowUnsafeEval method which
re-enables eval in the dynamic scope of the given function.

I then use this to compile the keystroke grammar which saves us the
complexity of pre-compiling it during specs.

What do people think?
2014-03-05 09:57:08 -07:00
Nathan Sobo 8b093122ac Add Workspace to exported class list 2014-03-05 09:00:39 -07:00
Nathan Sobo bc14ad5b15 Fix broken docs links 2014-03-05 08:53:38 -07:00
Patrick Toomey fc543fc5a6 add unsafe-eval for now 2014-03-05 09:32:49 -06:00
Patrick Toomey 2e3aec81e7 initial attempt at CSP policy to see what breaks 2014-03-05 09:03:27 -06:00
Cheng Zhao 9b04578d3e Merge pull request #1701 from atom/atom-shell-v0.10.5
Upgrade to atom-shell@0.10.5
2014-03-05 14:23:08 +00:00
Cheng Zhao 6654d32229 Upgrade to atom-shell@0.10.5 2014-03-05 22:14:25 +08:00
Ben Ogle 7c2c9448a3 Upgrade find-and-replace@0.89.1 2014-03-04 18:53:26 -08:00
Kevin Sawicki 6531128647 📝 Add missing h 2014-03-04 18:25:31 -08:00
Kevin Sawicki fd1b895ff9 Prepare 0.68.0 release 2014-03-04 18:07:28 -08:00
probablycorey f4e88bbcc0 Make sure shift is not double added 2014-03-04 18:00:00 -08:00
Kevin Sawicki 7993f98166 Merge pull request #1700 from atom/ks-single-apm
Remove apm from node_modules
2014-03-04 17:57:08 -08:00
Kevin Sawicki e11b775a31 Upgrade to settings-view@0.89.0 2014-03-04 17:51:37 -08:00
Kevin Sawicki b999494154 Upgrade to package-generator@0.30.0 2014-03-04 17:50:46 -08:00
Kevin Sawicki 6a7ed1a948 Upgrade to update-package-dependencies@0.5.0 2014-03-04 17:49:57 -08:00
probablycorey d0889cca31 Normalize keystrokes to use shift and the uppercase letter
`cmd-shift-l`, `cmd-L` and `cmd-shift-L` all normalize to `cmd-shift-L`
2014-03-04 17:42:32 -08:00
probablycorey 8b673c7adf Refer to char instead of chars 2014-03-04 17:34:17 -08:00
Kevin Sawicki f1b0390b9b Remove apm from node_modules 2014-03-04 17:26:52 -08:00
Kevin Sawicki b43d767a26 Upgrade apm for node being on PATH during install 2014-03-04 17:22:47 -08:00
Nathan Sobo bd4f642045 Merge pull request #1698 from atom/ns-fix-soft-wraps-with-hard-tabs
Fix position translation bug for wrapped lines with hard tabs
2014-03-05 03:16:06 +02:00
Ben Ogle 3bdfc7d785 Upgrade to find-and-replace@0.89.0 2014-03-04 17:04:52 -08:00
probablycorey 4aa73968f0 Converts keystrokes with alpha chars using shift
e.g. cmd-shift-l would be converted to cmd-L
2014-03-04 17:04:06 -08:00
Nathan Sobo 06bc09951d Fix position translation bug for wrapped lines with hard tabs
Fixes #1681
2014-03-04 17:55:53 -07:00
Ben Ogle 9d59043788 Upgrade solarized-dark-syntax@0.12.0 2014-03-04 16:54:31 -08:00
Nathan Sobo 33f0ca3042 Merge pull request #1695 from atom/ns-fix-softwrap-with-scrollbars
When scrollbar is visible, account for it when soft wrapping lines
2014-03-05 01:52:19 +02:00
Nathan Sobo e1bc62dae3 Add a spec for line wrapping in the presence of legacy scrollbars 2014-03-04 16:45:50 -07:00
Kevin Sawicki 77dbe9ccac Prepare 0.67.0 release 2014-03-04 15:35:36 -08:00
Kevin Sawicki 150d8c2119 Upgrade apm for semver version fix 2014-03-04 14:52:48 -08:00
Kevin Sawicki b16f6adf76 Upgrade to language-go@0.7.0 2014-03-04 14:50:54 -08:00
Nathan Sobo 834dd963ef Subtract the scrollbar's width when calculating editor's width in chars
Fixes #1342
2014-03-04 15:46:07 -07:00
Kevin Sawicki 01e0f9c2b7 Upgrade to language-c@0.13.0 2014-03-04 14:45:50 -08:00
Kevin Sawicki b4c0bb1f18 Upgrade apm for upgrade command 2014-03-04 14:43:57 -08:00
Corey Johnson f70fc683d1 Merge pull request #1693 from atom/cj-check-for-update-fix
Fix "check for update" crash
2014-03-04 14:03:38 -08:00
probablycorey 956d4bd5bf Rely on events to hide the "Check for update" menu item 2014-03-04 12:31:32 -08:00
probablycorey 8b45f89a75 Remove unnecessary method 2014-03-04 12:30:15 -08:00
probablycorey def6b67c8f Menu items hide conflicting items when made visible. 2014-03-04 12:26:50 -08:00
probablycorey e8136853db Add 'downloading update' menu item
Fixes #1689, gets around the crashing bug when displaying a dialog
when update is found.
2014-03-04 12:26:50 -08:00
probablycorey 084b41e33b Remove listeners after check for update is run. 2014-03-04 12:26:50 -08:00
probablycorey 6242bd7eb7 Update cson link 2014-03-04 12:25:59 -08:00
Kevin Sawicki 5fbe298f9c Upgrade to timecop@0.17.0 2014-03-04 12:00:31 -08:00
Kevin Sawicki b1c2c645df Upgrade to image-view@0.28.0 2014-03-04 10:41:19 -08:00
Kevin Sawicki d2a6aa5462 Merge pull request #1683 from atom/ks-npm-remove-strict-ssl
npm ca issue
2014-03-04 10:32:53 -08:00
Kevin Sawicki 71abe66b8f Put npm cache in ~/.atom/.npm 2014-03-04 10:19:20 -08:00
Kevin Sawicki 01eb6e31ba Revert "Set --ca to null on the command line"
This reverts commit 7f4c8023aee10ded0088076773c6c13f92993aab.
2014-03-04 10:19:20 -08:00
Kevin Sawicki 071e6f885f Set --ca to null on the command line 2014-03-04 10:19:20 -08:00
Kevin Sawicki 5fcde96f88 Add .npmrc file with default ca value 2014-03-04 10:19:20 -08:00
Nathan Sobo a1ad10b3ee Merge pull request #1671 from atom/ns-improve-workspace-api-docs
Improve Workspace and WorkspaceView API docs
2014-03-04 20:18:34 +02:00
Nathan Sobo 6d26732208 Merge pull request #1674 from atom/ns-scrollbar-style
Apply 'scrollbars-visible-always/when-scrolling' class to WorkspaceView
2014-03-04 20:08:25 +02:00
Nathan Sobo 20a396f190 Merge branch 'master' into ns-improve-workspace-api-docs 2014-03-04 11:04:24 -07:00
Nathan Sobo 4b7e5ca9fc Make Workspace::openSync private for now 2014-03-04 11:02:52 -07:00
Nathan Sobo 8522707bd2 Switch to .scrollbars-visible-always/when-scrolling class names 2014-03-04 10:50:45 -07:00
Kevin Sawicki a1505736d7 Upgrade to language-ruby-on-rails@0.10.0 2014-03-04 09:49:27 -08:00
Kevin Sawicki 5cd17028d6 Upgrade to settings-view@0.88.0 2014-03-04 09:33:45 -08:00
Kevin Sawicki 3089dd8688 Upgrade to language-javascript@0.15.0 2014-03-04 09:31:40 -08:00
Kevin Sawicki 044c45225b Upgrade to snippets@0.33.0 2014-03-04 09:31:40 -08:00
Corey Johnson 0c1ade82b2 Merge pull request #1680 from atom/izuzak/minor-docs-fixes
Minor documentation tweaks/fixes
2014-03-04 09:26:38 -08:00
Ivan Zuzak 7fdf5ed7dc remove public link to private apm repo 2014-03-04 15:50:49 +01:00
Ivan Zuzak 6fb956688a add short init.coffee example 2014-03-04 14:42:23 +01:00
Ivan Zuzak 28b362f8ff add coffeescript link 2014-03-04 14:12:41 +01:00
Ivan Zuzak 7035ccdcd2 add CSON link to docs 2014-03-04 14:11:12 +01:00
Ivan Zuzak ba5ac8d872 use - instead of + in keyboard shortcuts 2014-03-04 14:06:02 +01:00
Nathan Sobo ea16ecc81f 💄 Drop the ::onValue call 2014-03-03 22:38:17 -07:00
Nathan Sobo 0eac9d3e6f Apply 'scrollbar-style-x' class to WorkspaceView
…where x is 'overlay' or 'legacy' depending on whether the scrollbars
are only visible when scrolling (overlay) or always visible (legacy).

This will allow us to style scrollbars in legacy mode without forcing
them to be visible in overlay mode.
2014-03-03 22:33:48 -07:00
Kevin Sawicki 68a8b6d437 Upgrade to tree-view@0.74.0 2014-03-03 19:21:34 -08:00
Kevin Sawicki e136ba9f3e Upgrade to fuzzy-finder@0.39.0 2014-03-03 19:21:02 -08:00
Kevin Sawicki 9ee6bea772 Remove stray snippet 2014-03-03 18:51:17 -08:00
Kevin Sawicki 79bdde4f08 Upgrade to tree-view@0.73.0 2014-03-03 18:48:24 -08:00
Kevin Sawicki 2a5f0e3c9f Upgrade to autocomplete@0.26.0 2014-03-03 17:44:58 -08:00
Kevin Sawicki 3c42f3de47 Upgrade to autocomplete@0.25.0 2014-03-03 17:40:44 -08:00
Kevin Sawicki 7cd15d408e Prepare 0.66.0 2014-03-03 16:10:16 -08:00
Nathan Sobo 5228b778dc Add deprecated ::joinLine method 2014-03-03 16:51:39 -07:00
Ben Ogle 49eaf7afeb Upgrade markdown-preview@0.44.0 2014-03-03 15:42:05 -08:00
probablycorey b2f02232f2 Upgrade to feedback@0.28.0 2014-03-03 15:21:39 -08:00
Ben Ogle 2f2d7da20b Upgrade apm 2014-03-03 15:05:23 -08:00
Nathan Sobo 168043d422 Clean up WorkspaceView API docs 2014-03-03 16:00:36 -07:00
Nathan Sobo 101e1f6b50 Export {Workspace} in the 'atom' module 2014-03-03 16:00:36 -07:00
Nathan Sobo 323b6cec9d Clean up the Workspace API docs 2014-03-03 16:00:36 -07:00
Ben Ogle 019a04c488 Upgrade to status-bar@0.35.0 2014-03-03 14:54:01 -08:00
Ben Ogle e566bbc5e7 Upgrade to find-and-replace@0.88.0 2014-03-03 14:41:18 -08:00
Ben Ogle d2140672fd Revert "Upgrade find-and-replace@0.88.0"
This reverts commit 0d8ad2d8b0.
2014-03-03 14:40:00 -08:00
Ben Ogle 667df80d35 Upgrade status-bar@0.34.0 2014-03-03 14:24:28 -08:00
Ben Ogle 0d8ad2d8b0 Upgrade find-and-replace@0.88.0 2014-03-03 14:22:56 -08:00
Ben Ogle 1796ff6871 Merge pull request #1644 from atom/bo-syntax-variable-update
Update syntax color variables
2014-03-03 14:21:28 -08:00
Kevin Sawicki 49c54ee69a Upgrade to settings-view@0.87.0 2014-03-03 13:31:55 -08:00
Kevin Sawicki d8e314b0a0 Upgrade apm to include bundled node 2014-03-03 12:43:01 -08:00
watsonian 65acfe61ce Bump Atom's whitespace package dependency. 2014-03-03 11:44:55 -06:00
Kevin Sawicki 2f067de10a Upgrade to settings-view@0.86.0 2014-03-03 09:20:29 -08:00
Kevin Sawicki acecb50f7e Upgrade to command-palette@0.19.0 2014-03-03 09:01:41 -08:00
Kevin Sawicki 9b27932d2c Upgrade to language-coffee-script@0.15.0 2014-03-02 17:40:55 -08:00
Kevin Sawicki 4aa8c0a76a Prevent SelectListView from closing on scrollbar clicks 2014-03-02 17:22:30 -08:00
Kevin Sawicki 246e43217a Upgrade to release-notes@0.26.0 2014-03-02 16:54:11 -08:00
Kevin Sawicki 6925a5f3a4 Upgrade to background-tips@0.9.0 2014-03-02 16:41:56 -08:00
Kevin Sawicki 81a92a9f13 Upgrade to timecop@0.16.0 2014-03-02 16:25:33 -08:00
Kevin Sawicki 8440d66d33 Upgrade to link@0.20.0 2014-03-02 16:19:13 -08:00
Kevin Sawicki 63ce978afe Upgrade to tabs@0.27.0 2014-03-02 15:09:55 -08:00
Kevin Sawicki b4e6386496 Upgrade to language-javascript@0.14.0 2014-03-02 14:19:19 -08:00
Cheng Zhao f524a96add Merge pull request #1660 from atom/atom-shell-v0.10.4
Upgrade to atom-shell@0.10.4
2014-03-02 10:54:31 +00:00
Cheng Zhao 1d0f3bb831 Upgrade to atom-shell@0.10.4 2014-03-02 18:46:32 +08:00
Nathan Sobo 2e0ef27570 Update to language-css@0.11.0 for new html5 tags 2014-03-01 17:16:24 -08:00
Nathan Sobo ebbb8fcef1 Upgrade to exception-reporting@0.17.0 2014-03-01 17:09:34 -08:00
Kevin Sawicki 1d89d3dbe9 Upgrade to language-ruby-on-rails@0.9.0 2014-03-01 17:08:10 -08:00
Kevin Sawicki 18512f5b99 Upgrade to language-python@0.11.0 2014-03-01 17:02:39 -08:00
Kevin Sawicki 5d4906b4d1 Upgrade to language-html@0.10.0 2014-03-01 16:59:50 -08:00
Kevin Sawicki 5e83a0eea6 Upgrade to language-python@0.10.0 2014-03-01 16:19:21 -08:00
Kevin Sawicki 3f43856145 Upgrade to symbols-view@0.41.0 2014-03-01 16:14:08 -08:00
Nathan Sobo bb16ca6394 Prepare 0.65.0 release 2014-03-01 16:07:54 -08:00
Kevin Sawicki 3f83aaf32d Upgrade to language-ruby-on-rails@0.8.0 2014-03-01 15:56:21 -08:00
Kevin Sawicki e8ec565273 Upgrade to language-php@0.9.0 2014-03-01 15:51:28 -08:00
Kevin Sawicki 8ab6460571 Upgrade to language-html@0.9.0 2014-03-01 15:49:21 -08:00
Kevin Sawicki 19f7abf0f8 Upgrade to tabs@0.26.0 2014-03-01 15:47:39 -08:00
Kevin Sawicki ce2ad727c6 Use atom@github.com in crash message instead of repo 2014-03-01 15:47:39 -08:00
Nathan Sobo fe213d1e13 Nuke this section without nuking all the links 2014-03-01 15:41:54 -08:00
Nathan Sobo 35b78af446 Revert "Remove outdated section of the creating-a-package docs"
This reverts commit ce5eef2605.
2014-03-01 15:41:54 -08:00
Kevin Sawicki a72d4ccded Upgrade to language-ruby@0.14.0 2014-03-01 15:32:20 -08:00
Kevin Sawicki 1babf4ba55 Upgrade to tabs@0.25.0 2014-03-01 15:31:37 -08:00
Nathan Sobo 18ab2477a8 Prepare 0.64.0 release 2014-03-01 15:10:58 -08:00
Nathan Sobo 9d56392cbc Merge pull request #1657 from atom/ns-multiple-unsaved-buffers
Allow multiple unsaved buffers
2014-03-02 00:50:12 +02:00
Nathan Sobo 7cc68f59a7 Allow multiple unsaved empty buffers to be opened
Fixes #1600
2014-03-01 14:40:48 -08:00
Nathan Sobo d6a9a0b15f Remove Editor::isEqual
An editor is such a stateful concept that comparing different instances
for "equality" doesn't make much sense. This was interfering with the
ability to distinguish successive editors assigned as active pane items.
2014-03-01 14:39:32 -08:00
Kevin Sawicki 766471f4b9 Upgrade to image-view@0.27.0 2014-03-01 14:24:08 -08:00
Kevin Sawicki 143a6a9cca Upgrade to image-view@0.26.0 2014-03-01 14:24:08 -08:00
Nathan Sobo 7ad41a3ff2 Upgrade text-buffer to 1.2.0 for ::backwardsScan 2014-03-01 13:28:11 -08:00
Kevin Sawicki 12fadffb00 Upgrade to language-gfm@0.19.0 2014-03-01 13:27:45 -08:00
Kevin Sawicki ef97128fe6 Upgrade to language-xml@0.8.0 2014-03-01 13:17:25 -08:00
Kevin Sawicki 1b0bc366e4 Upgrade to language-javascript@0.13.0 2014-03-01 13:15:28 -08:00
Kevin Sawicki 89c87f99e8 Upgrade to markdown-preview@0.43.0 2014-03-01 13:11:24 -08:00
Ben Ogle 0e0b6a4978 Upgrade atom-light-syntax@0.15.0 2014-03-01 11:28:17 -08:00
Cheng Zhao 7fe3caf841 Merge pull request #1618 from atom/cz-build-symbols
Provide breakpad symbols of native modules
2014-03-01 11:31:59 +00:00
Ben Ogle 2799892f1d Upgrade to atom-dark-syntax@0.15.0 2014-02-28 20:36:36 -08:00
Ben Ogle 7ecd839310 Update solarized-light-syntax@0.7.0 2014-02-28 20:14:41 -08:00
Ben Ogle 11a2628ed2 Upgrade solarized-dark-syntax@0.11.0 2014-02-28 19:50:15 -08:00
Ben Ogle a24b9cf9b9 Upgrade base16-tomorrow-dark-theme 2014-02-28 19:26:11 -08:00
Ben Ogle 705f77f5ba Comments 2014-02-28 17:38:08 -08:00
Ben Ogle c71cbf2e09 Add variables for wrap-guide and indent-guide 2014-02-28 17:38:08 -08:00
Ben Ogle 33aba7b721 Update syntax color variables 2014-02-28 17:38:08 -08:00
Kevin Sawicki 58f4e5bf76 Upgrade to open-on-github@0.23.0 2014-02-28 16:29:37 -08:00
Kevin Sawicki 2095c7546a Upgrade to fuzzy-finder@0.38.0 2014-02-28 16:19:45 -08:00
Kevin Sawicki 6005444fda Upgrade to markdown-preview@0.42.0 2014-02-28 16:12:47 -08:00
Kevin Sawicki 658ccaf78f Bump apm for screenshots in README templates 2014-02-28 15:43:46 -08:00
Kevin Sawicki 3112b2b071 Upgrade to bracket-matcher@0.23.0 2014-02-28 15:38:46 -08:00
Kevin Sawicki 32f746b918 Upgrade to open-on-github@0.22.0 2014-02-28 15:31:45 -08:00
Kevin Sawicki 5145a0260d Upgrade apm for publish doc fix 2014-02-28 14:47:28 -08:00
Kevin Sawicki acc782b754 Upgrade to language-python@0.9.0 2014-02-28 14:43:04 -08:00
Kevin Sawicki e6508e6978 Upgrade to markdown-preview@0.41.0 2014-02-28 14:42:50 -08:00
Nathan Sobo 4e45fbbc04 Merge pull request #1617 from atom/fix-keybinding-docs
Fix CSON syntax for keybinding example in docs
2014-03-01 00:10:41 +02:00
Ben Ogle 81c2d70fbb Update find-and-replace@0.87.0 2014-02-28 13:28:33 -08:00
Kevin Sawicki d2ec20bd10 Upgrade to archive-view@0.26.0 2014-02-28 12:31:41 -08:00
Nathan Sobo 6e3a7f8fa0 Fix licenses task, list "All Rights Reserved" in package.json for now. 2014-02-28 11:27:08 -08:00
Nathan Sobo 8e83acbafd Remove apache license from package.json 2014-02-28 11:20:50 -08:00
Nathan Sobo 40a8522460 Merge pull request #1623 from atom/ns-fix-editor-width-related-freezes
Fix freezes related to the editor's width in characters being assigned to non-positive integers
2014-02-28 20:38:07 +02:00
Nathan Sobo dfa9ca733e Merge pull request #1622 from atom/ns-fix-row-map-corruption
Fix row map corruption
2014-02-28 20:33:10 +02:00
Nathan Sobo 4681098e8c Only allow positive widths in characters to be assigned
Fixes #1574
2014-02-28 10:31:02 -08:00
Kevin Sawicki 4f81d53d11 Prepare 0.63.0 2014-02-28 10:27:33 -08:00
Nathan Sobo dc5dc608ba Avoid row map corruption when replacing a subset of a fold's buffer rows
Fixes #1576

When splicing regions into the row map, we always express the starting
buffer row, then the number of buffer rows covered by the regions we're
inserting. When we're inserting regions representing folds, they always
extend to the end of a fold, so we need to ensure the endBufferRow also
extends to the end of the fold.

For example, say rows [5…10] are folded, and we handle a replacement of
rows [5…8]. We will still insert a region for the fold covering 1 screen
row and 5 buffer rows, so we need to update the endBufferRow to extend
to the end of the fold as well (10).
2014-02-28 10:11:57 -08:00
Nathan Sobo 83dc1c76ef Add a spec that corrupts the row map by partially editing a fold 2014-02-28 10:11:57 -08:00
Kevin Sawicki d660e9a066 Go back to strict-ssl false 2014-02-28 10:01:54 -08:00
Kevin Sawicki abcaaa3264 Try single quotes for empty ca arg 2014-02-28 09:53:39 -08:00
Kevin Sawicki 7f2b871885 Use known list of registrars 2014-02-28 09:43:38 -08:00
Kevin Sawicki e51dd05989 Disable strict-ssl for now on janky machines
This is until we can get npm upgraded there.
2014-02-28 09:33:18 -08:00
Kevin Sawicki 51da7732f4 Upgrade apm for npm 1.4.4 upgrade 2014-02-28 08:49:50 -08:00
Cheng Zhao 1b7dc2f147 Make publish-build support multiple assets. 2014-02-28 16:49:03 +08:00
Garen Torikian 63aedb65d9 Fix CSON syntax for keybinding example 2014-02-28 00:01:12 -08:00
Cheng Zhao 9c503fe8d6 💄 2014-02-28 13:45:53 +08:00
Cheng Zhao 83e59bf5b0 Dump symbols when in CI. 2014-02-28 13:34:49 +08:00
Cheng Zhao 4ef5c374ef Upload symbols when publishing build. 2014-02-28 13:30:55 +08:00
Cheng Zhao 764b31fdcd Add dump-symbols task. 2014-02-28 13:09:03 +08:00
probablycorey 7fe2b41209 Upgrade to welcome@0.11.0 2014-02-27 20:45:12 -08:00
Cheng Zhao 25a14bf44f Add minidump as build dependency. 2014-02-28 10:56:57 +08:00
Kevin Sawicki bde3606757 Upgrade to link@0.19.0 2014-02-27 17:59:12 -08:00
Kevin Sawicki 84f7af7e58 Upgrade to tree-view@0.72.0 2014-02-27 17:45:10 -08:00
Ben Ogle bf0a448bff Upgrade package-generator@0.29.0 2014-02-27 17:18:18 -08:00
Ben Ogle be148574e3 Merge pull request #1611 from atom/bo-theme-doc-update
Theme doc update
2014-02-27 17:13:52 -08:00
Nathan Sobo 235e00c19a Merge pull request #1583 from atom/ns-improve-editor-api-docs
Improve generated editor docs
2014-02-28 03:12:49 +02:00
Kevin Sawicki 87035eb4a9 Upgrade to grammar-selector@0.22.0 2014-02-27 17:09:46 -08:00
Ben Ogle e67a9c9664 Changes for kevin 2014-02-27 17:05:10 -08:00
Kevin Sawicki 719dfd91ab Upgrade to find-and-replace@0.86.0 2014-02-27 16:47:47 -08:00
Kevin Sawicki 5f97c46e5f Upgrade to underscore-plus@1.0.2 2014-02-27 16:34:29 -08:00
Ben Ogle 739d171462 Add naming convention for -ui themes 2014-02-27 16:32:04 -08:00
Kevin Sawicki f105602da5 Upgrade to symbols-view@0.40.0 2014-02-27 16:31:08 -08:00
Ben Ogle 01f4ebde54 Add a bit about naming a syntax theme 2014-02-27 16:29:35 -08:00
Ben Ogle 97f3d1662e Add tip 2014-02-27 16:29:04 -08:00
Nathan Sobo aa04589dd2 Rename Editor::joinLine to ::joinLines
It acts on multiple lines, and in a quick survey of the literature I see
Sublime docs referring to it as "join lines" as well.
2014-02-27 16:16:01 -08:00
Nathan Sobo 9473039a0b Publicize Editor::foldBufferRow 2014-02-27 16:16:01 -08:00
Nathan Sobo 574cc098c6 Remove unused methods 2014-02-27 16:16:01 -08:00
Nathan Sobo f17c490768 Make Editor::unfoldBufferRow destroy all folds containing the buffer row
Also, remove ::destroyAllFoldsContainingBufferRow as it is now redundant
2014-02-27 16:16:01 -08:00
Nathan Sobo 6d246f5244 Rename Editor::foldSelection to Editor::foldSelectedLines and publicize 2014-02-27 16:16:01 -08:00
Nathan Sobo bec30ae833 Remove self references from Editor overview 2014-02-27 16:16:01 -08:00
Nathan Sobo feb501c76f Add a common tasks section to the Editor class overview 2014-02-27 16:16:00 -08:00
Nathan Sobo b32f4ad80a Kill example heading 2014-02-27 16:16:00 -08:00
Nathan Sobo 4b12228b15 Fix broken method links 2014-02-27 16:16:00 -08:00
Nathan Sobo afd576697e Remove some metaprogrammed delegators and add docs 2014-02-27 16:16:00 -08:00
Nathan Sobo 6a24360ffd Revise Editor class overview; add coordinate system explanation 2014-02-27 16:16:00 -08:00
Nathan Sobo 5faa69b66c Update Editor API docs 2014-02-27 16:16:00 -08:00
Nathan Sobo 833498011c Privatize ::bufferRangeForBufferRow 2014-02-27 16:16:00 -08:00
Nathan Sobo 4f6cc659c4 Make Editor::setVisible private 2014-02-27 16:16:00 -08:00
Nathan Sobo 5cef77e52c Clean up Editor class overview 2014-02-27 16:16:00 -08:00
Nathan Sobo 712ab734dd Privatize methods on Editor
- ::isEqual
- ::destroyFoldsIntersectingBufferRange
- ::destroyMarker
- ::addCursor
- ::addSelection
2014-02-27 16:16:00 -08:00
Kevin Sawicki 0f0a57af1c Prepare 0.62.0 2014-02-27 16:02:06 -08:00
Nathan Sobo ce5eef2605 Remove outdated section of the creating-a-package docs 2014-02-27 15:59:06 -08:00
Nathan Sobo 6d6960badb Merge pull request #1610 from atom/ns-better-error-reporting
Improve reporting of display buffer errors
2014-02-28 01:50:47 +02:00
Corey Johnson 54269aa92a Upgrade to fuzzaldrin@1.1.0 2014-02-27 15:39:17 -08:00
Kevin Sawicki ec65a71d6d Merge pull request #1607 from atom/ks-bump-max-size-to-two-mb
Bump max size to 2MB
2014-02-27 15:39:10 -08:00
Nathan Sobo 761fcde654 💄 2014-02-27 15:34:19 -08:00
Kevin Sawicki 3346ddac38 Bump max size to 2MB 2014-02-27 15:32:19 -08:00
Nathan Sobo f20c55f849 Use error constructor's name explicitly rather than arguments.callee 2014-02-27 15:29:47 -08:00
Kevin Sawicki 37c5c35a12 Upgrade to language-less@0.6.0 2014-02-27 15:28:29 -08:00
Nathan Sobo e541ccb197 Update exception-reporting to 0.16.0 for metadata, custom error names 2014-02-27 15:07:08 -08:00
Nathan Sobo 1f7027d825 Throw a custom BufferToScreenConversion error with metadata 2014-02-27 15:07:08 -08:00
Kevin Sawicki 0d9e7a5e08 Only scan dirty buffers that are inside the project 2014-02-27 14:44:34 -08:00
Kevin Sawicki c4ac96e669 Upgrade to markdown-preview@0.40.0 2014-02-27 13:48:48 -08:00
Kevin Sawicki 74f65b978e Bump minimum version to 10.8
Closes #1598
2014-02-27 13:35:00 -08:00
Kevin Sawicki eab874b3ef Upgrade to symbols-view@0.39.0 2014-02-27 13:27:12 -08:00
Kevin Sawicki 54d9361dad Upgrade to release-notes@0.25.0 2014-02-27 13:06:09 -08:00
Kevin Sawicki e8cd130ad6 Upgrade to markdown-preview@0.39.0 2014-02-27 13:02:30 -08:00
Kevin Sawicki 2f70f4ba25 📝 publishing not publish in links 2014-02-27 12:07:13 -08:00
Kevin Sawicki 1548167b94 Upgrade to language-make@0.9.0 2014-02-27 11:45:05 -08:00
Kevin Sawicki 91a320127a Upgrade to settings-view@0.85.0 2014-02-27 11:27:51 -08:00
Kevin Sawicki 7a0a4dc3b3 Upgrade to go-to-line@0.18.0 2014-02-27 11:11:36 -08:00
Kevin Sawicki ba9c006cb4 Update to wrap-guide@0.16.0 2014-02-27 11:06:01 -08:00
Kevin Sawicki 2f92160e9c Upgrade to styleguide@0.26.0 2014-02-27 11:01:38 -08:00
Kevin Sawicki 8f0063465c Update apm for 2fa sms fix 2014-02-27 10:55:12 -08:00
Nathan Sobo 0c8bb089b9 Reduce variation of buffer row to screen row conversion error message 2014-02-27 10:34:57 -08:00
Kevin Sawicki 746b99508b Upgrade to language-coffee-script@0.14.0 2014-02-27 09:32:48 -08:00
Kevin Sawicki 05ce497f29 Upgrade to language-javascript@0.12.0 2014-02-27 09:32:09 -08:00
Kevin Sawicki 5bfb382209 Upgrade to settings-view@0.84.0 2014-02-27 09:31:26 -08:00
Cheng Zhao 32efa7b112 Merge pull request #1599 from atom/atom-shell-v0.10.2
Upgrade to atom-shell@0.10.2
2014-02-27 17:18:32 +00:00
Cheng Zhao e4fcd589db Upgrade to atom-shell@0.10.3 2014-02-28 01:07:35 +08:00
Kevin Sawicki 8da5a99196 Upgrade to markdown-preview@0.38.0 2014-02-27 09:02:42 -08:00
Kevin Sawicki d5cb79027a Link to creating-a-package doc 2014-02-27 08:00:43 -08:00
Kevin Sawicki fea1a001ee Link to proper theme doc 2014-02-27 08:00:43 -08:00
Cheng Zhao 3ae6f0a93d Upgrade to atom-shell@0.10.2 2014-02-27 19:05:56 +08:00
Nathan Sobo 28d7db2371 Set overflow to 'hidden' on panes. I'm pretty sure this fixes #1594. 2014-02-26 18:19:07 -08:00
Kevin Sawicki 02b582a60d Prepare 0.61.0 release 2014-02-26 17:27:37 -08:00
Kevin Sawicki 83a40e1b33 Upgrade to settings-view@0.83.0 2014-02-26 17:16:41 -08:00
Corey Johnson ca0a875e6b Upgrade to welcome@0.10.0 2014-02-26 17:15:20 -08:00
Kevin Sawicki 9932d4789e Upgrade apm for init/clean arg checking 2014-02-26 15:44:32 -08:00
Kevin Sawicki 2c68dfd8cf Upgrade apm for relaxed publish repo check 2014-02-26 15:11:59 -08:00
Kevin Sawicki 64f66fad4d 📝 Update tests section 2014-02-26 13:30:41 -08:00
Kevin Sawicki 5a8e3100b9 Link to conversion guides 2014-02-26 13:18:38 -08:00
probablycorey 87dedc3dd2 Prepare 0.60.0 release 2014-02-26 12:23:37 -08:00
probablycorey 69b442c2a9 Prepare 0.59.0 release 2014-02-26 12:00:43 -08:00
probablycorey 77bf358d7a Upgrade to welcome@0.9.0 2014-02-26 11:55:43 -08:00
Kevin Sawicki 9ed7254277 Use 16 as font size default 2014-02-26 11:46:07 -08:00
Kevin Sawicki 1a08d99079 Prepare 0.58.0 release 2014-02-26 11:38:41 -08:00
Kevin Sawicki f852dcfd20 Upgrade apm for search command auth fix 2014-02-26 11:23:03 -08:00
Kevin Sawicki 04a4f4d5bb Upgrade apm for removed travis command 2014-02-26 11:17:46 -08:00
Kevin Sawicki 2e42dd3308 Upgrade apm version package.json version bump 2014-02-26 10:44:56 -08:00
Kevin Sawicki e9cf8d4647 Remove internal docs for beta
These can come back, just don't want them searchable for beta.
2014-02-26 10:30:15 -08:00
Kevin Sawicki 216351803b Upgrade to metrics@0.30.0 2014-02-26 10:17:40 -08:00
Kevin Sawicki d3eb969095 Upgrade to metrics@0.29.0 2014-02-26 10:14:26 -08:00
Kevin Sawicki 77c405626f Prepare 0.57.0 release 2014-02-26 09:55:28 -08:00
Kevin Sawicki e0af2122d2 📝 Add missing comma 2014-02-26 09:22:02 -08:00
Kevin Sawicki 1bd1121d50 📝 when instead of with 2014-02-26 09:20:57 -08:00
Kevin Sawicki 54e2a2af9d Upgrade to language-coffee-script@0.13.0 2014-02-26 08:37:46 -08:00
Kevin Sawicki 90a0b31cf8 Upgrade to feedback@0.27.0 2014-02-26 08:36:18 -08:00
Kevin Sawicki 1b257df5cf Upgrade to welcome@0.8.0 2014-02-25 21:34:33 -08:00
probablycorey b73acc88a7 Send release notes along with releaseName 2014-02-25 20:40:14 -08:00
Kevin Sawicki c6bb6b48b6 Upgrade to welcome@0.7.0 2014-02-25 20:32:52 -08:00
Kevin Sawicki cb95c3050d Prepare 0.56.0 release 2014-02-25 20:11:20 -08:00
152 arquivos alterados com 9904 adições e 5606 exclusões
+2 -1
Ver Arquivo
@@ -1,5 +1,7 @@
*.swp
*~
.DS_Store
Thumbs.db
.project
.svn
.nvm-version
@@ -11,4 +13,3 @@ debug.log
docs/output
docs/includes
spec/fixtures/evil-files/
/apm
-3
Ver Arquivo
@@ -1,3 +0,0 @@
[submodule "vendor/apm"]
path = vendor/apm
url = https://github.com/atom/apm.git
+2
Ver Arquivo
@@ -0,0 +1,2 @@
ca =
cache = ~/.atom/.npm
+7 -6
Ver Arquivo
@@ -10,7 +10,7 @@ to propose changes to this document in a pull request.
that behavior such as Emacs, vi, Xcode, etc.
* Check the Console app for stack traces to include if reporting a crash.
* Check the Dev tools (`alt-cmd-i`) for errors and stack traces to include.
### Package Repositories
This is the repository for the core Atom editor only. Atom comes bundled with
@@ -30,7 +30,7 @@ in the proper package's repository.
* Follow the [CoffeeScript](#coffeescript-styleguide),
[JavaScript](https://github.com/styleguide/javascript),
and [CSS](https://github.com/styleguide/css) styleguides
* Include thoughtfully worded [Jasmine](http://pivotal.github.com/jasmine)
* Include thoughtfully worded [Jasmine](http://jasmine.github.io/)
specs
* Avoid placing files in `vendor`. 3rd-party packages should be added as a
`package.json` dependency.
@@ -52,10 +52,11 @@ in the proper package's repository.
* Use the present tense
* Reference issues and pull requests liberally
* Consider starting the commit message with an applicable emoji:
* :lipstick: when improving the format/structure of the code
* :racehorse: when improving performance
* :non-potable_water: when plugging memory leaks
* :memo: when writing docs
* :lipstick: `:lipstick:` 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
* :penguin: `:penguin:` when fixing something on Linux
## CoffeeScript Styleguide
-1
Ver Arquivo
@@ -1 +0,0 @@
Copyright 2014 GitHub, Inc.
+20
Ver Arquivo
@@ -0,0 +1,20 @@
Copyright (c) 2014 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+56 -5
Ver Arquivo
@@ -1,8 +1,14 @@
# Atom — The hackable editor
![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png)
![Atom](http://i.imgur.com/OrTvUAD.png)
Atom is a hackable text editor for the 21st century.
Check out our [guides and API documentation](https://atom.io/docs/latest).
Atom is open source and built on top of [atom-shell](http://github.com/atom/atom-shell).
Atom is designed to be customizable, but also usable without needing to edit a config file.
Atom is modern, approachable, and hackable to the core.
Visit [atom.io](http://atom.io) to learn more.
## Installing
@@ -12,6 +18,51 @@ Atom will automatically update when a new release is available.
## Building
Follow the instructions in the [build docs][building].
[building]: https://github.com/atom/atom/blob/master/docs/building-atom.md
### OS X Requirements
* OS X 10.8 or later
* [node.js](http://nodejs.org/download/) v0.10.x
* Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install)
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /Applications/Atom.app
```
### Linux Requirements
* Ubuntu LTS 12.04 64-bit is the recommended platform
* OS with 64-bit architecture
* [node.js](http://nodejs.org/download/) v0.10.x
* [npm](http://www.npmjs.org/) v1.4.x
* `sudo apt-get install libgnome-keyring-dev`
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses Python 2
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at /tmp/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
script/grunt mkdeb # Generates a .deb package at /tmp/atom-build
```
### Windows Requirements
* Windows 7 or later
* [Visual C++ 2010 SP1 Express](http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express)
* [node.js - 32bit](http://nodejs.org/download/) v0.10.x
* [Python 2.7.x](http://www.python.org/download/)
* [GitHub for Windows](http://windows.github.com/)
* [Git for Windows](http://git-scm.com/download/win)
* Select the option **Use Git from the Windows Command Prompt** when installing (Git needs to be in your `PATH`)
* Clone [atom/atom](https://github.com/atom/atom/) to `C:\Users\<user>\github\atom\`
* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\<user>\github\atom\node_modules\`
to your PATH
* Open the Windows GitHub shell
```bat
cd C:\Users\<user>\github\atom
script\build
```
## Developing
Check out the [guides](https://atom.io/docs/latest) and the [API reference](https://atom.io/docs/api).
+2
Ver Arquivo
@@ -0,0 +1,2 @@
This folder is where [apm](https://github.com/atom/apm) is installed to so that
it is bundled with Atom.
+11
Ver Arquivo
@@ -0,0 +1,11 @@
{
"name": "atom-bundled-apm",
"description": "Atom's bundled APM",
"repository": {
"type": "git",
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.51.0"
}
}
+65 -15
Ver Arquivo
@@ -1,11 +1,13 @@
#!/bin/sh
ATOM_PATH=${ATOM_PATH-/Applications/Atom.app}
ATOM_BINARY=$ATOM_PATH/Contents/MacOS/Atom
#!/bin/bash
if [ ! -d $ATOM_PATH ]; then sleep 5; fi # Wait for Atom to reappear, Sparkle may be replacing it.
if [ ! -d $ATOM_PATH ]; then
echo "Atom application not found at '$ATOM_PATH'" >&2
if [ "`uname`" == 'Darwin' ]; then
OS='Mac'
elif [ "`expr substr $(uname -s) 1 5`" == 'Linux' ]; then
OS='Linux'
elif [ "`expr substr $(uname -s) 1 10`" == 'MINGW32_NT' ]; then
OS='Cygwin'
else
echo "Your platform (`uname -a`) is not supported."
exit 1
fi
@@ -16,7 +18,11 @@ while getopts ":wtfvhs-:" opt; do
wait)
WAIT=1
;;
help|version|foreground|test)
help|version)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
foreground|test)
EXPECT_OUTPUT=1
;;
esac
@@ -24,25 +30,69 @@ while getopts ":wtfvhs-:" opt; do
w)
WAIT=1
;;
h|v|f|t)
h|v)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
f|t)
EXPECT_OUTPUT=1
;;
esac
done
if [ $EXPECT_OUTPUT ]; then
$ATOM_BINARY --executed-from="$(pwd)" --pid=$$ $@
exit $?
else
open -a $ATOM_PATH -n --args --executed-from="$(pwd)" --pid=$$ $@
if [ $REDIRECT_STDERR ]; then
exec 2> /dev/null
fi
# Used to exit process when atom is used as $EDITOR
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'" | head -1 | xargs dirname)
fi
# 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
fi
if [ $EXPECT_OUTPUT ]; then
"$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@"
exit $?
else
open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ "$@"
fi
elif [ $OS == 'Linux' ]; then
SCRIPT=`readlink -f "$0"`
USR_DIRECTORY=`readlink -f $(dirname $SCRIPT)/..`
ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
[ -x "$ATOM_PATH" ] || ATOM_PATH='/tmp/atom-build/Atom/atom'
if [ $EXPECT_OUTPUT ]; then
"$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
exit $?
else
(
nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > /tmp/atom-nohup.out 2>&1
if [ $? -ne 0 ]; then
cat /tmp/atom-nohup.out
exit $?
fi
) &
fi
fi
# Exits this process when Atom is used as $EDITOR
on_die() {
exit 0
}
trap 'on_die' SIGQUIT SIGTERM
# If the wait flag is set, don't exit this process until Atom tells it to.
if [ $WAIT ]; then
while true; do
sleep 1
+21 -10
Ver Arquivo
@@ -39,27 +39,35 @@ module.exports = (grunt) ->
if process.platform is 'win32'
appName = 'Atom'
tmpDir = os.tmpdir()
installRoot = process.env.ProgramFiles
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
symbolsDir = path.join(buildDir, 'Atom.breakpad.syms')
shellAppDir = path.join(buildDir, appName)
contentsDir = shellAppDir
appDir = path.join(shellAppDir, 'resources', 'app')
atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells')
else
installDir = path.join(process.env.ProgramFiles, appName)
else if process.platform is 'darwin'
appName = 'Atom.app'
tmpDir = '/tmp'
installRoot = '/Applications'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
symbolsDir = path.join(buildDir, 'Atom.breakpad.syms')
shellAppDir = path.join(buildDir, appName)
contentsDir = path.join(shellAppDir, 'Contents')
appDir = path.join(contentsDir, 'Resources', 'app')
atomShellDownloadDir = '/tmp/atom-cached-atom-shells'
installDir = path.join(installRoot, appName)
installDir = path.join('/Applications', appName)
else
appName = 'Atom'
tmpDir = '/tmp'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
symbolsDir = path.join(buildDir, 'Atom.breakpad.syms')
shellAppDir = path.join(buildDir, appName)
contentsDir = shellAppDir
appDir = path.join(shellAppDir, 'resources', 'app')
atomShellDownloadDir = '/tmp/atom-cached-atom-shells'
installDir = process.env.INSTALL_PREFIX ? '/usr/local'
coffeeConfig =
options:
sourceMap: true
glob_to_multiple:
expand: true
src: [
@@ -123,7 +131,7 @@ module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
atom: {appDir, appName, buildDir, contentsDir, installDir, shellAppDir}
atom: {appDir, appName, symbolsDir, buildDir, contentsDir, installDir, shellAppDir}
coffee: coffeeConfig
@@ -223,6 +231,9 @@ module.exports = (grunt) ->
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson', 'peg'])
grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint'])
grunt.registerTask('test', ['shell:kill-atom', 'run-specs'])
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-version', 'check-licenses', 'lint', 'test', 'codesign', 'publish-build'])
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'dump-symbols', 'set-version', 'check-licenses', 'lint', 'test', 'codesign', 'publish-build'])
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
grunt.registerTask('default', ['download-atom-shell', 'build', 'set-version', 'install'])
defaultTasks = ['download-atom-shell', 'build', 'set-version']
defaultTasks.push 'install' unless process.platform is 'linux'
grunt.registerTask('default', defaultTasks)
+6 -4
Ver Arquivo
@@ -17,21 +17,23 @@
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.9.0",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.6.0",
"grunt-download-atom-shell": "git+https://atom-bot:467bac80a0017b96fb5be5cfc686f5e0cc607b10@github.com/atom/grunt-download-atom-shell#v0.6.0",
"grunt-cson": "0.8.0",
"grunt-download-atom-shell": "~0.7.0",
"grunt-lesslint": "0.13.0",
"grunt-markdown": "~0.4.0",
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"json-front-matter": "~0.1.3",
"legal-eagle": "~0.3.0",
"legal-eagle": "~0.4.0",
"minidump": "0.5.x",
"rcedit": "~0.1.2",
"request": "~2.27.0",
"rimraf": "~2.2.2",
"runas": "0.5.x",
"underscore-plus": "1.x",
"unzip": "~0.1.9",
"vm-compatibility-layer": "~0.1.0"
"vm-compatibility-layer": "~0.1.0",
"npm": "~1.4.5"
}
}
+7 -2
Ver Arquivo
@@ -14,7 +14,7 @@ module.exports = (grunt) ->
if process.platform is 'darwin'
cp 'atom-shell/Atom.app', shellAppDir
else if process.platform is 'win32'
else
cp 'atom-shell', shellAppDir
mkdir appDir
@@ -47,7 +47,9 @@ module.exports = (grunt) ->
path.join('less', 'test')
path.join('bootstrap', 'docs')
path.join('bootstrap', 'examples')
path.join('spellchecker', 'vendor')
path.join('pegjs', 'examples')
# Add .* to avoid matching hunspell_dictionaries.
path.join('spellchecker', 'vendor', 'hunspell', '.*')
path.join('xmldom', 'test')
path.join('jasmine-reporters', 'ext')
path.join('build', 'Release', 'obj.target')
@@ -56,6 +58,9 @@ module.exports = (grunt) ->
path.join('resources', 'mac')
path.join('resources', 'win')
]
# Hunspell dictionaries are only not needed on OS X.
if process.platform is 'darwin'
ignoredPaths.push path.join('spellchecker', 'vendor', 'hunspell_dictionaries')
ignoredPaths = ignoredPaths.map (ignoredPath) -> "(#{ignoredPath})"
nodeModulesFilter = new RegExp(ignoredPaths.join('|'))
packageFilter = new RegExp("(#{ignoredPaths.join('|')})|(.+\\.(cson|coffee)$)")
+3
Ver Arquivo
@@ -15,6 +15,9 @@ module.exports = (grunt) ->
console.error(err)
exit 1
for key of summary
delete summary[key] if key.match /^atom@/
if size(summary)
console.error "Found dependencies without permissive licenses:"
for name in keys(summary).sort()
+2
Ver Arquivo
@@ -143,6 +143,8 @@ downloadFileFromRepo = ({repo, file}, callback) ->
downloadIncludes = (callback) ->
includes = [
{repo: 'atom-keymap', file: 'src/keymap.coffee'}
{repo: 'atom-keymap', file: 'src/key-binding.coffee'}
{repo: 'first-mate', file: 'src/grammar.coffee'}
{repo: 'first-mate', file: 'src/grammar-registry.coffee'}
{repo: 'node-pathwatcher', file: 'src/directory.coffee'}
+39
Ver Arquivo
@@ -0,0 +1,39 @@
async = require 'async'
fs = require 'fs-plus'
path = require 'path'
minidump = require 'minidump'
module.exports = (grunt) ->
{mkdir, rm} = require('./task-helpers')(grunt)
dumpSymbolTo = (binaryPath, targetDirectory, callback) ->
minidump.dumpSymbol binaryPath, (error, content) ->
return callback(error) if error?
moduleLine = /MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n/.exec(content)
if moduleLine.length isnt 3
return callback("Invalid output when dumping symbol for #{binaryPath}")
filename = moduleLine[2]
targetPathDirname = path.join(targetDirectory, filename, moduleLine[1])
mkdir targetPathDirname
targetPath = path.join(targetPathDirname, "#{filename}.sym")
fs.writeFile(targetPath, content, callback)
grunt.registerTask 'dump-symbols', 'Dump symbols for native modules', ->
done = @async()
symbolsDir = grunt.config.get('atom.symbolsDir')
rm symbolsDir
mkdir symbolsDir
tasks = []
onFile = (binaryPath) ->
if /.*\.node$/.test(binaryPath)
tasks.push(dumpSymbolTo.bind(this, binaryPath, symbolsDir))
onDirectory = ->
true
fs.traverseTreeSync 'node_modules', onFile, onDirectory
async.parallel tasks, done
+2 -2
Ver Arquivo
@@ -17,7 +17,7 @@ module.exports = (grunt) ->
licenseText = getLicenseText(dependencyLicenses)
if mode is 'save'
targetPath = path.join(grunt.config.get('atom.appDir'), 'LICENSE')
targetPath = path.join(grunt.config.get('atom.appDir'), 'LICENSE.md')
fs.writeFileSync(targetPath, licenseText)
else
console.log licenseText
@@ -26,7 +26,7 @@ module.exports = (grunt) ->
getLicenseText = (dependencyLicenses) ->
{keys} = require 'underscore-plus'
text = """
Copyright 2014 GitHub, Inc.
#{fs.readFileSync('LICENSE.md', 'utf8')}
This application bundles the following third-party packages in accordance
with the following licenses:\n\n
+19 -1
Ver Arquivo
@@ -1,4 +1,6 @@
fs = require 'fs'
path = require 'path'
fs = require 'fs-plus'
runas = null
module.exports = (grunt) ->
@@ -15,7 +17,23 @@ module.exports = (grunt) ->
createShortcut = path.resolve 'script', 'create-shortcut.cmd'
runas('cmd', ['/c', createShortcut, path.join(installDir, 'atom.exe'), 'Atom'])
else
else if process.platform is 'darwin'
rm installDir
mkdir path.dirname(installDir)
cp shellAppDir, installDir
else
binDir = path.join(installDir, 'bin')
shareDir = path.join(installDir, 'share', 'atom')
mkdir binDir
cp 'atom.sh', path.join(binDir, 'atom')
rm shareDir
mkdir path.dirname(shareDir)
cp shellAppDir, shareDir
# Create relative symbol link for apm.
process.chdir(binDir)
rm('apm')
fs.symlinkSync(path.join('..', 'share', 'atom', 'resources', 'app', 'apm', 'node_modules', '.bin', 'apm'), 'apm')
fs.chmodSync(path.join(shareDir, 'atom'), "755")
+31
Ver Arquivo
@@ -0,0 +1,31 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
fillTemplate = (filePath, data) ->
template = _.template(String(fs.readFileSync(filePath + '.in')))
filled = template(data)
fs.writeFileSync(filePath, filled)
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'mkdeb', 'Create debian package', ->
done = @async()
{name, version, description} = grunt.file.readJSON('package.json')
section = 'devel'
arch = 'amd64'
maintainer = 'GitHub <atom@github.com>'
data = {name, version, description, section, arch, maintainer}
control = path.join('resources', 'linux', 'debian', 'control')
fillTemplate(control, data)
desktop = path.join('resources', 'linux', 'Atom.desktop')
fillTemplate(desktop, data)
icon = path.join('resources', 'atom.png')
buildDir = grunt.config.get('atom.buildDir')
cmd = path.join('script', 'mkdeb')
args = [version, control, desktop, icon, buildDir]
spawn({cmd, args}, done)
+50 -97
Ver Arquivo
@@ -2,14 +2,17 @@ child_process = require 'child_process'
path = require 'path'
_ = require 'underscore-plus'
async = require 'async'
fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
grunt = null
maxReleases = 10
assetName = 'atom-mac.zip'
assetPath = "/tmp/atom-build/#{assetName}"
assets = [
{assetName: 'atom-mac.zip', sourceName: 'Atom.app'}
{assetName: 'atom-mac-symbols.zip', sourceName: 'Atom.breakpad.syms'}
]
commitSha = process.env.JANKY_SHA1
token = process.env.ATOM_ACCESS_TOKEN
defaultHeaders =
@@ -18,58 +21,41 @@ defaultHeaders =
module.exports = (gruntObject) ->
grunt = gruntObject
grunt.registerTask 'publish-build', 'Publish the built app', ->
return unless process.platform is 'darwin'
return if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH isnt 'master'
done = @async()
buildDir = grunt.config.get('atom.buildDir')
createBuildRelease (error, release) ->
zipApps buildDir, assets, (error) ->
return done(error) if error?
zipApp (error) ->
getAtomDraftRelease (error, release) ->
return done(error) if error?
uploadAsset release, (error) ->
assetNames = (asset.assetName for asset in assets)
deleteExistingAssets release, assetNames, (error) ->
return done(error) if error?
publishRelease release, (error) ->
return done(error) if error?
getAtomDraftRelease (error, release) ->
return done(error) if error?
deleteExistingAsset release, (error) ->
return done(error) if error?
uploadAsset(release, done)
uploadAssets(release, buildDir, assets, done)
logError = (message, error, details) ->
grunt.log.error(message)
grunt.log.error(error.message ? error) if error?
grunt.log.error(details) if details
zipApp = (callback) ->
fs.removeSync(assetPath)
zipApps = (buildDir, assets, callback) ->
zip = (directory, sourceName, assetName, callback) ->
options = {cwd: directory, maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{assetName} #{sourceName}", options, (error, stdout, stderr) ->
if error?
logError("Zipping #{sourceName} failed", error, stderr)
callback(error)
options = {cwd: path.dirname(assetPath), maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{assetName} Atom.app", options, (error, stdout, stderr) ->
if error?
logError('Zipping Atom.app failed', error, stderr)
callback(error)
getRelease = (callback) ->
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'GET'
headers: defaultHeaders
json: true
request options, (error, response, releases=[]) ->
if error? or response.statusCode isnt 200
logError('Fetching releases failed', error, releases)
callback(error ? new Error(response.statusCode))
else
if releases.length > maxReleases
deleteRelease(release) for release in releases[maxReleases..]
for release in releases when release.name is commitSha
callback(null, release)
return
callback()
tasks = []
for {assetName, sourceName} in assets
fs.removeSync(path.join(buildDir, assetName))
tasks.push(zip.bind(this, buildDir, sourceName, assetName))
async.parallel(tasks, callback)
getAtomDraftRelease = (callback) ->
atomRepo = new GitHub({repo: 'atom/atom', token})
@@ -93,10 +79,12 @@ deleteRelease = (release) ->
if error? or response.statusCode isnt 204
logError('Deleting release failed', error, body)
deleteExistingAsset = (release, callback) ->
for asset in release.assets when asset.name is assetName
deleteExistingAssets = (release, assetNames, callback) ->
[callback, assetNames] = [assetNames, callback] if not callback?
deleteAsset = (url, callback) ->
options =
uri: asset.url
uri: url
method: 'DELETE'
headers: defaultHeaders
request options, (error, response, body='') ->
@@ -106,67 +94,32 @@ deleteExistingAsset = (release, callback) ->
else
callback()
return
callback()
createBuildRelease = (callback) ->
getRelease (error, release) ->
if error?
callback(error)
return
if release?
deleteExistingAsset release, (error) ->
callback(error, release)
return
tasks = []
for asset in release.assets when not assetNames? or asset.name in assetNames
tasks.push(deleteAsset.bind(this, asset.url))
async.parallel(tasks, callback)
uploadAssets = (release, buildDir, assets, callback) ->
upload = (release, assetName, assetPath, callback) ->
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
uri: release.upload_url.replace(/\{.*$/, "?name=#{assetName}")
method: 'POST'
headers: defaultHeaders
json:
tag_name: "v#{commitSha}"
target_commitish: 'master'
name: commitSha
body: "Build of [atom@#{commitSha.substring(0, 7)}](https://github.com/atom/atom/commits/#{commitSha})"
draft: true
prerelease: true
request options, (error, response, release={}) ->
if error? or response.statusCode isnt 201
logError('Creating release failed', error, release)
headers: _.extend({
'Content-Type': 'application/zip'
'Content-Length': fs.getSizeSync(assetPath)
}, defaultHeaders)
assetRequest = request options, (error, response, body='') ->
if error? or response.statusCode >= 400
logError("Upload release asset #{assetName} failed", error, body)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
uploadAsset = (release, callback) ->
options =
uri: release.upload_url.replace(/\{.*$/, "?name=#{assetName}")
method: 'POST'
headers: _.extend({
'Content-Type': 'application/zip'
'Content-Length': fs.getSizeSync(assetPath)
}, defaultHeaders)
fs.createReadStream(assetPath).pipe(assetRequest)
assetRequest = request options, (error, response, body='') ->
if error? or response.statusCode >= 400
logError('Upload release asset failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
fs.createReadStream(assetPath).pipe(assetRequest)
publishRelease = (release, callback) ->
options =
uri: release.url
method: 'POST'
headers: defaultHeaders
json:
draft: false
request options, (error, response, body={}) ->
if error? or response.statusCode isnt 200
logError('Creating release failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback()
tasks = []
for {assetName, sourceName} in assets
assetPath = path.join(buildDir, assetName)
tasks.push(upload.bind(this, release, assetName, assetPath))
async.parallel(tasks, callback)
-108
Ver Arquivo
@@ -1,108 +0,0 @@
async = require 'async'
request = require 'request'
# Configure and publish all packages in package.json to atom.io
#
# This task should be run whenever you want to be sure that atom.io contains
# all the packages and versions referenced in Atom's package.json file.
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
baseUrl = "https://atom.io/api/packages"
packageExists = (packageName, token, callback) ->
requestSettings =
url: "#{baseUrl}/#{packageName}"
json: true
headers:
authorization: token
request.get requestSettings, (error, response, body={}) ->
if error?
callback(error)
else
callback(null, response.statusCode is 404)
createPackage = (packageName, token, callback) ->
requestSettings =
url: baseUrl
json: true
headers:
authorization: token
method: 'POST'
body:
repository: "atom/#{packageName}"
request.get requestSettings, (error, response, body={}) ->
if error?
callback(error)
else if response.statusCode isnt 201
message = body.message ? body.error ? body
callback(new Error("Creating package failed: #{message}"))
else
callback()
createPackageVersion = (packageName, tag, token, callback) ->
requestSettings =
url: "#{baseUrl}/#{packageName}/versions"
json: true
method: 'POST'
headers:
authorization: token
body:
tag: tag
request.get requestSettings, (error, response, body={}) ->
if error?
callback(error)
else if response.statusCode isnt 201
message = body.message ? body.error ? body
if message is 'Version exists'
callback()
else
callback(new Error("Creating new version failed: #{message}"))
else
callback()
getToken = (callback) ->
if token = process.env.ATOM_ACCESS_TOKEN
callback(null, token)
else
spawn {cmd: 'security', args: ['-q', 'find-generic-password', '-ws', 'GitHub API Token']}, (error, result, code) ->
token = result.toString() unless error?
callback(error, token)
grunt.registerTask 'publish-packages', 'Publish all bundled packages', ->
done = @async()
getToken (error, token) ->
unless token
grunt.log.error('Token not found in keychain or ATOM_ACCESS_TOKEN environment variable')
done(false)
{packageDependencies} = grunt.file.readJSON('package.json') ? {}
tasks = []
for name, version of packageDependencies
do (name, version) ->
tasks.push (callback) ->
grunt.verbose.writeln("Publishing #{name}@#{version}")
tag = "v#{version}"
packageExists name, token, (error, exists) ->
if error?
callback(error)
return
if exists
createPackage name, token, (error) ->
if error?
callback(error)
else
createPackageVersion(name, tag, token, callback)
else
createPackageVersion(name, tag, token, callback)
async.waterfall tasks, (error) ->
if error?
grunt.log.error(error.message)
done(false)
else
done()
+5 -1
Ver Arquivo
@@ -5,7 +5,9 @@ module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
getVersion = (callback) ->
if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master'
onBuildMachine = process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master'
inRepository = fs.existsSync(path.resolve(__dirname, '..', '..', '.git'))
if onBuildMachine or not inRepository
{version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
callback(null, version)
else
@@ -48,3 +50,5 @@ module.exports = (grunt) ->
rcedit = require('rcedit')
rcedit(shellExePath, {'version-string': strings}, done)
else
done()
+3 -1
Ver Arquivo
@@ -1,6 +1,6 @@
# Welcome to the Atom API Documentation
![Atom](http://i.imgur.com/OrTvUAD.png)
![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png)
## FAQ
@@ -31,6 +31,7 @@ The classes available from `require 'atom'` are:
* [SelectListView][SelectListView]
* [View][View]
* [WorkspaceView][WorkspaceView]
* [Workspace][Workspace]
### How do I create a package?
@@ -54,5 +55,6 @@ Atom ships with node 0.11.10 and the comprehensive node API docs are available
[SelectListView]: ../classes/SelectListView.html
[View]: ../classes/View.html
[WorkspaceView]: ../classes/WorkspaceView.html
[Workspace]: ../classes/Workspace.html
[creating-a-package]: https://atom.io/docs/latest/creating-a-package
[node-docs]: http://nodejs.org/docs/v0.11.10/api
+16
Ver Arquivo
@@ -83,6 +83,22 @@ file. For now, we've opted to handle cases where selector ordering is critical
by breaking the keymap into two separate files, such as `snippets-1.cson` and
`snippets-2.cson`.
## Removing Bindings
When the keymap system encounters a binding with the `unset!` directive as its
command, it will treat the current element as if it had no key bindings matching
the current keystroke sequence and continue searching from its parent. If you
want to remove a binding from a keymap you don't control, such as keymaps in
Atom core or in packages, use the `unset!` directive.
## Forcing Chromium's Native Keystroke Handling
If you want to force the native browser behavior for a given keystroke, use the
`native!` directive as the command of a binding. This can be useful to enable
the correct behavior in native input elements, for example. If you apply the
`.native-key-bindings` class to an element, all the keystrokes typically handled
by the browser will be assigned the `native!` directive.
## Overloading Key Bindings
Occasionally, it makes sense to layer multiple actions on top of the same key
+9 -7
Ver Arquivo
@@ -19,7 +19,7 @@ module.exports =
activate: (state) ->
@myObject =
if state
deserialize(state)
atom.deserializers.deserialize(state)
else
new MyObject("Hello")
@@ -31,7 +31,8 @@ module.exports =
```coffee-script
class MyObject
registerDeserializer(this)
atom.deserializers.add(this)
@deserialize: ({data}) -> new MyObject(data)
constructor: (@data) ->
serialize: -> { deserializer: 'MyObject', data: @data }
@@ -50,8 +51,8 @@ class-level method on the same class that implements `serialize`. This method's
job is to convert a state object returned from a previous call `serialize` back
into a genuine object.
#### registerDeserializer(klass)
You need to call the global `registerDeserializer` method with your class in
#### atom.deserializers.add(klass)
You need to call the `atom.deserializers.add` method with your class in
order to make it available to the deserialization system. Now you can call the
global `deserialize` method with state returned from `serialize`, and your
class's `deserialize` method will be selected automatically.
@@ -60,14 +61,15 @@ class's `deserialize` method will be selected automatically.
```coffee-script
class MyObject
atom.deserializers.add(this)
@version: 2
@deserialize: (state) -> ...
serialize: -> { version: MyObject.version, ... }
serialize: -> { version: @constructor.version, ... }
```
Your serializable class can optionally have a class-level `@version` property
and include a `version` key in its serialized state. When deserializing, Atom
will only attempt to call deserialize if the two versions match, and otherwise
return undefined. We plan on implementing a migration system in the future, but
this at least protects you from improperly deserializing old state. If you find
yourself in dire need of the migration system, let us know.
this at least protects you from improperly deserializing old state.
-34
Ver Arquivo
@@ -1,34 +0,0 @@
## Building Atom
These guide is meant only for users who wish to help develop atom core,
if you're just interested in using atom you should just [download
atom][download].
## OSX
* Use OS X 10.8 or later
* Install the latest node 0.10.x release (32bit preferable)
* Clone [atom][atom-git] to `~/github/atom`
* Run `~/github/atom/script/build`
## Windows
* Install [Visual C++ 2010 Express][win-vs2010]
* Install the [latest 32bit Node 0.10.x][win-node]
* Install the [latest Python 2.7.x][win-python]
* Install [GitHub for Windows][win-github]
* Clone [atom/atom][atom-git] to `C:\Users\<user>\github\atom\`
* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\<user>\github\atom\node_modules\`
to your PATH
* Set ATOM_ACCESS_TOKEN to your oauth2 credentials (run `security -q
find-generic-password -ws 'GitHub API Token'` on OSX to get your
credentials).
* Use the Windows GitHub shell and cd into `C:\Users\<user>\github\atom`
* Run `script\bootstrap`
[download]: https://github.com/atom/atom/releases/latest
[win-node]: http://nodejs.org/download/
[win-python]: http://www.python.org/download/
[win-github]: http://windows.github.com/
[win-vs2010]: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
[atom-git]: https://github.com/atom/atom/
+2 -2
Ver Arquivo
@@ -20,7 +20,7 @@ apm help init
You should see a message print out with details about the `apm init` command.
If you do not, launch Atom and run the _Atom > Install Shell Commmands_ menu
If you do not, launch Atom and run the _Atom > Install Shell Commands_ menu
to install the `apm` and `atom` commands.
### Convert the Package
@@ -40,7 +40,7 @@ the editor to see it in action!
### Further Reading
* Check out [Publishing a Package](publish-a-package.html) for more information
* Check out [Publishing a Package](publishing-a-package.html) for more information
on publishing the package you just created to [atom.io][atomio].
[atomio]: https://atom.io
+2 -2
Ver Arquivo
@@ -25,7 +25,7 @@ apm help init
You should see a message print out with details about the `apm init` command.
If you do not, launch Atom and run the _Atom > Install Shell Commmands_ menu
If you do not, launch Atom and run the _Atom > Install Shell Commands_ menu
to install the `apm` and `atom` commands.
You can now run `apm help init` to see all the options for initializing new
@@ -57,7 +57,7 @@ __Syntax Theme__ dropdown menu to enable your new theme.
### Further Reading
* Check out [Publishing a Package](publish-a-package.html) for more information
* Check out [Publishing a Package](publishing-a-package.html) for more information
on publishing the theme you just created to [atom.io][atomio].
[atomio]: https://atom.io
+14 -30
Ver Arquivo
@@ -24,6 +24,9 @@ Not every package will have (or need) all of these directories.
We have [a tutorial on creating your first package][first-package].
There are also guides for converting [TextMate bundles][convert-bundle] and
[TextMate themes][convert-theme] so they work in Atom.
## package.json
Similar to [npm packages][npm], Atom packages contain a _package.json_ file
@@ -127,7 +130,7 @@ Ideally, you won't need much in the way of styling. We've provided a standard
set of components which define both the colors and UI elements for any package
that fits into Atom seamlessly. You can view all of Atom's UI components by opening
the styleguide: open the command palette (`cmd-shift-P`) and search for _styleguide_,
or just type `cmd-ctrl-G`.
or just type `cmd-ctrl-shift-G`.
If you _do_ need special styling, try to keep only structural styles in the package
stylesheets. If you _must_ specify colors and sizing, these should be taken from
@@ -322,27 +325,20 @@ Your package **should** have tests, and if they're placed in the _spec_
directory, they can be run by Atom.
Under the hood, [Jasmine] executes your tests, so you can assume that any DSL
available there is available to your package as well.
**FIXME: Explain the following**
* jasmine
* jasmine-focused
* `spec/fixtures` and global.project
* setTimeout
* whatever else is different in spec-helper
available there is also available to your package.
## Running Tests
TODO: Probably use the menu option now.
Once you've got your test suite written, you can run it by pressing
`cmd-alt-ctrl-p` or via the _Developer > Run Package Specs_ menu.
Once you've got your test suite written, the recommended way to run it is `apm
test`. `apm test` prints its output to the console and returns the proper status
code depending on whether tests passed or failed.
You can also use the `apm test` command to run them from the command line. It
prints the test output and results to the console and returns the proper status
code depending on whether the tests passed or failed.
## Publishing
Atom bundles a command line utility called [apm] which can be used to publish
Atom bundles a command line utility called apm which can be used to publish
Atom packages to the public registry.
Once your package is written and ready for distribution you can run the
@@ -360,25 +356,11 @@ registry.
Run `apm help publish` to see all the available options and `apm help` to see
all the other available commands.
## Included Libraries
FIXME: Describe `require 'atom'
In addition to core node.js modules, all packages can `require` the following
popular libraries into their packages:
* [SpacePen] (as `require 'space-pen'`)
* [jQuery] (as `require 'jquery'`)
* [Underscore] (as `require 'underscore'`)
Additional libraries can be found by browsing Atom's *node_modules* folder.
[file-tree]: https://github.com/atom/tree-view
[status-bar]: https://github.com/atom/status-bar
[cs-syntax]: https://github.com/atom/language-coffee-script
[npm]: http://en.wikipedia.org/wiki/Npm_(software)
[npm-keys]: https://npmjs.org/doc/json.html
[apm]: https://github.com/atom/apm
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[wrap-guide]: https://github.com/atom/wrap-guide/
[keymaps]: advanced/keymaps.md
@@ -388,8 +370,10 @@ Additional libraries can be found by browsing Atom's *node_modules* folder.
[path]: http://nodejs.org/docs/latest/api/path.html
[jquery]: http://jquery.com/
[underscore]: http://underscorejs.org/
[jasmine]: https://github.com/pivotal/jasmine
[jasmine]: http://jasmine.github.io
[cson]: https://github.com/atom/season
[less]: http://lesscss.org
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
[first-package]: your-first-package.html
[convert-bundle]: converting-a-text-mate-bundle.html
[convert-theme]: converting-a-text-mate-theme.html
+20 -13
Ver Arquivo
@@ -32,14 +32,15 @@ Let's create your first theme.
To get started, hit `cmd-shift-P`, and start typing "Generate Syntax Theme" to
generate a new theme package. Select "Generate Syntax Theme," and you'll be
asked for the path where your theme will be created. Let's call ours _motif_.
asked for the path where your theme will be created. Let's call ours
_motif-syntax_. __Tip:__ syntax themes should end with _-syntax_.
Atom will pop open a new window, showing the _motif_ theme, with a default set
of folders and files created for us. If you open the settings view (`cmd-,`)
and navigate to the _Themes_ section on the left, you'll see the _Motif_ theme
listed in the _Syntax Theme_ drop-down. Select it from the menu to activate it,
now when you open an editor you should see that your new _motif_ theme in
action.
Atom will pop open a new window, showing the _motif-syntax_ theme, with a
default set of folders and files created for us. If you open the settings view
(`cmd-,`) and navigate to the _Themes_ section on the left, you'll see the
_Motif_ theme listed in the _Syntax Theme_ drop-down. Select it from the menu to
activate it, now when you open an editor you should see that your new
_motif-syntax_ theme in action.
Open up _stylesheets/colors.less_ to change the various colors variables which
have been already been defined. For example, turn `@red` into `#f4c2c1`.
@@ -50,9 +51,14 @@ editor such as comments, strings and the line numbers in the gutter.
As an example, let's make the `.gutter` `background-color` into `@red`.
Reload Atom by pressing `cmd-alt-option-L` to see the changes you made reflected
Reload Atom by pressing `cmd-alt-ctrl-l` to see the changes you made reflected
in your Atom window. Pretty neat!
__Tip:__ You can avoid reloading to see changes you make by opening an atom
window in dev mode. To open a Dev Mode Atom window run `atom --dev .` in the
terminal, use `cmd-shift-o` or use the _View > Developer > Open in Dev Mode_
menu. When you edit your theme, changes will instantly be reflected!
## Creating an Interface Theme
Interface themes **must** provide a `ui-variables.less` file which contains all
@@ -66,13 +72,14 @@ To create an interface UI theme, do the following:
2. Clone the forked repository to the local filesystem
3. Open a terminal in the forked theme's directory
4. Open your new theme in a Dev Mode Atom window run `atom --dev .` in the
terminal or use the _View > Developer > Open in Dev Mode_ menu)
terminal or use the _View > Developer > Open in Dev Mode_ menu
5. Change the name of the theme in the theme's `package.json` file
6. Run `apm link` to symlink your repository to `~/.atom/packages`
7. Reload Atom using `cmd-alt-ctrl-L`
8. Enable the theme via _UI Theme_ drop-down in the _Themes_ section of the
6. Name your theme end with a `-ui`. i.e. `super-white-ui`
7. Run `apm link` to symlink your repository to `~/.atom/packages`
8. Reload Atom using `cmd-alt-ctrl-L`
9. Enable the theme via _UI Theme_ drop-down in the _Themes_ section of the
settings view
9. Make changes! Since you opened the theme in a Dev Mode window, changes will
10. Make changes! Since you opened the theme in a Dev Mode window, changes will
be instantly reflected in the editor without having to reload.
## Development workflow
+18 -10
Ver Arquivo
@@ -1,7 +1,7 @@
# Customizing Atom
To change a setting, configure a theme, or install a package just open the
Settings view in the current window by pressing `cmd+,`.
Settings view in the current window by pressing `cmd-,`.
## Changing The Theme
@@ -34,7 +34,7 @@ apm help install
You should see a message print out with details about the `apm install` command.
If you do not, launch Atom and run the _Atom > Install Shell Commmands_ menu
If you do not, launch Atom and run the _Atom > Install Shell Commands_ menu
to install the `apm` and `atom` commands.
You can also install packages by using the `apm install` command:
@@ -63,9 +63,8 @@ built-in keymaps:
'.editor':
'enter': 'editor:newline'
'body':
'ctrl-b': 'core:move-left'
'ctrl-f': 'core:move-right'
'.mini.editor input':
'enter': 'core:confirm'
```
This keymap defines the meaning of `enter` in two different contexts. In a
@@ -87,7 +86,7 @@ currently in use.
## Advanced Configuration
Atom loads configuration settings from the `config.cson` file in your _~/.atom_
directory, which contains CoffeeScript-style JSON:
directory, which contains [CoffeeScript-style JSON][CSON] (CSON):
```coffee
'core':
@@ -111,7 +110,6 @@ You can open this file in an editor from the _Atom > Open Your Config_ menu.
- `themes`: An array of theme names to load, in cascading order
- `editor`
- `autoIndent`: Enable/disable basic auto-indent (defaults to `true`)
- `autoIndentOnPaste`: Enable/disable auto-indented pasted text (defaults to `false`)
- `nonWordCharacters`: A string of non-word characters to define word boundaries
- `fontSize`: The editor font size
- `fontFamily`: The editor font family
@@ -142,13 +140,21 @@ You can open this file in an editor from the _Atom > Open Your Config_ menu.
### init.coffee
When Atom finishes loading, it will evaluate _init.coffee_ in your _~/.atom_
directory, giving you a chance to run arbitrary personal CoffeeScript code to
directory, giving you a chance to run arbitrary personal [CoffeeScript][] code to
make customizations. You have full access to Atom's API from code in this file.
If customizations become extensive, consider [creating a package][create-a-package].
If customizations become extensive, consider [creating a package][creating-a-package].
You can open this file in an editor from the _Atom > Open Your Init Script_
menu.
For example, if you have the Audio Beep configuration setting enabled, you
could add the following code to your _~/.atom/init.coffee_ file to have Atom
greet you with an audio beep every time it loads:
```coffee
atom.beep()
```
This file can also be named _init.js_ and contain JavaScript code.
### styles.less
@@ -172,6 +178,8 @@ Unfamiliar with LESS? Read more about it [here][LESS].
This file can also be named _styles.css_ and contain CSS.
[create-a-package]: creating-packages.md
[creating-a-package]: creating-a-package.md
[create-theme]: creating-a-theme.md
[LESS]: http://www.lesscss.org
[CSON]: https://github.com/atom/season
[CoffeeScript]: http://coffeescript.org/
+3 -3
Ver Arquivo
@@ -73,8 +73,8 @@ from.
You can split any editor pane horizontally or vertically by using `cmd-k right`
or `cmd-k down`. Once you have a split pane, you can move focus between them
with `cmd-k cmd-right` or `cmd-k cmd-down`. To close a pane, close all its
editors with `meta-w`, then press `meta-w` one more time to close the pane. You
can configure panes to auto-close with empty in the preferences.
editors with `cmd-w`, then press `cmd-w` one more time to close the pane. You
can configure panes to auto-close when empty in the Settings view.
### Folding
@@ -95,7 +95,7 @@ in preferences.
## Configuration
Press `cmd-,` to open the Settings view. This is the place to change settings
Press `cmd-,` to open the Settings view. This is the place to change settings,
install packages, and change the theme.
For more advanced configuration see the [customization guide][customization].
+2
Ver Arquivo
@@ -5,6 +5,8 @@
* [Creating a Package](creating-a-package.md)
* [Creating a Theme](creating-a-theme.md)
* [Publishing a Package](publishing-a-package.md)
* [Converting a TextMate Bundle](converting-a-text-mate-bundle.md)
* [Converting a TextMate Theme](converting-a-text-mate-theme.md)
* [Contributing](contributing.md)
### Advanced Topics
+5 -5
Ver Arquivo
@@ -7,7 +7,7 @@ Publishing a package allows other people to install it and use it in Atom. It
is a great way to share what you've made and get feedback and contributions from
others.
This guide assumes your package's name is `my-package` and but you should pick a
This guide assumes your package's name is `my-package` but you should pick a
better name.
### Install apm
@@ -24,7 +24,7 @@ apm help publish
You should see a message print out with details about the `apm publish` command.
If you do not, launch Atom and run the _Atom > Install Shell Commmands_ menu
If you do not, launch Atom and run the _Atom > Install Shell Commands_ menu
to install the `apm` and `atom` commands.
### Prepare Your Package
@@ -42,7 +42,7 @@ If not, there are a few things you should check before publishing:
* Your package is in a Git repository that has been pushed to
[GitHub][github]. Follow [this guide][repo-guide] if your package isn't
already on GitHub.
### Publish Your Package
Before you publish a package it is a good idea to check ahead of time if
@@ -59,7 +59,7 @@ Now let's review what the `apm publish` command does:
3. Creates a new [Git tag][git-tag] for the version being published.
4. Pushes the tag and current branch up to GitHub.
5. Updates atom.io with the new version being published.
Now run the following commands to publish your package:
```sh
@@ -80,7 +80,7 @@ digit of the version before publishing so the published version will be `0.1.0`
and the Git tag created will be `v0.1.0`.
In the future you can run `apm publish major` to publish the `1.0.0` version but
since this was the first version being published it is a good idead to start
since this was the first version being published it is a good idea to start
with a minor release.
### Further Reading
-39
Ver Arquivo
@@ -1,39 +0,0 @@
# Setting up Travis CI
Packages under the [atom org][atom-org] should use [Travis CI][travis-ci] for
builds.
Currently we have a [Travis Pro][travis-pro] account since the repositories
are private. This process will be simpler and have fewer steps once the
package repos are made public.
Each package builds using the [build-package][build-package] script, any
changes to the build should be made in that script and will affect all
package builds immediately.
Each package builds against the latest successful build of atom@master. The
master builds are stored in the [atom-master-builds][atom-master-builds] repo
as releases named by the SHA-1 built.
## Configuring a package
* Run `cd ~/github/my-package` to navigate to the package repo locally
* Run `apm test` to verify that the package currently builds via [apm][apm]
* Add the package repo to the [Travis CI team][travis-ci-team]
* Run `gem install travis` to install the [travis gem][travis-gem]
* Run `travis login --pro` and log in using the [atom-build][atom-build] user
and the password from the *Shared-Developers* folder in LastPass
* Run `apm ci` to add a `.travis.yml` file to the repo and to configure Travis
* Log into [Travis][travis-ci] as the `atom-build` user and you should now see
the package listed and building
[apm]: https://github.com/atom/apm
[build-package]: https://github.com/atom/apm/blob/master/script/build-package
[atom-build]: https://github.com/atom-build
[atom-master-builds]: https://github.com/atom/atom-master-builds/releases
[atom-org]: https://github.com/atom
[travis-ci]: https://magnum.travis-ci.com
[travis-ci-team]: https://github.com/organizations/atom/teams/596636
[travis-gem]: https://rubygems.org/gems/travis
[travis-pro]: http://about.travis-ci.org/docs/user/travis-pro
+3 -2
Ver Arquivo
@@ -20,7 +20,8 @@ The final package can be viewed at
To begin, press `cmd-shift-P` to bring up the [Command
Palette](https://github.com/atom/command-palette). Type "generate package" and
select the "Package Generator: Generate Package" command. Now we need to name
the package. Let's call it _ascii-art_.
the package. Try to avoid naming your package with the *atom-* prefix, for
example we are going to call this package _ascii-art_.
Atom will open a new window with the contents of our new _ascii-art_ package
displayed in the Tree View. Because this window is opened **after** the package
@@ -151,5 +152,5 @@ ASCII art professional!
* [Creating a package guide](creating-a-package.html) for more information
on the mechanics of packages
* [Publishing a package guide](publish-a-package.html) for more information
* [Publishing a package guide](publishing-a-package.html) for more information
on publishing your package to [atom.io](https://atom.io)
+5
Ver Arquivo
@@ -0,0 +1,5 @@
storage
compile-cache
dev
.npm
.node-gyp
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@
# '.editor':
# 'enter': 'editor:newline'
#
# 'body':
# '.workspace':
# 'ctrl-P': 'core:move-up'
# 'ctrl-p': 'core:move-down'
#
+1
Ver Arquivo
@@ -21,3 +21,4 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
module.exports.Task = require '../src/task'
module.exports.View = View
module.exports.WorkspaceView = require '../src/workspace-view'
module.exports.Workspace = require '../src/workspace'
-5
Ver Arquivo
@@ -9,9 +9,6 @@
'shift-home': 'editor:select-to-first-character-of-line'
'shift-end': 'editor:select-to-end-of-line'
# Sublime Parity
'ctrl-t': 'editor:transpose'
'.editor:not(.mini)':
# Atom Specific
'ctrl-C': 'editor:copy-path'
@@ -21,8 +18,6 @@
'enter': 'editor:newline'
'shift-tab': 'editor:outdent-selected-rows'
'ctrl-K': 'editor:delete-line'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
'.tool-panel.panel-left, .tool-panel.panel-right':
'escape': 'tool-panel:unfocus'
+6 -2
Ver Arquivo
@@ -96,6 +96,7 @@
'.editor':
# Apple Specific
'cmd-backspace': 'editor:backspace-to-beginning-of-line'
'cmd-shift-backspace': 'editor:backspace-to-beginning-of-line'
'cmd-delete': 'editor:backspace-to-beginning-of-line'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-E': 'editor:select-to-end-of-line'
@@ -118,6 +119,7 @@
'cmd-k cmd-u': 'editor:upper-case'
'cmd-k cmd-l': 'editor:lower-case'
'cmd-l': 'editor:select-line'
'ctrl-t': 'editor:transpose'
'.workspace .editor:not(.mini)':
# Atom specific
@@ -133,9 +135,11 @@
'ctrl-cmd-up': 'editor:move-line-up'
'ctrl-cmd-down': 'editor:move-line-down'
'cmd-/': 'editor:toggle-line-comments'
'cmd-j': 'editor:join-line'
'cmd-D': 'editor:duplicate-line'
'cmd-j': 'editor:join-lines'
'cmd-D': 'editor:duplicate-lines'
'cmd-L': 'editor:split-selections-into-lines'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
'cmd-alt-[': 'editor:fold-current-row'
'cmd-alt-]': 'editor:unfold-current-row'
+112
Ver Arquivo
@@ -0,0 +1,112 @@
'body':
# Atom Specific
'enter': 'core:confirm'
'escape': 'core:cancel'
'up': 'core:move-up'
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'ctrl-alt-r': 'window:reload'
'ctrl-alt-i': 'window:toggle-dev-tools'
'ctrl-alt-p': 'window:run-package-specs'
'ctrl-alt-s': 'application:run-all-specs'
'ctrl-shift-o': 'application:open-dev'
'F11': 'window:toggle-full-screen'
# Sublime Parity
'ctrl-N': 'application:new-window'
'ctrl-W': 'window:close'
'ctrl-o': 'application:open-file'
'ctrl-q': 'application:quit'
'ctrl-T': 'pane:reopen-closed-item'
'ctrl-n': 'application:new-file'
'ctrl-s': 'core:save'
'ctrl-S': 'core:save-as'
'ctrl-w': 'core:close'
'ctrl-z': 'core:undo'
'ctrl-y': 'core:redo'
'ctrl-x': 'core:cut'
'ctrl-c': 'core:copy'
'ctrl-v': 'core:paste'
'shift-up': 'core:select-up'
'shift-down': 'core:select-down'
'shift-left': 'core:select-left'
'shift-right': 'core:select-right'
'delete': 'core:delete'
'pageup': 'core:page-up'
'pagedown': 'core:page-down'
'backspace': 'core:backspace'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab': 'pane:show-previous-item'
'ctrl-shift-up': 'core:move-up'
'ctrl-shift-down': 'core:move-down'
'ctrl-=': 'window:increase-font-size'
'ctrl-+': 'window:increase-font-size'
'ctrl--': 'window:decrease-font-size'
'ctrl-_': 'window:decrease-font-size'
'ctrl-0': 'window:reset-font-size'
'ctrl-k up': 'pane:split-up' # Atom Specific
'ctrl-k down': 'pane:split-down' # Atom Specific
'ctrl-k left': 'pane:split-left' # Atom Specific
'ctrl-k right': 'pane:split-right' # Atom Specific
'ctrl-k ctrl-w': 'pane:close' # Atom Specific
'ctrl-k alt-ctrl-w': 'pane:close-other-items' # Atom Specific
'ctrl-k ctrl-p': 'window:focus-previous-pane'
'ctrl-k ctrl-n': 'window:focus-next-pane'
'ctrl-k ctrl-up': 'window:focus-pane-above'
'ctrl-k ctrl-down': 'window:focus-pane-below'
'ctrl-k ctrl-left': 'window:focus-pane-on-left'
'ctrl-k ctrl-right': 'window:focus-pane-on-right'
'.workspace .editor':
# Windows specific
'ctrl-delete': 'editor:backspace-to-beginning-of-word'
# Sublime Parity
'ctrl-a': 'core:select-all'
'ctrl-alt-p': 'editor:log-cursor-scope'
'ctrl-k ctrl-u': 'editor:upper-case'
'ctrl-k ctrl-l': 'editor:lower-case'
'.workspace .editor:not(.mini)':
# Atom specific
'alt-ctrl-z': 'editor:checkout-head-revision'
'ctrl-<': 'editor:scroll-to-cursor'
'alt-ctrl-f': 'editor:fold-selection'
# Sublime Parity
'ctrl-enter': 'editor:newline-below'
'ctrl-shift-enter': 'editor:newline-above'
'ctrl-]': 'editor:indent-selected-rows'
'ctrl-[': 'editor:outdent-selected-rows'
'ctrl-up': 'editor:move-line-up'
'ctrl-down': 'editor:move-line-down'
'ctrl-/': 'editor:toggle-line-comments'
'ctrl-j': 'editor:join-lines'
'ctrl-D': 'editor:duplicate-lines'
'alt-shift-up': 'editor:add-selection-above'
'alt-shift-down': 'editor:add-selection-below'
'ctrl-alt-[': 'editor:fold-current-row'
'ctrl-alt-]': 'editor:unfold-current-row'
'ctrl-alt-{': 'editor:fold-all' # Atom Specific
'ctrl-alt-}': 'editor:unfold-all' # Atom Specific
'ctrl-k ctrl-0': 'editor:unfold-all'
'ctrl-k ctrl-1': 'editor:fold-at-indent-level-1'
'ctrl-k ctrl-2': 'editor:fold-at-indent-level-2'
'ctrl-k ctrl-3': 'editor:fold-at-indent-level-3'
'ctrl-k ctrl-4': 'editor:fold-at-indent-level-4'
'ctrl-k ctrl-5': 'editor:fold-at-indent-level-5'
'ctrl-k ctrl-6': 'editor:fold-at-indent-level-6'
'ctrl-k ctrl-7': 'editor:fold-at-indent-level-7'
'ctrl-k ctrl-8': 'editor:fold-at-indent-level-8'
'ctrl-k ctrl-9': 'editor:fold-at-indent-level-9'
# allow standard input fields to work correctly
'body .native-key-bindings':
'ctrl-z': 'native!'
'ctrl-Z': 'native!'
'ctrl-x': 'native!'
'ctrl-c': 'native!'
'ctrl-v': 'native!'
+3 -3
Ver Arquivo
@@ -14,7 +14,7 @@
# Sublime Parity
'ctrl-N': 'application:new-window'
'ctrl-W': 'window:close'
'ctrl-o': 'application:open'
'ctrl-o': 'application:open-file'
'ctrl-T': 'pane:reopen-closed-item'
'ctrl-n': 'application:new-file'
'ctrl-s': 'core:save'
@@ -80,8 +80,8 @@
'ctrl-up': 'editor:move-line-up'
'ctrl-down': 'editor:move-line-down'
'ctrl-/': 'editor:toggle-line-comments'
'ctrl-j': 'editor:join-line'
'ctrl-D': 'editor:duplicate-line'
'ctrl-j': 'editor:join-lines'
'ctrl-D': 'editor:duplicate-lines'
'ctrl-alt-[': 'editor:fold-current-row'
'ctrl-alt-]': 'editor:unfold-current-row'
+26 -6
Ver Arquivo
@@ -4,9 +4,10 @@
submenu: [
{ label: 'About Atom', command: 'application:about' }
{ label: 'View License', command: 'application:open-license' }
{ label: "VERSION", enabled: false }
{ label: "Restart and Install Update", command: 'application:install-update', visible: false}
{ label: "Check for Update", command: 'application:check-for-update', visible: false}
{ label: 'VERSION', enabled: false }
{ label: 'Restart and Install Update', command: 'application:install-update', visible: false}
{ label: 'Check for Update', command: 'application:check-for-update', visible: false}
{ label: 'Downloading Update', enabled: false, visible: false}
{ type: 'separator' }
{ label: 'Preferences...', command: 'application:show-settings' }
{ label: 'Open Your Config', command: 'application:open-your-config' }
@@ -37,7 +38,7 @@
{ label: 'Save All', command: 'window:save-all' }
{ type: 'separator' }
{ label: 'Close Buffer', command: 'core:close' }
{ label: 'Close All Buffers', command: 'pane:close' }
{ label: 'Close Pane', command: 'pane:close' }
{ label: 'Close Window', command: 'window:close' }
]
}
@@ -64,9 +65,9 @@
{ type: 'separator' }
{ label: 'Move Line Up', command: 'editor:move-line-up' }
{ label: 'Move Line Down', command: 'editor:move-line-down' }
{ label: 'Duplicate Line', command: 'editor:duplicate-line' }
{ label: 'Duplicate Lines', command: 'editor:duplicate-lines' }
{ label: 'Delete Line', command: 'editor:delete-line' }
{ label: 'Join Lines', command: 'editor:join-line' }
{ label: 'Join Lines', command: 'editor:join-lines' }
]
}
{
@@ -133,6 +134,25 @@
submenu: [
{ label: 'Reload', command: 'window:reload' }
{ label: 'Toggle Full Screen', command: 'window:toggle-full-screen' }
{
label: 'Panes'
submenu: [
{ label: 'Split Up', command: 'pane:split-up' }
{ label: 'Split Down', command: 'pane:split-down' }
{ label: 'Split Left', command: 'pane:split-left' }
{ label: 'Split Right', command: 'pane:split-right' }
{ type: 'separator' }
{ label: 'Focus Next Pane', command: 'window:focus-next-pane' }
{ label: 'Focus Previous Pane', command: 'window:focus-previous-pane' }
{ type: 'separator' }
{ label: 'Focus Pane Above', command: 'window:focus-pane-above' }
{ label: 'Focus Pane Below', command: 'window:focus-pane-below' }
{ label: 'Focus Pane On Left', command: 'window:focus-pane-on-left' }
{ label: 'Focus Pane On Right', command: 'window:focus-pane-on-right' }
{ type: 'separator' }
{ label: 'Close Pane', command: 'pane:close' }
]
}
{
label: 'Developer'
submenu: [
+155
Ver Arquivo
@@ -0,0 +1,155 @@
'menu': [
{
label: '&File'
submenu: [
{ label: 'New &Window', command: 'application:new-window' }
{ label: '&New File', command: 'application:new-file' }
{ label: '&Open File...', command: 'application:open-file' }
{ label: 'Open Folder...', command: 'application:open-folder' }
{ label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' }
{ type: 'separator' }
{ label: '&Preferences...', command: 'application:show-settings' }
{ type: 'separator' }
{ label: '&Save', command: 'core:save' }
{ label: 'Save &As...', command: 'core:save-as' }
{ label: 'Save A&ll', command: 'window:save-all' }
{ type: 'separator' }
{ label: '&Close Buffer', command: 'core:close' }
{ label: 'Close All &Buffers', command: 'pane:close' }
{ label: 'Clos&e Window', command: 'window:close' }
{ type: 'separator' }
{ label: 'Quit', command: 'application:quit' }
]
}
{
label: '&Edit'
submenu: [
{ label: '&Undo', command: 'core:undo' }
{ label: '&Redo', command: 'core:redo' }
{ type: 'separator' }
{ label: '&Cut', command: 'core:cut' }
{ label: 'C&opy', command: 'core:copy' }
{ label: 'Copy Pat&h', command: 'editor:copy-path' }
{ label: '&Paste', command: 'core:paste' }
{ label: 'Select &All', command: 'core:select-all' }
{ type: 'separator' }
{ label: '&Toggle Comments', command: 'editor:toggle-line-comments' }
{
label: 'Lines',
submenu: [
{ label: '&Indent', command: 'editor:indent-selected-rows' }
{ label: '&Outdent', command: 'editor:outdent-selected-rows' }
{ label: '&Auto Indent', command: 'editor:auto-indent' }
{ type: 'separator' }
{ label: 'Move Line &Up', command: 'editor:move-line-up' }
{ label: 'Move Line &Down', command: 'editor:move-line-down' }
{ label: 'Du&plicate Lines', command: 'editor:duplicate-lines' }
{ label: 'D&elete Line', command: 'editor:delete-line' }
{ label: '&Join Lines', command: 'editor:join-lines' }
]
}
{
label: 'Text',
submenu: [
{ label: '&Upper Case', command: 'editor:upper-case' }
{ label: '&Lower Case', command: 'editor:lower-case' }
{ type: 'separator' }
{ label: 'Delete to End of &Word', command: 'editor:delete-to-end-of-word' }
{ label: '&Delete Line', command: 'editor:delete-line' }
{ type: 'separator' }
{ label: '&Transpose', command: 'editor:transpose' }
]
}
{
label: 'Folding',
submenu: [
{ label: '&Fold', command: 'editor:fold-current-row' }
{ label: '&Unfold', command: 'editor:unfold-current-row' }
{ label: 'Unfold &All', command: 'editor:unfold-all' }
{ type: 'separator' }
{ label: 'Fol&d All', command: 'editor:fold-all' }
{ label: 'Fold Level 1', command: 'editor:fold-at-indent-level-1' }
{ label: 'Fold Level 2', command: 'editor:fold-at-indent-level-2' }
{ label: 'Fold Level 3', command: 'editor:fold-at-indent-level-3' }
{ label: 'Fold Level 4', command: 'editor:fold-at-indent-level-4' }
{ label: 'Fold Level 5', command: 'editor:fold-at-indent-level-5' }
{ label: 'Fold Level 6', command: 'editor:fold-at-indent-level-6' }
{ label: 'Fold Level 7', command: 'editor:fold-at-indent-level-7' }
{ label: 'Fold Level 8', command: 'editor:fold-at-indent-level-8' }
{ label: 'Fold Level 9', command: 'editor:fold-at-indent-level-9' }
]
}
]
}
{
label: '&View'
submenu: [
{ label: '&Reload', command: 'window:reload' }
{ label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' }
{
label: 'Developer'
submenu: [
{ label: 'Open In &Dev Mode...', command: 'application:open-dev' }
{ label: 'Run &Atom Specs', command: 'application:run-all-specs' }
{ label: 'Run Package &Specs', command: 'window:run-package-specs' }
{ label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' }
]
}
{ type: 'separator' }
{ label: 'Toggle Soft &Wrap', command: 'editor:toggle-soft-wrap' }
]
}
{
label: '&Selection'
submenu: [
{ label: 'Add Selection &Above', command: 'editor:add-selection-above' }
{ label: 'Add Selection &Below', command: 'editor:add-selection-below' }
{ label: 'S&plit into Lines', command: 'editor:split-selections-into-lines'}
{ type: 'separator' }
{ label: 'Select to &Top', command: 'core:select-to-top' }
{ label: 'Select to Botto&m', command: 'core:select-to-bottom' }
{ type: 'separator' }
{ label: 'Select &Line', command: 'editor:select-line' }
{ label: 'Select &Word', command: 'editor:select-word' }
{ label: 'Select to Beginning of W&ord', command: 'editor:select-to-beginning-of-word' }
{ label: 'Select to Beginning of L&ine', command: 'editor:select-to-beginning-of-line' }
{ label: 'Select to First &Character of Line', command: 'editor:select-to-first-character-of-line' }
{ label: 'Select to End of Wor&d', command: 'editor:select-to-end-of-word' }
{ label: 'Select to End of Lin&e', command: 'editor:select-to-end-of-line' }
]
}
{
label: 'F&ind'
submenu: []
}
{
label: '&Packages'
submenu: []
}
{
label: '&Window'
submenu: [
{ label: 'Mi&nimize', command: 'application:minimize' }
{ label: 'Ma&ximize', command: 'application:zoom' }
{ type: 'separator' }
{ label: 'Bring &All to Front', command: 'application:bring-all-windows-to-front' }
]
}
{
label: '&Help'
submenu: [
{ label: 'View &License', command: 'application:open-license' }
{ label: "VERSION", enabled: false }
{ type: 'separator' }
{ label: '&Documentation', command: 'application:open-documentation' }
{ type: 'separator' }
]
}
]
+23 -3
Ver Arquivo
@@ -4,7 +4,8 @@
submenu: [
{ label: 'New &Window', command: 'application:new-window' }
{ label: '&New File', command: 'application:new-file' }
{ label: '&Open...', command: 'application:open' }
{ label: '&Open File...', command: 'application:open-file' }
{ label: 'Open Folder...', command: 'application:open-folder' }
{ label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' }
{ type: 'separator' }
{ label: '&Preferences...', command: 'application:show-settings' }
@@ -43,9 +44,9 @@
{ type: 'separator' }
{ label: 'Move Line &Up', command: 'editor:move-line-up' }
{ label: 'Move Line &Down', command: 'editor:move-line-down' }
{ label: 'Du&plicate Line', command: 'editor:duplicate-line' }
{ label: 'Du&plicate Lines', command: 'editor:duplicate-lines' }
{ label: 'D&elete Line', command: 'editor:delete-line' }
{ label: '&Join Lines', command: 'editor:join-line' }
{ label: '&Join Lines', command: 'editor:join-lines' }
]
}
{
@@ -87,6 +88,25 @@
submenu: [
{ label: '&Reload', command: 'window:reload' }
{ label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' }
{
label: 'Panes'
submenu: [
{ label: 'Split Up', command: 'pane:split-up' }
{ label: 'Split Down', command: 'pane:split-down' }
{ label: 'Split Left', command: 'pane:split-left' }
{ label: 'Split Right', command: 'pane:split-right' }
{ type: 'separator' }
{ label: 'Focus Next Pane', command: 'window:focus-next-pane' }
{ label: 'Focus Previous Pane', command: 'window:focus-previous-pane' }
{ type: 'separator' }
{ label: 'Focus Pane Above', command: 'window:focus-pane-above' }
{ label: 'Focus Pane Below', command: 'window:focus-pane-below' }
{ label: 'Focus Pane On Left', command: 'window:focus-pane-on-left' }
{ label: 'Focus Pane On Right', command: 'window:focus-pane-on-right' }
{ type: 'separator' }
{ label: 'Close pane', command: 'pane:close' }
]
}
{
label: 'Developer'
submenu: [
+97 -91
Ver Arquivo
@@ -1,7 +1,8 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.55.0",
"version": "0.95.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
"type": "git",
@@ -12,123 +13,128 @@
},
"licenses": [
{
"type": "Apache",
"type": "MIT",
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.10.1",
"atomShellVersion": "0.12.3",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^0.19.0",
"bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
"delegato": "1.x",
"emissary": "1.x",
"first-mate": ">=1.1.5 <2.0",
"fs-plus": "2.x",
"delegato": "^1",
"emissary": "^1.2.1",
"first-mate": "^1.5.3",
"fs-plus": "^2.2.2",
"fstream": "0.1.24",
"fuzzaldrin": "1.x",
"git-utils": "1.x",
"fuzzaldrin": "^1.1",
"git-utils": "^1.3",
"grim": "0.10.0",
"guid": "0.0.10",
"jasmine-tagged": ">=1.1.1 <2.0",
"mkdirp": "0.3.5",
"keytar": "0.15.1",
"jasmine-tagged": "^1.1.1",
"less-cache": "0.12.0",
"mixto": "1.x",
"mixto": "^1",
"mkdirp": "0.3.5",
"nslog": "0.5.0",
"oniguruma": "1.x",
"oniguruma": "^1.0.6",
"optimist": "0.4.0",
"pathwatcher": "0.16.0",
"pegjs": "0.8.0",
"property-accessors": "1.x",
"q": "1.0.x",
"pathwatcher": "^1.2.3",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"runas": "0.5.x",
"scandal": "0.15.0",
"season": ">=1.0.2 <2.0",
"react": "^0.10.0",
"reactionary": "^0.9.0",
"runas": "^0.5",
"scandal": "0.15.2",
"scoped-property-store": "^0.9.0",
"scrollbar-style": "^0.3.0",
"season": "^1.0.2",
"semver": "1.1.4",
"serializable": "1.x",
"serializable": "^1",
"space-pen": "3.1.1",
"temp": "0.5.0",
"text-buffer": ">=1.1.2 <2.0",
"theorist": "1.x",
"underscore-plus": "1.x",
"text-buffer": "^2.2.0",
"theorist": "^1",
"underscore-plus": "^1.2.1",
"vm-compatibility-layer": "0.1.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.14.0",
"atom-dark-ui": "0.23.0",
"atom-light-syntax": "0.14.0",
"atom-light-ui": "0.22.0",
"base16-tomorrow-dark-theme": "0.12.0",
"solarized-dark-syntax": "0.10.0",
"solarized-light-syntax": "0.6.0",
"archive-view": "0.24.0",
"autocomplete": "0.24.0",
"autoflow": "0.15.0",
"autosave": "0.12.0",
"background-tips": "0.8.0",
"bookmarks": "0.21.0",
"bracket-matcher": "0.22.0",
"command-palette": "0.18.0",
"dev-live-reload": "0.28.0",
"exception-reporting": "0.15.0",
"feedback": "0.26.0",
"find-and-replace": "0.85.0",
"fuzzy-finder": "0.37.0",
"git-diff": "0.25.0",
"go-to-line": "0.17.0",
"grammar-selector": "0.21.0",
"image-view": "0.25.0",
"keybinding-resolver": "0.11.0",
"link": "0.18.0",
"markdown-preview": "0.37.0",
"metrics": "0.28.0",
"open-on-github": "0.21.0",
"package-generator": "0.28.0",
"release-notes": "0.24.0",
"settings-view": "0.82.0",
"snippets": "0.32.0",
"spell-check": "0.26.0",
"status-bar": "0.33.0",
"styleguide": "0.25.0",
"symbols-view": "0.38.0",
"tabs": "0.24.0",
"timecop": "0.15.0",
"tree-view": "0.71.0",
"update-package-dependencies": "0.4.0",
"welcome": "0.6.0",
"whitespace": "0.15.0",
"wrap-guide": "0.15.0",
"language-c": "0.12.0",
"language-coffee-script": "0.12.0",
"language-css": "0.10.0",
"language-gfm": "0.18.0",
"atom-dark-syntax": "0.15.0",
"atom-dark-ui": "0.26.0",
"atom-light-syntax": "0.17.0",
"atom-light-ui": "0.24.0",
"base16-tomorrow-dark-theme": "0.15.0",
"solarized-dark-syntax": "0.14.0",
"solarized-light-syntax": "0.7.0",
"archive-view": "0.30.0",
"autocomplete": "0.27.0",
"autoflow": "0.16.0",
"autosave": "0.13.0",
"background-tips": "0.13.0",
"bookmarks": "0.22.0",
"bracket-matcher": "0.33.0",
"command-palette": "0.21.0",
"deprecation-cop": "0.5.0",
"dev-live-reload": "0.30.0",
"exception-reporting": "0.17.0",
"feedback": "0.32.0",
"find-and-replace": "0.100.0",
"fuzzy-finder": "0.50.0",
"git-diff": "0.28.0",
"go-to-line": "0.19.0",
"grammar-selector": "0.26.0",
"image-view": "0.33.0",
"keybinding-resolver": "0.17.0",
"link": "0.22.0",
"markdown-preview": "0.69.0",
"metrics": "0.32.0",
"open-on-github": "0.28.0",
"package-generator": "0.30.0",
"release-notes": "0.29.0",
"settings-view": "0.114.0",
"snippets": "0.43.0",
"spell-check": "0.35.0",
"status-bar": "0.40.0",
"styleguide": "0.29.0",
"symbols-view": "0.51.0",
"tabs": "0.39.0",
"timecop": "0.18.0",
"tree-view": "0.92.0",
"update-package-dependencies": "0.6.0",
"welcome": "0.13.0",
"whitespace": "0.22.0",
"wrap-guide": "0.18.0",
"language-c": "0.15.0",
"language-coffee-script": "0.22.0",
"language-css": "0.16.0",
"language-gfm": "0.34.0",
"language-git": "0.9.0",
"language-go": "0.6.0",
"language-html": "0.8.0",
"language-hyperlink": "0.8.0",
"language-java": "0.8.0",
"language-javascript": "0.11.0",
"language-go": "0.10.0",
"language-html": "0.19.0",
"language-hyperlink": "0.9.0",
"language-java": "0.10.0",
"language-javascript": "0.25.0",
"language-json": "0.8.0",
"language-less": "0.5.0",
"language-make": "0.8.0",
"language-objective-c": "0.9.0",
"language-less": "0.9.0",
"language-make": "0.10.0",
"language-objective-c": "0.11.0",
"language-perl": "0.8.0",
"language-php": "0.8.0",
"language-php": "0.14.0",
"language-property-list": "0.7.0",
"language-python": "0.8.0",
"language-ruby": "0.13.0",
"language-ruby-on-rails": "0.7.0",
"language-sass": "0.8.0",
"language-shellscript": "0.7.0",
"language-python": "0.15.0",
"language-ruby": "0.23.0",
"language-ruby-on-rails": "0.12.0",
"language-sass": "0.10.0",
"language-shellscript": "0.8.0",
"language-source": "0.7.0",
"language-sql": "0.7.0",
"language-sql": "0.8.0",
"language-text": "0.6.0",
"language-todo": "0.6.0",
"language-toml": "0.11.0",
"language-xml": "0.7.0",
"language-todo": "0.10.0",
"language-toml": "0.12.0",
"language-xml": "0.12.0",
"language-yaml": "0.6.0"
},
"private": true,
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 48 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 284 KiB

+8
Ver Arquivo
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=Atom
Comment=<%= description %>
Exec=/usr/share/atom/atom %U
Icon=atom
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;TextEditor;
+8
Ver Arquivo
@@ -0,0 +1,8 @@
Package: <%= name %>
Version: <%= version %>
Section: <%= section %>
Priority: optional
Architecture: <%= arch %>
Installed-Size: `du -ks usr|cut -f 1`
Maintainer: <%= maintainer %>
Description: <%= description %>
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
Arquivo binário não exibido.
Arquivo binário não exibido.
+19 -12
Ver Arquivo
@@ -1,4 +1,11 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var nodeMinorVersion = process.versions.node.split('.')[1]
if (nodeMinorVersion !== '10') {
console.warn("You must run script/bootstrap and script/build with node v0.10.x");
process.exit(1);
}
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var fs = require('fs');
var path = require('path');
@@ -18,28 +25,28 @@ function executeCommands(commands, done, index) {
done(null);
}
var apmVendorPath = path.resolve(__dirname, '..', 'vendor', 'apm');
var apmInstallPath = path.resolve(__dirname, '..', 'apm');
if (!fs.existsSync(apmInstallPath))
fs.mkdirSync(apmInstallPath);
if (!fs.existsSync(path.join(apmInstallPath, 'node_modules')))
fs.mkdirSync(path.join(apmInstallPath, 'node_modules'));
var apmPath = path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm')
var apmFlags = process.env.JANKY_SHA1 || process.argv.indexOf('--no-color') !== -1 ? '--no-color' : '';
var npmPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'npm');
var npmFlags = ' --userconfig=' + path.resolve('.npmrc') + ' ';
var packagesToDedupe = ['fs-plus', 'humanize-plus', 'oniguruma', 'roaster', 'season'];
var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
{command: 'npm install --quiet', options: {cwd: path.resolve(__dirname, '..', 'build'), ignoreStdout: true}},
{command: 'npm install --quiet', options: {cwd: apmVendorPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {cwd: apmInstallPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {ignoreStdout: true}},
{command: 'node ../../apm/node_modules/atom-package-manager/bin/apm rebuild', options: {cwd: path.resolve('node_modules', 'atom-package-manager'), ignoreStdout: true}},
{command: 'npm' + npmFlags + 'install --quiet', options: {cwd: path.resolve(__dirname, '..', 'build'), ignoreStdout: true}},
{command: npmPath + npmFlags + 'install --quiet', options: {cwd: apmInstallPath, ignoreStdout: true}},
echoNewLine,
'node apm/node_modules/atom-package-manager/bin/apm clean ' + apmFlags,
'node apm/node_modules/atom-package-manager/bin/apm install --quiet ' + apmFlags,
'node apm/node_modules/atom-package-manager/bin/apm dedupe --quiet ' + apmFlags + ' ' + packagesToDedupe.join(' '),
apmPath + ' clean ' + apmFlags,
apmPath + ' install --quiet ' + apmFlags,
apmPath + ' dedupe --quiet ' + apmFlags + ' ' + packagesToDedupe.join(' '),
];
process.chdir(path.dirname(__dirname));
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var fs = require('fs');
var path = require('path');
+3 -3
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
var os = require('os');
@@ -18,13 +18,13 @@ var commands = [
[__dirname, '..', 'node_modules'],
[__dirname, '..', 'build', 'node_modules'],
[__dirname, '..', 'apm', 'node_modules'],
[__dirname, '..', 'vendor', 'apm', 'node_modules'],
[__dirname, '..', 'atom-shell'],
[home, '.atom', '.node-gyp'],
[home, '.atom', 'storage'],
[home, '.atom', '.npm'],
[home, '.atom', 'compile-cache'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
[tmpdir, 'atom-compile-cache'],
];
var run = function() {
var next = commands.shift();
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
+5
Ver Arquivo
@@ -0,0 +1,5 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\grunt" %*
) ELSE (
node "%~dp0\grunt" %*
)
Arquivo executável
+31
Ver Arquivo
@@ -0,0 +1,31 @@
#!/bin/bash
# mkdeb version control-file-path deb-file-path
SCRIPT=`readlink -f "$0"`
ROOT=`readlink -f $(dirname $SCRIPT)/..`
cd $ROOT
VERSION="$1"
CONTROL_FILE="$2"
DESKTOP_FILE="$3"
ICON_FILE="$4"
DEB_PATH="$5"
TARGET_ROOT="`mktemp -d`"
TARGET="$TARGET_ROOT/atom-$VERSION-amd64"
mkdir -p "$TARGET/usr"
env INSTALL_PREFIX="$TARGET/usr" script/grunt install
mkdir -p "$TARGET/DEBIAN"
mv "$CONTROL_FILE" "$TARGET/DEBIAN/control"
mkdir -p "$TARGET/usr/share/applications"
mv "$DESKTOP_FILE" "$TARGET/usr/share/applications"
mkdir -p "$TARGET/usr/share/pixmaps"
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps"
dpkg-deb -b "$TARGET"
mv "$TARGET_ROOT/atom-$VERSION-amd64.deb" "$DEB_PATH"
rm -rf $TARGET_ROOT
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
#!/usr/bin/env node --harmony_collections
#!/usr/bin/env node
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var path = require('path');
+37 -24
Ver Arquivo
@@ -113,18 +113,31 @@ describe "the `atom` global", ->
promise
it "triggers the activation event on all handlers registered during activation", ->
atom.workspaceView.openSync()
editorView = atom.workspaceView.getActiveView()
eventHandler = jasmine.createSpy("activation-event")
editorView.command 'activation-event', eventHandler
editorView.trigger 'activation-event'
expect(mainModule.activate.callCount).toBe 1
expect(mainModule.activationEventCallCount).toBe 1
expect(eventHandler.callCount).toBe 1
editorView.trigger 'activation-event'
expect(mainModule.activationEventCallCount).toBe 2
expect(eventHandler.callCount).toBe 2
expect(mainModule.activate.callCount).toBe 1
waitsForPromise ->
atom.workspaceView.open()
runs ->
editorView = atom.workspaceView.getActiveView()
eventHandler = jasmine.createSpy("activation-event")
editorView.command 'activation-event', eventHandler
editorView.trigger 'activation-event'
expect(mainModule.activate.callCount).toBe 1
expect(mainModule.activationEventCallCount).toBe 1
expect(eventHandler.callCount).toBe 1
editorView.trigger 'activation-event'
expect(mainModule.activationEventCallCount).toBe 2
expect(eventHandler.callCount).toBe 2
expect(mainModule.activate.callCount).toBe 1
it "activates the package immediately when the events are empty", ->
mainModule = require './fixtures/packages/package-with-empty-activation-events/index'
spyOn(mainModule, 'activate').andCallThrough()
waitsForPromise ->
atom.packages.activatePackage('package-with-empty-activation-events')
runs ->
expect(mainModule.activate.callCount).toBe 1
describe "when the package has no main module", ->
it "does not throw an exception", ->
@@ -160,28 +173,28 @@ describe "the `atom` global", ->
element2 = $$ -> @div class: 'test-2'
element3 = $$ -> @div class: 'test-3'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element2)).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element3)).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element1[0])).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element2[0])).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element3[0])).toHaveLength 0
atom.packages.activatePackage("package-with-keymaps")
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)[0].command).toBe "test-1"
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element2)[0].command).toBe "test-2"
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element3)).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element1[0])[0].command).toBe "test-1"
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element2[0])[0].command).toBe "test-2"
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element3[0])).toHaveLength 0
describe "when the metadata contains a 'keymaps' manifest", ->
it "loads only the keymaps specified by the manifest, in the specified order", ->
element1 = $$ -> @div class: 'test-1'
element3 = $$ -> @div class: 'test-3'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element1[0])).toHaveLength 0
atom.packages.activatePackage("package-with-keymaps-manifest")
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', element1)[0].command).toBe 'keymap-1'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-n', element1)[0].command).toBe 'keymap-2'
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-y', element3)).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:element1[0])[0].command).toBe 'keymap-1'
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-n', target:element1[0])[0].command).toBe 'keymap-2'
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-y', target:element3[0])).toHaveLength 0
describe "menu loading", ->
beforeEach ->
@@ -367,8 +380,8 @@ describe "the `atom` global", ->
runs ->
atom.packages.deactivatePackage('package-with-keymaps')
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', $$ -> @div class: 'test-1')).toHaveLength 0
expect(atom.keymap.keyBindingsForKeystrokeMatchingElement('ctrl-z', $$ -> @div class: 'test-2')).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:$$ -> @div class: 'test-1'[0])).toHaveLength 0
expect(atom.keymaps.findKeyBindings(keystrokes:'ctrl-z', target:$$ -> @div class: 'test-2'[0])).toHaveLength 0
it "removes the package's stylesheets", ->
waitsForPromise ->
+46 -1
Ver Arquivo
@@ -36,15 +36,53 @@ describe "Config", ->
describe "when the value equals the default value", ->
it "does not store the value", ->
atom.config.setDefaults("foo", same: 1, changes: 1)
atom.config.setDefaults "foo",
same: 1
changes: 1
sameArray: [1, 2, 3]
sameObject: {a: 1, b: 2}
null: null
undefined: undefined
expect(atom.config.settings.foo).toBeUndefined()
atom.config.set('foo.same', 1)
atom.config.set('foo.changes', 2)
atom.config.set('foo.sameArray', [1, 2, 3])
atom.config.set('foo.null', undefined)
atom.config.set('foo.undefined', null)
atom.config.set('foo.sameObject', {b: 2, a: 1})
expect(atom.config.settings.foo).toEqual {changes: 2}
atom.config.set('foo.changes', 1)
expect(atom.config.settings.foo).toEqual {}
describe ".getDefault(keyPath)", ->
it "returns a clone of the default value", ->
atom.config.setDefaults("foo", same: 1, changes: 1)
expect(atom.config.getDefault('foo.same')).toBe 1
expect(atom.config.getDefault('foo.changes')).toBe 1
atom.config.set('foo.same', 2)
atom.config.set('foo.changes', 3)
expect(atom.config.getDefault('foo.same')).toBe 1
expect(atom.config.getDefault('foo.changes')).toBe 1
initialDefaultValue = [1, 2, 3]
atom.config.setDefaults("foo", bar: initialDefaultValue)
expect(atom.config.getDefault('foo.bar')).toEqual initialDefaultValue
expect(atom.config.getDefault('foo.bar')).not.toBe initialDefaultValue
describe ".isDefault(keyPath)", ->
it "returns true when the value of the key path is its default value", ->
atom.config.setDefaults("foo", same: 1, changes: 1)
expect(atom.config.isDefault('foo.same')).toBe true
expect(atom.config.isDefault('foo.changes')).toBe true
atom.config.set('foo.same', 2)
atom.config.set('foo.changes', 3)
expect(atom.config.isDefault('foo.same')).toBe false
expect(atom.config.isDefault('foo.changes')).toBe false
describe ".toggle(keyPath)", ->
it "negates the boolean value of the current key path value", ->
atom.config.set('foo.a', 1)
@@ -170,6 +208,13 @@ describe "Config", ->
expect(atom.config.get("foo.quux.x")).toBe 0
expect(atom.config.get("foo.quux.y")).toBe 1
it "emits an updated event", ->
updatedCallback = jasmine.createSpy('updated')
atom.config.observe('foo.bar.baz.a', callNow: false, updatedCallback)
expect(updatedCallback.callCount).toBe 0
atom.config.setDefaults("foo.bar.baz", a: 2)
expect(updatedCallback.callCount).toBe 1
describe ".observe(keyPath)", ->
[observeHandler, observeSubscription] = []
+129 -31
Ver Arquivo
@@ -18,10 +18,10 @@ describe "DisplayBuffer", ->
displayBuffer.destroy()
buffer.release()
describe ".copy()", ->
describe "::copy()", ->
it "creates a new DisplayBuffer with the same initial state", ->
marker1 = displayBuffer.markBufferRange([[1, 2], [3, 4]], id: 1)
marker2 = displayBuffer.markBufferRange([[2, 3], [4, 5]], isReversed: true, id: 2)
marker2 = displayBuffer.markBufferRange([[2, 3], [4, 5]], reversed: true, id: 2)
marker3 = displayBuffer.markBufferPosition([5, 6], id: 3)
displayBuffer.createFold(3, 5)
@@ -37,7 +37,7 @@ describe "DisplayBuffer", ->
expect(displayBuffer2.isFoldedAtBufferRow(3)).toBeTruthy()
# can diverge from origin
displayBuffer2.destroyFoldsContainingBufferRow(3)
displayBuffer2.unfoldBufferRow(3)
expect(displayBuffer2.isFoldedAtBufferRow(3)).not.toBe displayBuffer.isFoldedAtBufferRow(3)
describe "when the buffer changes", ->
@@ -82,7 +82,7 @@ describe "DisplayBuffer", ->
describe "when there is no whitespace before the boundary", ->
it "wraps the line exactly at the boundary since there's no more graceful place to wrap it", ->
buffer.change([[0, 0], [1, 0]], 'abcdefghijklmnopqrstuvwxyz\n')
buffer.setTextInRange([[0, 0], [1, 0]], 'abcdefghijklmnopqrstuvwxyz\n')
displayBuffer.setEditorWidthInChars(10)
expect(displayBuffer.lineForRow(0).text).toBe 'abcdefghij'
expect(displayBuffer.lineForRow(1).text).toBe 'klmnopqrst'
@@ -142,7 +142,7 @@ describe "DisplayBuffer", ->
describe "when buffer lines are removed", ->
it "removes lines and emits a change event", ->
buffer.change([[3, 21], [7, 5]], ';')
buffer.setTextInRange([[3, 21], [7, 5]], ';')
expect(displayBuffer.lineForRow(3).text).toBe ' var pivot = items;'
expect(displayBuffer.lineForRow(4).text).toBe ' return '
expect(displayBuffer.lineForRow(5).text).toBe 'sort(left).concat(pivot).concat(sort(right));'
@@ -200,6 +200,12 @@ describe "DisplayBuffer", ->
expect(tokensText displayBuffer.lineForRow(12).tokens).toBe 'sort(left).concat(pivot).concat(sort(rig'
expect(changeHandler).toHaveBeenCalledWith(start: 0, end: 15, screenDelta: 3, bufferDelta: 0)
it "only allows positive widths to be assigned", ->
displayBuffer.setEditorWidthInChars(0)
expect(displayBuffer.editorWidthInChars).not.toBe 0
displayBuffer.setEditorWidthInChars(-1)
expect(displayBuffer.editorWidthInChars).not.toBe -1
describe "primitive folding", ->
beforeEach ->
displayBuffer.destroy()
@@ -324,7 +330,7 @@ describe "DisplayBuffer", ->
describe "when the old range surrounds a fold", ->
beforeEach ->
buffer.change([[1, 0], [5, 1]], 'party!')
buffer.setTextInRange([[1, 0], [5, 1]], 'party!')
it "removes the fold and replaces the selection with the new text", ->
expect(displayBuffer.lineForRow(0).text).toBe "0"
@@ -346,7 +352,7 @@ describe "DisplayBuffer", ->
displayBuffer.createFold(2, 9)
changeHandler.reset()
buffer.change([[1, 0], [10, 0]], 'goodbye')
buffer.setTextInRange([[1, 0], [10, 0]], 'goodbye')
expect(displayBuffer.lineForRow(0).text).toBe "0"
expect(displayBuffer.lineForRow(1).text).toBe "goodbye10"
@@ -365,7 +371,7 @@ describe "DisplayBuffer", ->
describe "when the old range precedes lines with a fold", ->
describe "when the new range precedes lines with a fold", ->
it "updates the buffer and re-positions subsequent folds", ->
buffer.change([[0, 0], [1, 1]], 'abc')
buffer.setTextInRange([[0, 0], [1, 1]], 'abc')
expect(displayBuffer.lineForRow(0).text).toBe "abc"
expect(displayBuffer.lineForRow(1).fold).toBe fold1
@@ -388,7 +394,7 @@ describe "DisplayBuffer", ->
describe "when the old range straddles the beginning of a fold", ->
it "destroys the fold", ->
buffer.change([[1, 1], [3, 0]], "a\nb\nc\nd\n")
buffer.setTextInRange([[1, 1], [3, 0]], "a\nb\nc\nd\n")
expect(displayBuffer.lineForRow(1).text).toBe '1a'
expect(displayBuffer.lineForRow(2).text).toBe 'b'
expect(displayBuffer.lineForRow(2).fold).toBeUndefined()
@@ -396,7 +402,7 @@ describe "DisplayBuffer", ->
describe "when the old range follows a fold", ->
it "re-positions the screen ranges for the change event based on the preceding fold", ->
buffer.change([[10, 0], [11, 0]], 'abc')
buffer.setTextInRange([[10, 0], [11, 0]], 'abc')
expect(displayBuffer.lineForRow(1).text).toBe "1"
expect(displayBuffer.lineForRow(2).fold).toBe fold1
@@ -424,7 +430,7 @@ describe "DisplayBuffer", ->
describe "when the end of the new range exceeds the end of the fold", ->
it "expands the fold to contain all the inserted lines", ->
buffer.change([[3, 0], [4, 0]], 'a\nb\nc\nd\n')
buffer.setTextInRange([[3, 0], [4, 0]], 'a\nb\nc\nd\n')
expect(fold1.getStartRow()).toBe 2
expect(fold1.getEndRow()).toBe 7
@@ -441,7 +447,7 @@ describe "DisplayBuffer", ->
describe "when the end of the new range precedes the end of the fold", ->
it "destroys the fold", ->
fold2.destroy()
buffer.change([[3, 0], [6, 0]], 'a\n')
buffer.setTextInRange([[3, 0], [6, 0]], 'a\n')
expect(displayBuffer.lineForRow(2).text).toBe '2'
expect(displayBuffer.lineForRow(2).fold).toBeUndefined()
expect(displayBuffer.lineForRow(3).text).toBe 'a'
@@ -460,6 +466,12 @@ describe "DisplayBuffer", ->
expect(changeHandler).toHaveBeenCalledWith(start: 3, end: 3, screenDelta: 1, bufferDelta: 1)
describe "when the change starts at the beginning of a fold but does not extend to the end (regression)", ->
it "preserves a proper mapping between buffer and screen coordinates", ->
expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0]
buffer.setTextInRange([[2, 0], [3, 0]], "\n")
expect(displayBuffer.screenPositionForBufferPosition([8, 0])).toEqual [4, 0]
describe "position translation", ->
it "translates positions to account for folded lines and characters and the placeholder", ->
fold = displayBuffer.createFold(4, 7)
@@ -495,7 +507,7 @@ describe "DisplayBuffer", ->
expect(displayBuffer.bufferPositionForScreenPosition([5, 0])).toEqual [5, 0]
expect(displayBuffer.bufferPositionForScreenPosition([9, 2])).toEqual [9, 2]
describe ".destroyFoldsContainingBufferRow(row)", ->
describe ".unfoldBufferRow(row)", ->
it "destroys all folds containing the given row", ->
displayBuffer.createFold(2, 4)
displayBuffer.createFold(2, 6)
@@ -506,14 +518,25 @@ describe "DisplayBuffer", ->
expect(displayBuffer.lineForRow(1).text).toBe '1'
expect(displayBuffer.lineForRow(2).text).toBe '10'
displayBuffer.destroyFoldsContainingBufferRow(2)
displayBuffer.unfoldBufferRow(2)
expect(displayBuffer.lineForRow(1).text).toBe '1'
expect(displayBuffer.lineForRow(2).text).toBe '2'
expect(displayBuffer.lineForRow(7).fold).toBeDefined()
expect(displayBuffer.lineForRow(8).text).toMatch /^9-+/
expect(displayBuffer.lineForRow(10).fold).toBeDefined()
describe ".clipScreenPosition(screenPosition, wrapBeyondNewlines: false, wrapAtSoftNewlines: false, skipAtomicTokens: false)", ->
describe ".outermostFoldsInBufferRowRange(startRow, endRow)", ->
it "returns the outermost folds entirely contained in the given row range, exclusive of end row", ->
fold1 = displayBuffer.createFold(4, 7)
fold2 = displayBuffer.createFold(5, 6)
fold3 = displayBuffer.createFold(11, 15)
fold4 = displayBuffer.createFold(12, 13)
fold5 = displayBuffer.createFold(16, 17)
expect(displayBuffer.outermostFoldsInBufferRowRange(3, 18)).toEqual [fold1, fold3, fold5]
expect(displayBuffer.outermostFoldsInBufferRowRange(5, 16)).toEqual [fold3]
describe "::clipScreenPosition(screenPosition, wrapBeyondNewlines: false, wrapAtSoftNewlines: false, skipAtomicTokens: false)", ->
beforeEach ->
displayBuffer.setSoftWrap(true)
displayBuffer.setEditorWidthInChars(50)
@@ -575,7 +598,7 @@ describe "DisplayBuffer", ->
expect(displayBuffer.clipScreenPosition([0, 1], skipAtomicTokens: true)).toEqual [0, tabLength]
expect(displayBuffer.clipScreenPosition([0, tabLength], skipAtomicTokens: true)).toEqual [0, tabLength]
describe ".screenPositionForBufferPosition(bufferPosition, options)", ->
describe "::screenPositionForBufferPosition(bufferPosition, options)", ->
it "clips the specified buffer position", ->
expect(displayBuffer.screenPositionForBufferPosition([0, 2])).toEqual [0, 2]
expect(displayBuffer.screenPositionForBufferPosition([0, 100000])).toEqual [0, 29]
@@ -588,13 +611,20 @@ describe "DisplayBuffer", ->
expect(displayBuffer.screenPositionForBufferPosition([0, 1])).toEqual [0, 2]
expect(displayBuffer.bufferPositionForScreenPosition([0, 2])).toEqual [0, 1]
describe ".getMaxLineLength()", ->
it "correctly translates positions on soft wrapped lines containing tabs", ->
buffer.setText('\t\taa bb cc dd ee ff gg')
displayBuffer.setSoftWrap(true)
displayBuffer.setEditorWidthInChars(10)
expect(displayBuffer.screenPositionForBufferPosition([0, 10], wrapAtSoftNewlines: true)).toEqual [1, 0]
expect(displayBuffer.bufferPositionForScreenPosition([1, 0])).toEqual [0, 10]
describe "::getMaxLineLength()", ->
it "returns the length of the longest screen line", ->
expect(displayBuffer.getMaxLineLength()).toBe 65
buffer.delete([[6, 0], [6, 65]])
expect(displayBuffer.getMaxLineLength()).toBe 62
describe ".destroy()", ->
describe "::destroy()", ->
it "unsubscribes all display buffer markers from their underlying buffer marker (regression)", ->
marker = displayBuffer.markBufferPosition([12, 2])
displayBuffer.destroy()
@@ -684,7 +714,7 @@ describe "DisplayBuffer", ->
}
markerChangedHandler.reset()
displayBuffer.destroyFoldsContainingBufferRow(4)
displayBuffer.unfoldBufferRow(4)
expect(markerChangedHandler).toHaveBeenCalled()
expect(markerChangedHandler.argsForCall[0][0]).toEqual {
oldHeadScreenPosition: [8, 23]
@@ -747,17 +777,17 @@ describe "DisplayBuffer", ->
isValid: true
}
xit "triggers the 'changed' event whenever the marker is invalidated or revalidated", ->
it "triggers the 'changed' event whenever the marker is invalidated or revalidated", ->
buffer.deleteRow(8)
expect(markerChangedHandler).toHaveBeenCalled()
expect(markerChangedHandler.argsForCall[0][0]).toEqual {
oldHeadScreenPosition: [5, 10]
oldHeadBufferPosition: [8, 10]
newHeadScreenPosition: [5, 10]
newHeadScreenPosition: [5, 0]
newHeadBufferPosition: [8, 0]
oldTailScreenPosition: [5, 4]
oldTailBufferPosition: [8, 4]
newTailScreenPosition: [5, 4]
newTailScreenPosition: [5, 0]
newTailBufferPosition: [8, 0]
textChanged: true
isValid: false
@@ -768,12 +798,12 @@ describe "DisplayBuffer", ->
expect(markerChangedHandler).toHaveBeenCalled()
expect(markerChangedHandler.argsForCall[0][0]).toEqual {
oldHeadScreenPosition: [5, 10]
oldHeadBufferPosition: [8, 10]
oldHeadScreenPosition: [5, 0]
oldHeadBufferPosition: [8, 0]
newHeadScreenPosition: [5, 10]
newHeadBufferPosition: [8, 10]
oldTailScreenPosition: [5, 4]
oldTailBufferPosition: [8, 4]
oldTailScreenPosition: [5, 0]
oldTailBufferPosition: [8, 0]
newTailScreenPosition: [5, 4]
newTailBufferPosition: [8, 4]
textChanged: true
@@ -784,7 +814,7 @@ describe "DisplayBuffer", ->
displayBuffer.createFold(10, 11)
expect(markerChangedHandler).not.toHaveBeenCalled()
xit "updates markers before emitting buffer change events, but does not notify their observers until the change event", ->
it "updates markers before emitting buffer change events, but does not notify their observers until the change event", ->
marker2 = displayBuffer.markBufferRange([[8, 1], [8, 1]])
marker2.on 'changed', marker2ChangedHandler = jasmine.createSpy("marker2ChangedHandler")
displayBuffer.on 'changed', changeHandler = jasmine.createSpy("changeHandler").andCallFake -> onDisplayBufferChange()
@@ -801,7 +831,7 @@ describe "DisplayBuffer", ->
expect(marker.getTailScreenPosition()).toEqual [5, 7]
expect(marker2.isValid()).toBeFalsy()
buffer.change([[8, 0], [8, 2]], ".....")
buffer.setTextInRange([[8, 0], [8, 2]], ".....")
expect(changeHandler).toHaveBeenCalled()
expect(markerChangedHandler).toHaveBeenCalled()
expect(marker2ChangedHandler).toHaveBeenCalled()
@@ -867,12 +897,12 @@ describe "DisplayBuffer", ->
expect(marker.getHeadScreenPosition()).toEqual [8, 10]
expect(marker.getTailScreenPosition()).toEqual [8, 4]
displayBuffer.destroyFoldsContainingBufferRow(4)
displayBuffer.unfoldBufferRow(4)
expect(changeHandler).toHaveBeenCalled()
expect(markerChangedHandler).toHaveBeenCalled()
describe ".findMarkers(attributes)", ->
describe "::findMarkers(attributes)", ->
it "allows the startBufferRow and endBufferRow to be specified", ->
marker1 = displayBuffer.markBufferRange([[0, 0], [3, 0]], class: 'a')
marker2 = displayBuffer.markBufferRange([[0, 0], [5, 0]], class: 'a')
@@ -902,7 +932,7 @@ describe "DisplayBuffer", ->
buffer.getMarker(marker2.id).destroy()
expect(destroyedHandler).toHaveBeenCalled()
describe "DisplayBufferMarker.copy(attributes)", ->
describe "DisplayBufferMarker::copy(attributes)", ->
it "creates a copy of the marker with the given attributes merged in", ->
initialMarkerCount = displayBuffer.getMarkerCount()
marker1 = displayBuffer.markScreenRange([[5, 4], [5, 10]], a: 1, b: 2)
@@ -913,3 +943,71 @@ describe "DisplayBuffer", ->
expect(displayBuffer.getMarkerCount()).toBe initialMarkerCount + 2
expect(marker1.getAttributes()).toEqual a: 1, b: 2
expect(marker2.getAttributes()).toEqual a: 1, b: 3
describe "DisplayBufferMarker::getPixelRange()", ->
it "returns the start and end positions of the marker based on the line height and character widths assigned to the DisplayBuffer", ->
marker = displayBuffer.markScreenRange([[5, 10], [6, 4]])
displayBuffer.setLineHeight(20)
displayBuffer.setDefaultCharWidth(10)
displayBuffer.setScopedCharWidths(["source.js", "keyword.control.js"], r: 11, e: 11, t: 11, u: 11, n: 11)
{start, end} = marker.getPixelRange()
expect(start.top).toBe 5 * 20
expect(start.left).toBe (4 * 10) + (6 * 11)
describe "::setScrollTop", ->
beforeEach ->
displayBuffer.manageScrollPosition = true
displayBuffer.setLineHeight(10)
it "disallows negative values", ->
displayBuffer.setHeight(displayBuffer.getScrollHeight() + 100)
expect(displayBuffer.setScrollTop(-10)).toBe 0
expect(displayBuffer.getScrollTop()).toBe 0
it "disallows values that would make ::getScrollBottom() exceed ::getScrollHeight()", ->
displayBuffer.setHeight(50)
maxScrollTop = displayBuffer.getScrollHeight() - displayBuffer.getHeight()
expect(displayBuffer.setScrollTop(maxScrollTop)).toBe maxScrollTop
expect(displayBuffer.getScrollTop()).toBe maxScrollTop
expect(displayBuffer.setScrollTop(maxScrollTop + 50)).toBe maxScrollTop
expect(displayBuffer.getScrollTop()).toBe maxScrollTop
describe "::setScrollLeft", ->
beforeEach ->
displayBuffer.manageScrollPosition = true
displayBuffer.setLineHeight(10)
displayBuffer.setDefaultCharWidth(10)
it "disallows negative values", ->
displayBuffer.setWidth(displayBuffer.getScrollWidth() + 100)
expect(displayBuffer.setScrollLeft(-10)).toBe 0
expect(displayBuffer.getScrollLeft()).toBe 0
it "disallows values that would make ::getScrollRight() exceed ::getScrollWidth()", ->
displayBuffer.setWidth(50)
maxScrollLeft = displayBuffer.getScrollWidth() - displayBuffer.getWidth()
expect(displayBuffer.setScrollLeft(maxScrollLeft)).toBe maxScrollLeft
expect(displayBuffer.getScrollLeft()).toBe maxScrollLeft
expect(displayBuffer.setScrollLeft(maxScrollLeft + 50)).toBe maxScrollLeft
expect(displayBuffer.getScrollLeft()).toBe maxScrollLeft
describe "::scrollToScreenPosition(position)", ->
it "sets the scroll top and scroll left so the given screen position is in view", ->
displayBuffer.manageScrollPosition = true
displayBuffer.setLineHeight(10)
displayBuffer.setDefaultCharWidth(10)
displayBuffer.setHorizontalScrollbarHeight(0)
displayBuffer.setHeight(50)
displayBuffer.setWidth(50)
maxScrollTop = displayBuffer.getScrollHeight() - displayBuffer.getHeight()
displayBuffer.scrollToScreenPosition([8, 20])
expect(displayBuffer.getScrollBottom()).toBe (9 + displayBuffer.getVerticalScrollMargin()) * 10
expect(displayBuffer.getScrollRight()).toBe (20 + displayBuffer.getHorizontalScrollMargin()) * 10
+708
Ver Arquivo
@@ -0,0 +1,708 @@
{extend, flatten, toArray, last} = require 'underscore-plus'
ReactEditorView = require '../src/react-editor-view'
nbsp = String.fromCharCode(160)
describe "EditorComponent", ->
[contentNode, editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = []
[lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage('language-javascript')
runs ->
spyOn(window, "setInterval").andCallFake window.fakeSetInterval
spyOn(window, "clearInterval").andCallFake window.fakeClearInterval
delayAnimationFrames = false
nextAnimationFrame = null
spyOn(window, 'requestAnimationFrame').andCallFake (fn) ->
if delayAnimationFrames
nextAnimationFrame = fn
else
fn()
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
contentNode = document.querySelector('#jasmine-content')
contentNode.style.width = '1000px'
wrapperView = new ReactEditorView(editor)
wrapperView.attachToDom()
{component} = wrapperView
component.setLineHeight(1.3)
component.setFontSize(20)
lineHeightInPixels = editor.getLineHeight()
charWidth = editor.getDefaultCharWidth()
node = component.getDOMNode()
verticalScrollbarNode = node.querySelector('.vertical-scrollbar')
horizontalScrollbarNode = node.querySelector('.horizontal-scrollbar')
afterEach ->
contentNode.style.width = ''
describe "line rendering", ->
it "renders only the currently-visible lines", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
lines = node.querySelectorAll('.line')
expect(lines.length).toBe 6
expect(lines[0].textContent).toBe editor.lineForScreenRow(0).text
expect(lines[5].textContent).toBe editor.lineForScreenRow(5).text
verticalScrollbarNode.scrollTop = 2.5 * lineHeightInPixels
verticalScrollbarNode.dispatchEvent(new UIEvent('scroll'))
expect(node.querySelector('.scroll-view-content').style['-webkit-transform']).toBe "translate3d(0px, #{-2.5 * lineHeightInPixels}px, 0px)"
lineNodes = node.querySelectorAll('.line')
expect(lineNodes.length).toBe 6
expect(lineNodes[0].style['-webkit-transform']).toBe "translate3d(0px, #{2 * lineHeightInPixels}px, 0px)"
expect(lineNodes[0].textContent).toBe editor.lineForScreenRow(2).text
expect(lineNodes[5].textContent).toBe editor.lineForScreenRow(7).text
it "updates transforms of subsequent lines when lines are inserted or removed", ->
editor.getBuffer().deleteRows(0, 1)
lineNodes = node.querySelectorAll('.line')
expect(lineNodes[0].style['-webkit-transform']).toBe "translate3d(0px, #{0 * lineHeightInPixels}px, 0px)"
expect(lineNodes[1].style['-webkit-transform']).toBe "translate3d(0px, #{1 * lineHeightInPixels}px, 0px)"
expect(lineNodes[2].style['-webkit-transform']).toBe "translate3d(0px, #{2 * lineHeightInPixels}px, 0px)"
editor.getBuffer().insert([0, 0], '\n\n')
lineNodes = node.querySelectorAll('.line')
expect(lineNodes[0].style['-webkit-transform']).toBe "translate3d(0px, #{0 * lineHeightInPixels}px, 0px)"
expect(lineNodes[1].style['-webkit-transform']).toBe "translate3d(0px, #{1 * lineHeightInPixels}px, 0px)"
expect(lineNodes[2].style['-webkit-transform']).toBe "translate3d(0px, #{2 * lineHeightInPixels}px, 0px)"
expect(lineNodes[3].style['-webkit-transform']).toBe "translate3d(0px, #{3 * lineHeightInPixels}px, 0px)"
expect(lineNodes[4].style['-webkit-transform']).toBe "translate3d(0px, #{4 * lineHeightInPixels}px, 0px)"
describe "when indent guides are enabled", ->
beforeEach ->
component.setShowIndentGuide(true)
it "adds an 'indent-guide' class to spans comprising the leading whitespace", ->
lines = node.querySelectorAll('.line')
line1LeafNodes = getLeafNodes(lines[1])
expect(line1LeafNodes[0].textContent).toBe ' '
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe false
line2LeafNodes = getLeafNodes(lines[2])
expect(line2LeafNodes[0].textContent).toBe ' '
expect(line2LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[1].textContent).toBe ' '
expect(line2LeafNodes[1].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe false
it "renders leading whitespace spans with the 'indent-guide' class for empty lines", ->
editor.getBuffer().insert([1, Infinity], '\n')
lines = node.querySelectorAll('.line')
line2LeafNodes = getLeafNodes(lines[2])
expect(line2LeafNodes.length).toBe 3
expect(line2LeafNodes[0].textContent).toBe ' '
expect(line2LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[1].textContent).toBe ' '
expect(line2LeafNodes[1].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[2].textContent).toBe ' '
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
it "renders indent guides correctly on lines containing only whitespace", ->
editor.getBuffer().insert([1, Infinity], '\n ')
lines = node.querySelectorAll('.line')
line2LeafNodes = getLeafNodes(lines[2])
expect(line2LeafNodes.length).toBe 3
expect(line2LeafNodes[0].textContent).toBe ' '
expect(line2LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[1].textContent).toBe ' '
expect(line2LeafNodes[1].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[2].textContent).toBe ' '
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
it "does not render indent guides in trailing whitespace for lines containing non whitespace characters", ->
editor.getBuffer().setText (" hi ")
lines = node.querySelectorAll('.line')
line0LeafNodes = getLeafNodes(lines[0])
expect(line0LeafNodes[0].textContent).toBe ' '
expect(line0LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line0LeafNodes[1].textContent).toBe ' '
expect(line0LeafNodes[1].classList.contains('indent-guide')).toBe false
getLeafNodes = (node) ->
if node.children.length > 0
flatten(toArray(node.children).map(getLeafNodes))
else
[node]
describe "gutter rendering", ->
it "renders the currently-visible line numbers", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
lines = node.querySelectorAll('.line-number')
expect(lines.length).toBe 6
expect(lines[0].textContent).toBe "#{nbsp}1"
expect(lines[5].textContent).toBe "#{nbsp}6"
verticalScrollbarNode.scrollTop = 2.5 * lineHeightInPixels
verticalScrollbarNode.dispatchEvent(new UIEvent('scroll'))
expect(node.querySelector('.line-numbers').style['-webkit-transform']).toBe "translate3d(0px, #{-2.5 * lineHeightInPixels}px, 0px)"
lineNumberNodes = node.querySelectorAll('.line-number')
expect(lineNumberNodes.length).toBe 6
expect(lineNumberNodes[0].offsetTop).toBe 2 * lineHeightInPixels
expect(lineNumberNodes[5].offsetTop).toBe 7 * lineHeightInPixels
expect(lineNumberNodes[0].textContent).toBe "#{nbsp}3"
expect(lineNumberNodes[5].textContent).toBe "#{nbsp}8"
it "updates absolute positions of subsequent line numbers when lines are inserted or removed", ->
editor.getBuffer().insert([0, 0], '\n\n')
lineNumberNodes = node.querySelectorAll('.line-number')
expect(lineNumberNodes[0].offsetTop).toBe 0
expect(lineNumberNodes[1].offsetTop).toBe 1 * lineHeightInPixels
expect(lineNumberNodes[2].offsetTop).toBe 2 * lineHeightInPixels
expect(lineNumberNodes[3].offsetTop).toBe 3 * lineHeightInPixels
expect(lineNumberNodes[4].offsetTop).toBe 4 * lineHeightInPixels
editor.getBuffer().insert([0, 0], '\n\n')
lineNumberNodes = node.querySelectorAll('.line-number')
expect(lineNumberNodes[0].offsetTop).toBe 0
expect(lineNumberNodes[1].offsetTop).toBe 1 * lineHeightInPixels
expect(lineNumberNodes[2].offsetTop).toBe 2 * lineHeightInPixels
expect(lineNumberNodes[3].offsetTop).toBe 3 * lineHeightInPixels
expect(lineNumberNodes[4].offsetTop).toBe 4 * lineHeightInPixels
it "renders • characters for soft-wrapped lines", ->
editor.setSoftWrap(true)
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = 30 * charWidth + 'px'
component.measureHeightAndWidth()
lines = node.querySelectorAll('.line-number')
expect(lines.length).toBe 6
expect(lines[0].textContent).toBe "#{nbsp}1"
expect(lines[1].textContent).toBe "#{nbsp}"
expect(lines[2].textContent).toBe "#{nbsp}2"
expect(lines[3].textContent).toBe "#{nbsp}"
expect(lines[4].textContent).toBe "#{nbsp}3"
expect(lines[5].textContent).toBe "#{nbsp}"
it "pads line numbers to be right justified based on the maximum number of line number digits", ->
editor.getBuffer().setText([1..10].join('\n'))
lineNumberNodes = toArray(node.querySelectorAll('.line-number'))
for node, i in lineNumberNodes[0..8]
expect(node.textContent).toBe "#{nbsp}#{i + 1}"
expect(lineNumberNodes[9].textContent).toBe '10'
# Removes padding when the max number of digits goes down
editor.getBuffer().delete([[1, 0], [2, 0]])
lineNumberNodes = toArray(node.querySelectorAll('.line-number'))
for node, i in lineNumberNodes
expect(node.textContent).toBe "#{i + 1}"
describe "cursor rendering", ->
it "renders the currently visible cursors", ->
cursor1 = editor.getCursor()
cursor1.setScreenPosition([0, 5])
node.style.height = 4.5 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
cursorNodes = node.querySelectorAll('.cursor')
expect(cursorNodes.length).toBe 1
expect(cursorNodes[0].offsetHeight).toBe lineHeightInPixels
expect(cursorNodes[0].offsetWidth).toBe charWidth
expect(cursorNodes[0].offsetTop).toBe 0
expect(cursorNodes[0].offsetLeft).toBe 5 * charWidth
cursor2 = editor.addCursorAtScreenPosition([6, 11])
cursor3 = editor.addCursorAtScreenPosition([4, 10])
cursorNodes = node.querySelectorAll('.cursor')
expect(cursorNodes.length).toBe 2
expect(cursorNodes[0].offsetTop).toBe 0
expect(cursorNodes[0].offsetLeft).toBe 5 * charWidth
expect(cursorNodes[1].offsetTop).toBe 4 * lineHeightInPixels
expect(cursorNodes[1].offsetLeft).toBe 10 * charWidth
verticalScrollbarNode.scrollTop = 2.5 * lineHeightInPixels
verticalScrollbarNode.dispatchEvent(new UIEvent('scroll'))
cursorNodes = node.querySelectorAll('.cursor')
expect(cursorNodes.length).toBe 2
expect(cursorNodes[0].offsetTop).toBe 6 * lineHeightInPixels
expect(cursorNodes[0].offsetLeft).toBe 11 * charWidth
expect(cursorNodes[1].offsetTop).toBe 4 * lineHeightInPixels
expect(cursorNodes[1].offsetLeft).toBe 10 * charWidth
cursor3.destroy()
cursorNodes = node.querySelectorAll('.cursor')
expect(cursorNodes.length).toBe 1
expect(cursorNodes[0].offsetTop).toBe 6 * lineHeightInPixels
expect(cursorNodes[0].offsetLeft).toBe 11 * charWidth
it "accounts for character widths when positioning cursors", ->
atom.config.set('editor.fontFamily', 'sans-serif')
editor.setCursorScreenPosition([0, 16])
cursor = node.querySelector('.cursor')
cursorRect = cursor.getBoundingClientRect()
cursorLocationTextNode = node.querySelector('.storage.type.function.js').firstChild.firstChild
range = document.createRange()
range.setStart(cursorLocationTextNode, 0)
range.setEnd(cursorLocationTextNode, 1)
rangeRect = range.getBoundingClientRect()
expect(cursorRect.left).toBe rangeRect.left
expect(cursorRect.width).toBe rangeRect.width
it "blinks cursors when they aren't moving", ->
editor.addCursorAtScreenPosition([1, 0])
[cursorNode1, cursorNode2] = node.querySelectorAll('.cursor')
expect(cursorNode1.classList.contains('blink-off')).toBe false
expect(cursorNode2.classList.contains('blink-off')).toBe false
advanceClock(component.props.cursorBlinkPeriod / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe true
expect(cursorNode2.classList.contains('blink-off')).toBe true
advanceClock(component.props.cursorBlinkPeriod / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe false
expect(cursorNode2.classList.contains('blink-off')).toBe false
advanceClock(component.props.cursorBlinkPeriod / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe true
expect(cursorNode2.classList.contains('blink-off')).toBe true
# Stop blinking immediately when cursors move
advanceClock(component.props.cursorBlinkPeriod / 4)
expect(cursorNode1.classList.contains('blink-off')).toBe true
expect(cursorNode2.classList.contains('blink-off')).toBe true
# Stop blinking for one full period after moving the cursor
editor.moveCursorRight()
expect(cursorNode1.classList.contains('blink-off')).toBe false
expect(cursorNode2.classList.contains('blink-off')).toBe false
advanceClock(component.props.cursorBlinkResumeDelay / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe false
expect(cursorNode2.classList.contains('blink-off')).toBe false
advanceClock(component.props.cursorBlinkResumeDelay / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe true
expect(cursorNode2.classList.contains('blink-off')).toBe true
advanceClock(component.props.cursorBlinkPeriod / 2)
expect(cursorNode1.classList.contains('blink-off')).toBe false
expect(cursorNode2.classList.contains('blink-off')).toBe false
it "renders the hidden input field at the position of the last cursor if it is on screen", ->
inputNode = node.querySelector('.hidden-input')
node.style.height = 5 * lineHeightInPixels + 'px'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
expect(editor.getCursorScreenPosition()).toEqual [0, 0]
editor.setScrollTop(3 * lineHeightInPixels)
editor.setScrollLeft(3 * charWidth)
expect(inputNode.offsetTop).toBe 0
expect(inputNode.offsetLeft).toBe 0
editor.setCursorBufferPosition([5, 5])
cursorRect = editor.getCursor().getPixelRect()
cursorTop = cursorRect.top
cursorLeft = cursorRect.left
expect(inputNode.offsetTop).toBe cursorTop - editor.getScrollTop()
expect(inputNode.offsetLeft).toBe cursorLeft - editor.getScrollLeft()
it "does not render cursors that are associated with non-empty selections", ->
editor.setSelectedScreenRange([[0, 4], [4, 6]])
editor.addCursorAtScreenPosition([6, 8])
cursorNodes = node.querySelectorAll('.cursor')
expect(cursorNodes.length).toBe 1
expect(cursorNodes[0].offsetTop).toBe 6 * lineHeightInPixels
expect(cursorNodes[0].offsetLeft).toBe 8 * charWidth
describe "selection rendering", ->
scrollViewClientLeft = null
beforeEach ->
scrollViewClientLeft = node.querySelector('.scroll-view').getBoundingClientRect().left
it "renders 1 region for 1-line selections", ->
# 1-line selection
editor.setSelectedScreenRange([[1, 6], [1, 10]])
regions = node.querySelectorAll('.selection .region')
expect(regions.length).toBe 1
regionRect = regions[0].getBoundingClientRect()
expect(regionRect.top).toBe 1 * lineHeightInPixels
expect(regionRect.height).toBe 1 * lineHeightInPixels
expect(regionRect.left).toBe scrollViewClientLeft + 6 * charWidth
expect(regionRect.width).toBe 4 * charWidth
it "renders 2 regions for 2-line selections", ->
editor.setSelectedScreenRange([[1, 6], [2, 10]])
regions = node.querySelectorAll('.selection .region')
expect(regions.length).toBe 2
region1Rect = regions[0].getBoundingClientRect()
expect(region1Rect.top).toBe 1 * lineHeightInPixels
expect(region1Rect.height).toBe 1 * lineHeightInPixels
expect(region1Rect.left).toBe scrollViewClientLeft + 6 * charWidth
expect(Math.ceil(region1Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
region2Rect = regions[1].getBoundingClientRect()
expect(region2Rect.top).toBe 2 * lineHeightInPixels
expect(region2Rect.height).toBe 1 * lineHeightInPixels
expect(region2Rect.left).toBe scrollViewClientLeft + 0
expect(region2Rect.width).toBe 10 * charWidth
it "renders 3 regions for selections with more than 2 lines", ->
editor.setSelectedScreenRange([[1, 6], [5, 10]])
regions = node.querySelectorAll('.selection .region')
expect(regions.length).toBe 3
region1Rect = regions[0].getBoundingClientRect()
expect(region1Rect.top).toBe 1 * lineHeightInPixels
expect(region1Rect.height).toBe 1 * lineHeightInPixels
expect(region1Rect.left).toBe scrollViewClientLeft + 6 * charWidth
expect(Math.ceil(region1Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
region2Rect = regions[1].getBoundingClientRect()
expect(region2Rect.top).toBe 2 * lineHeightInPixels
expect(region2Rect.height).toBe 3 * lineHeightInPixels
expect(region2Rect.left).toBe scrollViewClientLeft + 0
expect(Math.ceil(region2Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
region3Rect = regions[2].getBoundingClientRect()
expect(region3Rect.top).toBe 5 * lineHeightInPixels
expect(region3Rect.height).toBe 1 * lineHeightInPixels
expect(region3Rect.left).toBe scrollViewClientLeft + 0
expect(region3Rect.width).toBe 10 * charWidth
it "does not render empty selections", ->
expect(editor.getSelection().isEmpty()).toBe true
expect(node.querySelectorAll('.selection').length).toBe 0
describe "mouse interactions", ->
linesNode = null
beforeEach ->
delayAnimationFrames = true
linesNode = node.querySelector('.lines')
describe "when a non-folded line is single-clicked", ->
describe "when no modifier keys are held down", ->
it "moves the cursor to the nearest screen position", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
editor.setScrollTop(3.5 * lineHeightInPixels)
editor.setScrollLeft(2 * charWidth)
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([4, 8])))
expect(editor.getCursorScreenPosition()).toEqual [4, 8]
describe "when the shift key is held down", ->
it "selects to the nearest screen position", ->
editor.setCursorScreenPosition([3, 4])
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([5, 6]), shiftKey: true))
expect(editor.getSelectedScreenRange()).toEqual [[3, 4], [5, 6]]
describe "when the command key is held down", ->
it "adds a cursor at the nearest screen position", ->
editor.setCursorScreenPosition([3, 4])
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([5, 6]), metaKey: true))
expect(editor.getSelectedScreenRanges()).toEqual [[[3, 4], [3, 4]], [[5, 6], [5, 6]]]
describe "when a non-folded line is double-clicked", ->
it "selects the word containing the nearest screen position", ->
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([5, 10]), detail: 2))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[5, 6], [5, 13]]
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([6, 6]), detail: 1))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[6, 6], [6, 6]]
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([8, 8]), detail: 1, shiftKey: true))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[6, 6], [8, 8]]
describe "when a non-folded line is triple-clicked", ->
it "selects the line containing the nearest screen position", ->
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([5, 10]), detail: 3))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[5, 0], [6, 0]]
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([6, 6]), detail: 1, shiftKey: true))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[5, 0], [7, 0]]
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([7, 5]), detail: 1))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([8, 8]), detail: 1, shiftKey: true))
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
expect(editor.getSelectedScreenRange()).toEqual [[7, 5], [8, 8]]
describe "when the mouse is clicked and dragged", ->
it "selects to the nearest screen position until the mouse button is released", ->
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([2, 4]), which: 1))
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([6, 8]), which: 1))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [6, 8]]
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([10, 0]), which: 1))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [10, 0]]
linesNode.dispatchEvent(buildMouseEvent('mouseup'))
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([12, 0]), which: 1))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [10, 0]]
it "stops selecting if the mouse is dragged into the dev tools", ->
linesNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenPosition([2, 4]), which: 1))
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([6, 8]), which: 1))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [6, 8]]
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([10, 0]), which: 0))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [6, 8]]
linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([8, 0]), which: 1))
nextAnimationFrame()
expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [6, 8]]
clientCoordinatesForScreenPosition = (screenPosition) ->
positionOffset = editor.pixelPositionForScreenPosition(screenPosition)
scrollViewClientRect = node.querySelector('.scroll-view').getBoundingClientRect()
clientX = scrollViewClientRect.left + positionOffset.left - editor.getScrollLeft()
clientY = scrollViewClientRect.top + positionOffset.top - editor.getScrollTop()
{clientX, clientY}
buildMouseEvent = (type, properties...) ->
properties = extend({bubbles: true, cancelable: true}, properties...)
event = new MouseEvent(type, properties)
Object.defineProperty(event, 'which', get: -> properties.which) if properties.which?
event
describe "focus handling", ->
inputNode = null
beforeEach ->
inputNode = node.querySelector('.hidden-input')
it "transfers focus to the hidden input", ->
expect(document.activeElement).toBe document.body
node.focus()
expect(document.activeElement).toBe inputNode
it "adds the 'is-focused' class to the editor when the hidden input is focused", ->
expect(document.activeElement).toBe document.body
inputNode.focus()
expect(node.classList.contains('is-focused')).toBe true
inputNode.blur()
expect(node.classList.contains('is-focused')).toBe false
describe "scrolling", ->
it "updates the vertical scrollbar when the scrollTop is changed in the model", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.scrollTop).toBe 0
editor.setScrollTop(10)
expect(verticalScrollbarNode.scrollTop).toBe 10
it "updates the horizontal scrollbar and scroll view content x transform based on the scrollLeft of the model", ->
node.style.width = 30 * charWidth + 'px'
component.measureHeightAndWidth()
scrollViewContentNode = node.querySelector('.scroll-view-content')
expect(scrollViewContentNode.style['-webkit-transform']).toBe "translate3d(0px, 0px, 0px)"
expect(horizontalScrollbarNode.scrollLeft).toBe 0
editor.setScrollLeft(100)
expect(scrollViewContentNode.style['-webkit-transform']).toBe "translate3d(-100px, 0px, 0px)"
expect(horizontalScrollbarNode.scrollLeft).toBe 100
it "updates the scrollLeft of the model when the scrollLeft of the horizontal scrollbar changes", ->
node.style.width = 30 * charWidth + 'px'
component.measureHeightAndWidth()
expect(editor.getScrollLeft()).toBe 0
horizontalScrollbarNode.scrollLeft = 100
horizontalScrollbarNode.dispatchEvent(new UIEvent('scroll'))
expect(editor.getScrollLeft()).toBe 100
it "does not obscure the last line with the horizontal scrollbar", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
editor.setScrollBottom(editor.getScrollHeight())
lastLineNode = last(node.querySelectorAll('.line'))
bottomOfLastLine = lastLineNode.getBoundingClientRect().bottom
topOfHorizontalScrollbar = horizontalScrollbarNode.getBoundingClientRect().top
expect(bottomOfLastLine).toBe topOfHorizontalScrollbar
# Scroll so there's no space below the last line when the horizontal scrollbar disappears
node.style.width = 100 * charWidth + 'px'
component.measureHeightAndWidth()
lastLineNode = last(node.querySelectorAll('.line'))
bottomOfLastLine = lastLineNode.getBoundingClientRect().bottom
bottomOfEditor = node.getBoundingClientRect().bottom
expect(bottomOfLastLine).toBe bottomOfEditor
it "does not obscure the last character of the longest line with the vertical scrollbar", ->
node.style.height = 7 * lineHeightInPixels + 'px'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
editor.setScrollLeft(Infinity)
lineNodes = node.querySelectorAll('.line')
rightOfLongestLine = lineNodes[6].getBoundingClientRect().right
leftOfVerticalScrollbar = verticalScrollbarNode.getBoundingClientRect().left
expect(rightOfLongestLine).toBe leftOfVerticalScrollbar - 1 # Leave 1 px so the cursor is visible on the end of the line
it "only displays dummy scrollbars when scrollable in that direction", ->
expect(verticalScrollbarNode.style.display).toBe 'none'
expect(horizontalScrollbarNode.style.display).toBe 'none'
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = '1000px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.display).toBe ''
expect(horizontalScrollbarNode.style.display).toBe 'none'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.display).toBe ''
expect(horizontalScrollbarNode.style.display).toBe ''
node.style.height = 20 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.display).toBe 'none'
expect(horizontalScrollbarNode.style.display).toBe ''
it "makes the dummy scrollbar divs only as tall/wide as the actual scrollbars", ->
node.style.height = 4 * lineHeightInPixels + 'px'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
atom.themes.applyStylesheet "test", """
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
"""
scrollbarCornerNode = node.querySelector('.scrollbar-corner')
expect(verticalScrollbarNode.offsetWidth).toBe 8
expect(horizontalScrollbarNode.offsetHeight).toBe 8
expect(scrollbarCornerNode.offsetWidth).toBe 8
expect(scrollbarCornerNode.offsetHeight).toBe 8
it "assigns the bottom/right of the scrollbars to the width of the opposite scrollbar if it is visible", ->
scrollbarCornerNode = node.querySelector('.scrollbar-corner')
expect(verticalScrollbarNode.style.bottom).toBe ''
expect(horizontalScrollbarNode.style.right).toBe ''
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = '1000px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.bottom).toBe ''
expect(horizontalScrollbarNode.style.right).toBe verticalScrollbarNode.offsetWidth + 'px'
expect(scrollbarCornerNode.style.display).toBe 'none'
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.bottom).toBe horizontalScrollbarNode.offsetHeight + 'px'
expect(horizontalScrollbarNode.style.right).toBe verticalScrollbarNode.offsetWidth + 'px'
expect(scrollbarCornerNode.style.display).toBe ''
node.style.height = 20 * lineHeightInPixels + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.style.bottom).toBe horizontalScrollbarNode.offsetHeight + 'px'
expect(horizontalScrollbarNode.style.right).toBe ''
expect(scrollbarCornerNode.style.display).toBe 'none'
it "accounts for the width of the gutter in the scrollWidth of the horizontal scrollbar", ->
gutterNode = node.querySelector('.gutter')
node.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
expect(horizontalScrollbarNode.scrollWidth).toBe gutterNode.offsetWidth + editor.getScrollWidth()
describe "when a mousewheel event occurs on the editor", ->
it "updates the horizontal or vertical scrollbar depending on which delta is greater (x or y)", ->
node.style.height = 4.5 * lineHeightInPixels + 'px'
node.style.width = 20 * charWidth + 'px'
component.measureHeightAndWidth()
expect(verticalScrollbarNode.scrollTop).toBe 0
expect(horizontalScrollbarNode.scrollLeft).toBe 0
node.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: -5, wheelDeltaY: -10))
expect(verticalScrollbarNode.scrollTop).toBe 10
expect(horizontalScrollbarNode.scrollLeft).toBe 0
node.dispatchEvent(new WheelEvent('mousewheel', wheelDeltaX: -15, wheelDeltaY: -5))
expect(verticalScrollbarNode.scrollTop).toBe 10
expect(horizontalScrollbarNode.scrollLeft).toBe 15
describe "input events", ->
inputNode = null
beforeEach ->
inputNode = node.querySelector('.hidden-input')
it "inserts the newest character in the input's value into the buffer", ->
inputNode.value = 'x'
inputNode.dispatchEvent(new Event('input'))
expect(editor.lineForBufferRow(0)).toBe 'xvar quicksort = function () {'
inputNode.value = 'xy'
inputNode.dispatchEvent(new Event('input'))
expect(editor.lineForBufferRow(0)).toBe 'xyvar quicksort = function () {'
it "replaces the last character if the length of the input's value doesn't increase, as occurs with the accented character menu", ->
inputNode.value = 'u'
inputNode.dispatchEvent(new Event('input'))
expect(editor.lineForBufferRow(0)).toBe 'uvar quicksort = function () {'
inputNode.value = 'ü'
inputNode.dispatchEvent(new Event('input'))
expect(editor.lineForBufferRow(0)).toBe 'üvar quicksort = function () {'
describe "commands", ->
describe "editor:consolidate-selections", ->
it "consolidates selections on the editor model, aborting the key binding if there is only one selection", ->
spyOn(editor, 'consolidateSelections').andCallThrough()
event = new CustomEvent('editor:consolidate-selections', bubbles: true, cancelable: true)
event.abortKeyBinding = jasmine.createSpy("event.abortKeyBinding")
node.dispatchEvent(event)
expect(editor.consolidateSelections).toHaveBeenCalled()
expect(event.abortKeyBinding).toHaveBeenCalled()
+2727 -2401
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+288 -221
Ver Arquivo
@@ -7,22 +7,30 @@ path = require 'path'
temp = require 'temp'
describe "EditorView", ->
[buffer, editorView, editor, cachedLineHeight, cachedCharWidth] = []
[buffer, editorView, editor, cachedEditor, cachedLineHeight, cachedCharWidth, fart] = []
beforeEach ->
editor = atom.project.openSync('sample.js')
buffer = editor.buffer
editorView = new EditorView(editor)
editorView.lineOverdraw = 2
editorView.isFocused = true
editorView.enableKeymap()
editorView.calculateHeightInLines = ->
Math.ceil(@height() / @lineHeight)
editorView.attachToDom = ({ heightInLines, widthInChars } = {}) ->
heightInLines ?= @getEditor().getBuffer().getLineCount()
@height(getLineHeight() * heightInLines)
@width(getCharWidth() * widthInChars) if widthInChars
$('#jasmine-content').append(this)
waitsForPromise ->
atom.workspace.open('sample.js').then (o) -> editor = o
waitsForPromise ->
atom.workspace.open('sample.less').then (o) -> cachedEditor = o
runs ->
buffer = editor.buffer
editorView = new EditorView(editor)
editorView.lineOverdraw = 2
editorView.isFocused = true
editorView.enableKeymap()
editorView.calculateHeightInLines = ->
Math.ceil(@height() / @lineHeight)
editorView.attachToDom = ({ heightInLines, widthInChars } = {}) ->
heightInLines ?= @getEditor().getBuffer().getLineCount()
@height(getLineHeight() * heightInLines)
@width(getCharWidth() * widthInChars) if widthInChars
$('#jasmine-content').append(this)
waitsForPromise ->
atom.packages.activatePackage('language-text', sync: true)
@@ -41,7 +49,7 @@ describe "EditorView", ->
cachedCharWidth
calcDimensions = ->
editorForMeasurement = new EditorView(editor: atom.project.openSync('sample.js'))
editorForMeasurement = new EditorView({editor: cachedEditor})
editorForMeasurement.attachToDom()
cachedLineHeight = editorForMeasurement.lineHeight
cachedCharWidth = editorForMeasurement.charWidth
@@ -105,18 +113,23 @@ describe "EditorView", ->
describe "when the editor's file is modified on disk", ->
it "triggers an alert", ->
fileChangeHandler = null
filePath = path.join(temp.dir, 'atom-changed-file.txt')
fs.writeFileSync(filePath, "")
editor = atom.project.openSync(filePath)
editorView.edit(editor)
editor.insertText("now the buffer is modified")
fileChangeHandler = jasmine.createSpy('fileChange')
editor.buffer.file.on 'contents-changed', fileChangeHandler
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> editor = o
spyOn(atom, "confirm")
runs ->
editorView.edit(editor)
editor.insertText("now the buffer is modified")
fs.writeFileSync(filePath, "a file change")
fileChangeHandler = jasmine.createSpy('fileChange')
editor.buffer.file.on 'contents-changed', fileChangeHandler
spyOn(atom, "confirm")
fs.writeFileSync(filePath, "a file change")
waitsFor "file to trigger contents-changed event", ->
fileChangeHandler.callCount > 0
@@ -133,8 +146,11 @@ describe "EditorView", ->
[newEditor, newBuffer] = []
beforeEach ->
newEditor = atom.project.openSync('two-hundred.txt')
newBuffer = newEditor.buffer
waitsForPromise ->
atom.workspace.open('two-hundred.txt').then (o) -> newEditor = o
runs ->
newBuffer = newEditor.buffer
it "updates the rendered lines, cursors, selections, scroll position, and event subscriptions to match the given edit session", ->
editorView.attachToDom(heightInLines: 5, widthInChars: 30)
@@ -170,17 +186,24 @@ describe "EditorView", ->
expect(editorView.lineElementForScreenRow(6).text()).toMatch /^ currentgoodbye/
it "triggers alert if edit session's buffer goes into conflict with changes on disk", ->
contentsConflictedHandler = null
filePath = path.join(temp.dir, 'atom-changed-file.txt')
fs.writeFileSync(filePath, "")
tempEditor = atom.project.openSync(filePath)
editorView.edit(tempEditor)
tempEditor.insertText("a buffer change")
tempEditor = null
spyOn(atom, "confirm")
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> tempEditor = o
runs ->
editorView.edit(tempEditor)
tempEditor.insertText("a buffer change")
spyOn(atom, "confirm")
contentsConflictedHandler = jasmine.createSpy("contentsConflictedHandler")
tempEditor.on 'contents-conflicted', contentsConflictedHandler
fs.writeFileSync(filePath, "a file change")
contentsConflictedHandler = jasmine.createSpy("contentsConflictedHandler")
tempEditor.on 'contents-conflicted', contentsConflictedHandler
fs.writeFileSync(filePath, "a file change")
waitsFor ->
contentsConflictedHandler.callCount > 0
@@ -281,26 +304,34 @@ describe "EditorView", ->
it "emits event when editor view view receives a new buffer", ->
eventHandler = jasmine.createSpy('eventHandler')
editorView.on 'editor:path-changed', eventHandler
editorView.edit(atom.project.openSync(filePath))
expect(eventHandler).toHaveBeenCalled()
waitsForPromise ->
atom.workspace.open(filePath).then (editor) ->
editorView.edit(editor)
runs ->
expect(eventHandler).toHaveBeenCalled()
it "stops listening to events on previously set buffers", ->
eventHandler = jasmine.createSpy('eventHandler')
oldBuffer = editor.getBuffer()
newEditor = atom.project.openSync(filePath)
editorView.on 'editor:path-changed', eventHandler
newEditor = null
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> newEditor = o
editorView.edit(newEditor)
expect(eventHandler).toHaveBeenCalled()
runs ->
editorView.on 'editor:path-changed', eventHandler
eventHandler.reset()
oldBuffer.saveAs(path.join(temp.dir, 'atom-bad.txt'))
expect(eventHandler).not.toHaveBeenCalled()
editorView.edit(newEditor)
expect(eventHandler).toHaveBeenCalled()
eventHandler.reset()
newEditor.getBuffer().saveAs(path.join(temp.dir, 'atom-new.txt'))
expect(eventHandler).toHaveBeenCalled()
eventHandler.reset()
oldBuffer.saveAs(path.join(temp.dir, 'atom-bad.txt'))
expect(eventHandler).not.toHaveBeenCalled()
eventHandler.reset()
newEditor.getBuffer().saveAs(path.join(temp.dir, 'atom-new.txt'))
expect(eventHandler).toHaveBeenCalled()
it "loads the grammar for the new path", ->
expect(editor.getGrammar().name).toBe 'JavaScript'
@@ -432,9 +463,9 @@ describe "EditorView", ->
editorView.setFontFamily('sans-serif')
it "positions the cursor to the clicked row and column", ->
{top, left} = editorView.pixelOffsetForScreenPosition([3, 30])
editorView.renderedLines.trigger mousedownEvent(pageX: left, pageY: top)
expect(editor.getCursorScreenPosition()).toEqual [3, 30]
{top, left} = editorView.pixelOffsetForScreenPosition([3, 30])
editorView.renderedLines.trigger mousedownEvent(pageX: left, pageY: top)
expect(editor.getCursorScreenPosition()).toEqual [3, 30]
describe "double-click", ->
it "selects the word under the cursor, and expands the selection wordwise in either direction on a subsequent shift-click", ->
@@ -464,7 +495,21 @@ describe "EditorView", ->
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [3, 12], originalEvent: {detail: 1}, shiftKey: true)
expect(editor.getSelectedBufferRange()).toEqual [[3, 10], [3, 12]]
describe "when clicking between a word and a non-word", ->
it "stops selecting by word when another selection is made", ->
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 1})
editorView.renderedLines.trigger 'mouseup'
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 2})
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedText()).toBe "quicksort"
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [3, 10])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [3, 12], which: 1)
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedBufferRange()).toEqual [[3, 10], [3, 12]]
describe "when double-clicking between a word and a non-word", ->
it "selects the word", ->
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 21], originalEvent: {detail: 1})
@@ -487,6 +532,30 @@ describe "EditorView", ->
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedText()).toBe "{"
describe "when double-clicking on whitespace", ->
it "selects all adjacent whitespace", ->
editor.setText(" some text ")
editor.setCursorBufferPosition([0, 2])
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 2], originalEvent: {detail: 1})
editorView.renderedLines.trigger 'mouseup'
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 2], originalEvent: {detail: 2})
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedBufferRange()).toEqual [[0, 0], [0, 3]]
editor.setCursorBufferPosition([0, 8])
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 1})
editorView.renderedLines.trigger 'mouseup'
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 2})
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedBufferRange()).toEqual [[0, 7], [0, 9]]
editor.setCursorBufferPosition([0, 14])
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 14], originalEvent: {detail: 1})
editorView.renderedLines.trigger 'mouseup'
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 14], originalEvent: {detail: 2})
editorView.renderedLines.trigger 'mouseup'
expect(editor.getSelectedBufferRange()).toEqual [[0, 13], [0, 17]]
describe "triple/quardruple/etc-click", ->
it "selects the line under the cursor", ->
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
@@ -587,7 +656,7 @@ describe "EditorView", ->
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [4, 10])
# moving changes selection
$(document).trigger mousemoveEvent(editorView: editorView, point: [5, 27])
$(document).trigger mousemoveEvent(editorView: editorView, point: [5, 27], which: 1)
range = editor.getSelection().getScreenRange()
expect(range.start).toEqual({row: 4, column: 10})
@@ -617,12 +686,12 @@ describe "EditorView", ->
originalScrollTop = editorView.scrollTop()
# moving changes selection
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 0, pageY: -1)
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 0, pageY: -1, which: 1)
expect(editorView.scrollTop()).toBe originalScrollTop - editorView.lineHeight
# every mouse move selects more text
for x in [0..10]
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 0, pageY: -1)
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 0, pageY: -1, which: 1)
expect(editorView.scrollTop()).toBe 0
@@ -633,7 +702,7 @@ describe "EditorView", ->
event = mousedownEvent(editorView: editorView, point: [4, 10])
event.originalEvent.which = 2
editorView.renderedLines.trigger(event)
$(document).trigger mousemoveEvent(editorView: editorView, point: [5, 27])
$(document).trigger mousemoveEvent(editorView: editorView, point: [5, 27], which: 1)
$(document).trigger 'mouseup'
range = editor.getSelection().getScreenRange()
@@ -654,6 +723,25 @@ describe "EditorView", ->
expect(range.start).toEqual({row: 4, column: 10})
expect(range.end).toEqual({row: 4, column: 10})
describe "when the editor is hidden", ->
it "stops scrolling the editor", ->
editorView.vScrollMargin = 0
editorView.attachToDom(heightInLines: 5)
editorView.scrollToBottom()
spyOn(window, 'setInterval').andCallFake ->
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [12, 0])
originalScrollTop = editorView.scrollTop()
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 0, pageY: -1, which: 1)
expect(editorView.scrollTop()).toBe originalScrollTop - editorView.lineHeight
editorView.hide()
$(document).trigger mousemoveEvent(editorView: editorView, pageX: 100000, pageY: -1, which: 1)
expect(editorView.scrollTop()).toBe originalScrollTop - editorView.lineHeight
describe "double-click and drag", ->
it "selects the word under the cursor, then continues to select by word in either direction as the mouse is dragged", ->
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
@@ -662,11 +750,11 @@ describe "EditorView", ->
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 2})
expect(editor.getSelectedText()).toBe "quicksort"
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [1, 8])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [1, 8], which: 1)
expect(editor.getSelectedBufferRange()).toEqual [[0, 4], [1, 10]]
expect(editor.getCursorBufferPosition()).toEqual [1, 10]
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [0, 1])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [0, 1], which: 1)
expect(editor.getSelectedBufferRange()).toEqual [[0, 0], [0, 13]]
expect(editor.getCursorBufferPosition()).toEqual [0, 0]
@@ -691,12 +779,12 @@ describe "EditorView", ->
expect(editor.getSelectedBufferRange()).toEqual [[4, 0], [5, 0]]
# moving changes selection linewise
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [5, 27])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [5, 27], which: 1)
expect(editor.getSelectedBufferRange()).toEqual [[4, 0], [6, 0]]
expect(editor.getCursorBufferPosition()).toEqual [6, 0]
# moving changes selection linewise
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [2, 27])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [2, 27], which: 1)
expect(editor.getSelectedBufferRange()).toEqual [[2, 0], [5, 0]]
expect(editor.getCursorBufferPosition()).toEqual [2, 0]
@@ -706,11 +794,11 @@ describe "EditorView", ->
describe "meta-click and drag", ->
it "adds an additional selection", ->
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [4, 10])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [5, 27])
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [5, 27], which: 1)
editorView.renderedLines.trigger 'mouseup'
editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [6, 10], metaKey: true)
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [8, 27], metaKey: true)
editorView.renderedLines.trigger mousemoveEvent(editorView: editorView, point: [8, 27], metaKey: true, which: 1)
editorView.renderedLines.trigger 'mouseup'
selections = editor.getSelections()
@@ -1352,7 +1440,7 @@ describe "EditorView", ->
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
buffer.change([[1,0], [3,0]], "1\n2\n3\n")
buffer.setTextInRange([[1,0], [3,0]], "1\n2\n3\n")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
@@ -1365,21 +1453,21 @@ describe "EditorView", ->
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
buffer.change([[2,0], [7,0]], "2\n3\n4\n5\n6\n7\n8\n9\n")
buffer.setTextInRange([[2,0], [7,0]], "2\n3\n4\n5\n6\n7\n8\n9\n")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
describe "when the change straddles the last rendered row", ->
it "doesn't render rows that were not previously rendered", ->
buffer.change([[2,0], [7,0]], "2\n3\n4\n5\n6\n7\n8\n")
buffer.setTextInRange([[2,0], [7,0]], "2\n3\n4\n5\n6\n7\n8\n")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(0)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(6)
describe "when the change the follows the last rendered row", ->
it "does not change the rendered lines", ->
buffer.change([[12,0], [12,0]], "12\n13\n14\n")
buffer.setTextInRange([[12,0], [12,0]], "12\n13\n14\n")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(0)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(6)
@@ -1389,7 +1477,7 @@ describe "EditorView", ->
setEditorWidthInChars(editorView, maxLineLength)
widthBefore = editorView.renderedLines.width()
expect(widthBefore).toBe editorView.scrollView.width() + 20
buffer.change([[12,0], [12,0]], [1..maxLineLength*2].join(''))
buffer.setTextInRange([[12,0], [12,0]], [1..maxLineLength*2].join(''))
expect(editorView.renderedLines.width()).toBeGreaterThan widthBefore
describe "when lines are removed", ->
@@ -1399,7 +1487,7 @@ describe "EditorView", ->
it "sets the rendered screen line's width to either the max line length or the scollView's width (whichever is greater)", ->
maxLineLength = editor.getMaxScreenLineLength()
setEditorWidthInChars(editorView, maxLineLength)
buffer.change([[12,0], [12,0]], [1..maxLineLength*2].join(''))
buffer.setTextInRange([[12,0], [12,0]], [1..maxLineLength*2].join(''))
expect(editorView.renderedLines.width()).toBeGreaterThan editorView.scrollView.width()
widthBefore = editorView.renderedLines.width()
buffer.delete([[12, 0], [12, Infinity]])
@@ -1412,7 +1500,7 @@ describe "EditorView", ->
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
buffer.change([[1,0], [2,0]], "")
buffer.setTextInRange([[1,0], [2,0]], "")
expect(editorView.renderedLines.find(".line").length).toBe 6
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(11)
@@ -1424,21 +1512,21 @@ describe "EditorView", ->
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(12)
buffer.change([[7,0], [11,0]], "1\n2\n")
buffer.setTextInRange([[7,0], [11,0]], "1\n2\n")
expect(editorView.renderedLines.find(".line").length).toBe 5
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(6)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(10)
describe "when the change straddles the last rendered row", ->
it "renders the correct rows", ->
buffer.change([[2,0], [7,0]], "")
buffer.setTextInRange([[2,0], [7,0]], "")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(0)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(6)
describe "when the change the follows the last rendered row", ->
it "does not change the rendered lines", ->
buffer.change([[10,0], [12,0]], "")
buffer.setTextInRange([[10,0], [12,0]], "")
expect(editorView.renderedLines.find(".line").length).toBe 7
expect(editorView.renderedLines.find(".line:first").text()).toBe buffer.lineForRow(0)
expect(editorView.renderedLines.find(".line:last").text()).toBe buffer.lineForRow(6)
@@ -1496,14 +1584,18 @@ describe "EditorView", ->
describe "when autoscrolling at the end of the document", ->
it "renders lines properly", ->
editorView.edit(atom.project.openSync('two-hundred.txt'))
editorView.attachToDom(heightInLines: 5.5)
waitsForPromise ->
atom.workspace.open('two-hundred.txt').then (editor) ->
editorView.edit(editor)
expect(editorView.renderedLines.find('.line').length).toBe 8
runs ->
editorView.attachToDom(heightInLines: 5.5)
editor.moveCursorToBottom()
expect(editorView.renderedLines.find('.line').length).toBe 8
expect(editorView.renderedLines.find('.line').length).toBe 8
editor.moveCursorToBottom()
expect(editorView.renderedLines.find('.line').length).toBe 8
describe "when line has a character that could push it to be too tall (regression)", ->
it "does renders the line at a consistent height", ->
@@ -1563,7 +1655,7 @@ describe "EditorView", ->
editor.setSoftWrap(true)
it "doesn't show the end of line invisible at the end of lines broken due to wrapping", ->
editor.setText "a line that wraps"
editor.setText "a line that wraps "
editorView.attachToDom()
editorView.setWidthInChars(6)
atom.config.set "editor.showInvisibles", true
@@ -1571,11 +1663,11 @@ describe "EditorView", ->
expect(space).toBeTruthy()
eol = editorView.invisibles?.eol
expect(eol).toBeTruthy()
expect(editorView.renderedLines.find('.line:first').text()).toBe "a line#{space}"
expect(editorView.renderedLines.find('.line:last').text()).toBe "wraps#{eol}"
expect(editorView.renderedLines.find('.line:first').text()).toBe "a line "
expect(editorView.renderedLines.find('.line:last').text()).toBe "wraps#{space}#{eol}"
it "displays trailing carriage return using a visible non-empty value", ->
editor.setText "a line that\r\n"
editor.setText "a line that \r\n"
editorView.attachToDom()
editorView.setWidthInChars(6)
atom.config.set "editor.showInvisibles", true
@@ -1585,8 +1677,8 @@ describe "EditorView", ->
expect(cr).toBeTruthy()
eol = editorView.invisibles?.eol
expect(eol).toBeTruthy()
expect(editorView.renderedLines.find('.line:first').text()).toBe "a line#{space}"
expect(editorView.renderedLines.find('.line:eq(1)').text()).toBe "that#{cr}#{eol}"
expect(editorView.renderedLines.find('.line:first').text()).toBe "a line "
expect(editorView.renderedLines.find('.line:eq(1)').text()).toBe "that#{space}#{cr}#{eol}"
expect(editorView.renderedLines.find('.line:last').text()).toBe "#{eol}"
describe "when editor.showIndentGuide is set to true", ->
@@ -1751,10 +1843,14 @@ describe "EditorView", ->
expect(editor.bufferPositionForScreenPosition(editor.getCursorScreenPosition())).toEqual [3, 60]
it "does not wrap the lines of any newly assigned buffers", ->
otherEditor = atom.project.openSync()
otherEditor.buffer.setText([1..100].join(''))
editorView.edit(otherEditor)
expect(editorView.renderedLines.find('.line').length).toBe(1)
otherEditor = null
waitsForPromise ->
atom.workspace.open().then (o) -> otherEditor = o
runs ->
otherEditor.buffer.setText([1..100].join(''))
editorView.edit(otherEditor)
expect(editorView.renderedLines.find('.line').length).toBe(1)
it "unwraps lines when softwrap is disabled", ->
editorView.toggleSoftWrap()
@@ -1783,15 +1879,15 @@ describe "EditorView", ->
expect(editor.getCursorScreenPosition()).toEqual [11, 0]
it "calls .setWidthInChars() when the editor view is attached because now its dimensions are available to calculate it", ->
otherEditor = new EditorView(editor: atom.project.openSync('sample.js'))
spyOn(otherEditor, 'setWidthInChars')
otherEditorView = new EditorView(editor)
spyOn(otherEditorView, 'setWidthInChars')
otherEditor.editor.setSoftWrap(true)
expect(otherEditor.setWidthInChars).not.toHaveBeenCalled()
otherEditorView.editor.setSoftWrap(true)
expect(otherEditorView.setWidthInChars).not.toHaveBeenCalled()
otherEditor.simulateDomAttachment()
expect(otherEditor.setWidthInChars).toHaveBeenCalled()
otherEditor.remove()
otherEditorView.simulateDomAttachment()
expect(otherEditorView.setWidthInChars).toHaveBeenCalled()
otherEditorView.remove()
describe "when the editor view's width changes", ->
it "updates the width in characters on the edit session", ->
@@ -1806,6 +1902,17 @@ describe "EditorView", ->
runs ->
expect(editor.getSoftWrapColumn()).toBeLessThan previousSoftWrapColumn
it "accounts for the width of the scrollbar if there is one", ->
# force the scrollbar to always be visible, regardless of OS visibility setting
$('#jasmine-content').prepend """
<style>
::-webkit-scrollbar { width: 15px; }
</style>
"""
setEditorHeightInLines(editorView, 5)
setEditorWidthInChars(editorView, 40)
expect(editor.lineForScreenRow(2).text.length).toBe 34
describe "gutter rendering", ->
beforeEach ->
editorView.attachToDom(heightInLines: 5.5)
@@ -1931,15 +2038,19 @@ describe "EditorView", ->
describe "when the switching from an edit session for a long buffer to an edit session for a short buffer", ->
it "updates the line numbers to reflect the shorter buffer", ->
emptyEditor = atom.project.openSync(null)
editorView.edit(emptyEditor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBe 1
emptyEditor = null
waitsForPromise ->
atom.workspace.open().then (o) -> emptyEditor = o
editorView.edit(editor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBeGreaterThan 1
runs ->
editorView.edit(emptyEditor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBe 1
editorView.edit(emptyEditor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBe 1
editorView.edit(editor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBeGreaterThan 1
editorView.edit(emptyEditor)
expect(editorView.gutter.lineNumbers.find('.line-number').length).toBe 1
describe "when the editor view is mini", ->
it "hides the gutter", ->
@@ -2159,10 +2270,13 @@ describe "EditorView", ->
describe "folding", ->
beforeEach ->
editor = atom.project.openSync('two-hundred.txt')
buffer = editor.buffer
editorView.edit(editor)
editorView.attachToDom()
waitsForPromise ->
atom.workspace.open('two-hundred.txt').then (o) -> editor = o
runs ->
buffer = editor.buffer
editorView.edit(editor)
editorView.attachToDom()
describe "when a fold-selection event is triggered", ->
it "folds the lines covered by the selection into a single line with a fold class and marker", ->
@@ -2216,7 +2330,7 @@ describe "EditorView", ->
it "adds/removes the 'fold-selected' class to the fold's line element and hides the cursor if it is on the fold line", ->
editor.createFold(2, 4)
editor.setSelectedBufferRange([[1, 0], [2, 0]], preserveFolds: true, isReversed: true)
editor.setSelectedBufferRange([[1, 0], [2, 0]], preserveFolds: true, reversed: true)
expect(editorView.lineElementForScreenRow(2)).toMatchSelector('.fold.fold-selected')
editor.setSelectedBufferRange([[1, 0], [1, 1]], preserveFolds: true)
@@ -2297,8 +2411,11 @@ describe "EditorView", ->
beforeEach ->
filePath = atom.project.resolve('git/working-dir/file.txt')
originalPathText = fs.readFileSync(filePath, 'utf8')
editor = atom.project.openSync(filePath)
editorView.edit(editor)
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> editor = o
runs ->
editorView.edit(editor)
afterEach ->
fs.writeFileSync(filePath, originalPathText)
@@ -2419,51 +2536,11 @@ describe "EditorView", ->
editorView.underlayer.trigger event
expect(editor.getSelection().getScreenRange()).toEqual [[0,0], [12,2]]
# TODO: Move to editor-spec
describe ".reloadGrammar()", ->
[filePath] = []
beforeEach ->
tmpdir = fs.absolute(temp.dir)
filePath = path.join(tmpdir, "grammar-change.txt")
fs.writeFileSync(filePath, "var i;")
afterEach ->
fs.removeSync(filePath) if fs.existsSync(filePath)
it "updates all the rendered lines when the grammar changes", ->
editor = atom.project.openSync(filePath)
editorView.edit(editor)
expect(editor.getGrammar().name).toBe 'Plain Text'
atom.syntax.setGrammarOverrideForPath(filePath, 'source.js')
editor.reloadGrammar()
expect(editor.getGrammar().name).toBe 'JavaScript'
tokenizedBuffer = editorView.editor.displayBuffer.tokenizedBuffer
line0 = tokenizedBuffer.lineForScreenRow(0)
expect(line0.tokens.length).toBe 3
expect(line0.tokens[0]).toEqual(value: 'var', scopes: ['source.js', 'storage.modifier.js'])
it "doesn't update the rendered lines when the grammar doesn't change", ->
expect(editor.getGrammar().name).toBe 'JavaScript'
spyOn(editorView, 'updateDisplay').andCallThrough()
editor.reloadGrammar()
expect(editor.reloadGrammar()).toBeFalsy()
expect(editorView.updateDisplay).not.toHaveBeenCalled()
expect(editor.getGrammar().name).toBe 'JavaScript'
it "emits an editor:grammar-changed event when updated", ->
editor = atom.project.openSync(filePath)
editorView.edit(editor)
describe "when the editor's grammar is changed", ->
it "emits an editor:grammar-changed event", ->
eventHandler = jasmine.createSpy('eventHandler')
editorView.on('editor:grammar-changed', eventHandler)
editor.reloadGrammar()
expect(eventHandler).not.toHaveBeenCalled()
atom.syntax.setGrammarOverrideForPath(filePath, 'source.js')
editor.reloadGrammar()
editor.setGrammar(atom.syntax.selectGrammar('.coffee'))
expect(eventHandler).toHaveBeenCalled()
describe ".replaceSelectedText()", ->
@@ -2810,64 +2887,9 @@ describe "EditorView", ->
expect(buffer.lineForRow(1)).toBe ' if (items.length <= 1) return items;'
expect(buffer.lineForRow(2)).toBe ' var sort = function(items) {'
describe "when editor:duplicate-line is triggered", ->
describe "where there is no selection", ->
describe "when the cursor isn't on a folded line", ->
it "duplicates the current line below and moves the cursor down one row", ->
editor.setCursorBufferPosition([0, 5])
editorView.trigger 'editor:duplicate-line'
expect(buffer.lineForRow(0)).toBe 'var quicksort = function () {'
expect(buffer.lineForRow(1)).toBe 'var quicksort = function () {'
expect(editor.getCursorBufferPosition()).toEqual [1, 5]
describe "when the cursor is on a folded line", ->
it "duplicates the entire fold before and moves the cursor to the new fold", ->
editor.setCursorBufferPosition([4])
editor.foldCurrentRow()
editorView.trigger 'editor:duplicate-line'
expect(editor.getCursorScreenPosition()).toEqual [5]
expect(editor.isFoldedAtScreenRow(4)).toBeTruthy()
expect(editor.isFoldedAtScreenRow(5)).toBeTruthy()
expect(buffer.lineForRow(8)).toBe ' while(items.length > 0) {'
expect(buffer.lineForRow(9)).toBe ' current = items.shift();'
expect(buffer.lineForRow(10)).toBe ' current < pivot ? left.push(current) : right.push(current);'
expect(buffer.lineForRow(11)).toBe ' }'
describe "when the cursor is on the last line and it doesn't have a trailing newline", ->
it "inserts a newline and the duplicated line", ->
editor.moveCursorToBottom()
editorView.trigger 'editor:duplicate-line'
expect(buffer.lineForRow(12)).toBe '};'
expect(buffer.lineForRow(13)).toBe '};'
expect(buffer.lineForRow(14)).toBeUndefined()
expect(editor.getCursorBufferPosition()).toEqual [13, 2]
describe "when the cursor in on the last line and it is only a newline", ->
it "duplicates the current line below and moves the cursor down one row", ->
editor.moveCursorToBottom()
editor.insertNewline()
editor.moveCursorToBottom()
editorView.trigger 'editor:duplicate-line'
expect(buffer.lineForRow(13)).toBe ''
expect(buffer.lineForRow(14)).toBe ''
expect(buffer.lineForRow(15)).toBeUndefined()
expect(editor.getCursorBufferPosition()).toEqual [14, 0]
describe "when the cursor is on the second to last line and the last line only a newline", ->
it "duplicates the current line below and moves the cursor down one row", ->
editor.moveCursorToBottom()
editor.insertNewline()
editor.setCursorBufferPosition([12])
editorView.trigger 'editor:duplicate-line'
expect(buffer.lineForRow(12)).toBe '};'
expect(buffer.lineForRow(13)).toBe '};'
expect(buffer.lineForRow(14)).toBe ''
expect(buffer.lineForRow(15)).toBeUndefined()
expect(editor.getCursorBufferPosition()).toEqual [13, 0]
describe "when the escape key is pressed on the editor view", ->
it "clears multiple selections if there are any, and otherwise allows other bindings to be handled", ->
atom.keymap.bindKeys 'name', '.editor', {'escape': 'test-event'}
atom.keymaps.add 'name', '.editor': {'escape': 'test-event'}
testEventHandler = jasmine.createSpy("testEventHandler")
editorView.on 'test-event', testEventHandler
@@ -2884,22 +2906,26 @@ describe "EditorView", ->
describe "when the editor view is attached but invisible", ->
describe "when the editor view's text is changed", ->
it "redraws the editor view when it is next shown", ->
displayUpdatedHandler = null
atom.workspaceView = new WorkspaceView
atom.workspaceView.openSync('sample.js')
atom.workspaceView.attachToDom()
editorView = atom.workspaceView.getActiveView()
waitsForPromise ->
atom.workspaceView.open('sample.txt').then (o) -> editor = o
view = $$ -> @div id: 'view', tabindex: -1, 'View'
editorView.getPane().activateItem(view)
expect(editorView.isVisible()).toBeFalsy()
runs ->
atom.workspaceView.attachToDom()
editorView = atom.workspaceView.getActiveView()
editor.setText('hidden changes')
editor.setCursorBufferPosition([0,4])
view = $$ -> @div id: 'view', tabindex: -1, 'View'
editorView.getPane().activateItem(view)
expect(editorView.isVisible()).toBeFalsy()
displayUpdatedHandler = jasmine.createSpy("displayUpdatedHandler")
editorView.on 'editor:display-updated', displayUpdatedHandler
editorView.getPane().activateItem(editorView.getModel())
expect(editorView.isVisible()).toBeTruthy()
editor.setText('hidden changes')
editor.setCursorBufferPosition([0,4])
displayUpdatedHandler = jasmine.createSpy("displayUpdatedHandler")
editorView.on 'editor:display-updated', displayUpdatedHandler
editorView.getPane().activateItem(editorView.getModel())
expect(editorView.isVisible()).toBeTruthy()
waitsFor ->
displayUpdatedHandler.callCount is 1
@@ -2939,14 +2965,17 @@ describe "EditorView", ->
describe "when the editor view is removed", ->
it "fires a editor:will-be-removed event", ->
atom.workspaceView = new WorkspaceView
atom.workspaceView.openSync('sample.js')
atom.workspaceView.attachToDom()
editorView = atom.workspaceView.getActiveView()
waitsForPromise ->
atom.workspace.open('sample.js')
willBeRemovedHandler = jasmine.createSpy('willBeRemovedHandler')
editorView.on 'editor:will-be-removed', willBeRemovedHandler
editorView.getPane().destroyActiveItem()
expect(willBeRemovedHandler).toHaveBeenCalled()
runs ->
atom.workspaceView.attachToDom()
editorView = atom.workspaceView.getActiveView()
willBeRemovedHandler = jasmine.createSpy('willBeRemovedHandler')
editorView.on 'editor:will-be-removed', willBeRemovedHandler
editorView.getPane().destroyActiveItem()
expect(willBeRemovedHandler).toHaveBeenCalled()
describe "when setInvisibles is toggled (regression)", ->
it "renders inserted newlines properly", ->
@@ -2959,6 +2988,20 @@ describe "EditorView", ->
for rowNumber in [1..5]
expect(editorView.lineElementForScreenRow(rowNumber).text()).toBe buffer.lineForRow(rowNumber)
it "correctly calculates the position left for non-monospaced invisibles", ->
editorView.setShowInvisibles(true)
editorView.setInvisibles tab: ''
editor.setText('\tx')
editorView.setFontFamily('serif')
editorView.setFontSize(10)
editorView.attachToDom()
editorView.setWidthInChars(5)
expect(editorView.pixelPositionForScreenPosition([0, 0]).left).toEqual 0
expect(editorView.pixelPositionForScreenPosition([0, 1]).left).toEqual 10
expect(editorView.pixelPositionForScreenPosition([0, 2]).left).toEqual 13
describe "when the window is resized", ->
it "updates the active edit session with the current soft wrap column", ->
editorView.attachToDom()
@@ -2987,6 +3030,30 @@ describe "EditorView", ->
editorView.pixelPositionForScreenPosition([1, 5])
expect(editorView.measureToColumn.callCount).toBe 0
describe "when stylesheets are changed", ->
afterEach ->
atom.themes.removeStylesheet 'line-height'
atom.themes.removeStylesheet 'char-width'
it "updates the editor if the line height or character width changes due to a stylesheet change", ->
editorView.attachToDom()
editor.setCursorScreenPosition([1, 3])
expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 20, left: 30}
expect(editorView.getCursorView().position()).toEqual {top: 20, left: 30}
atom.themes.applyStylesheet 'line-height', """
.editor { line-height: 2; }
"""
expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 20, left: 30}
expect(editorView.getCursorView().position()).toEqual {top: 20, left: 30}
atom.themes.applyStylesheet 'char-width', """
.editor { letter-spacing: 2px; }
"""
expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 20, left: 36}
expect(editorView.getCursorView().position()).toEqual {top: 20, left: 36}
describe "when the editor contains hard tabs", ->
it "correctly calculates the the position left for a column", ->
editor.setText('\ttest')
@@ -0,0 +1 @@
module.exports = activate: ->
@@ -0,0 +1,5 @@
{
"name": "no events",
"version": "0.1.0",
"activationEvents": []
}
+32 -9
Ver Arquivo
@@ -177,6 +177,24 @@ describe "Git", ->
status = repo.getPathStatus(filePath)
expect(statusHandler.callCount).toBe 1
describe ".getDirectoryStatus(path)", ->
[directoryPath, filePath, originalPathText] = []
beforeEach ->
repo = new Git(path.join(__dirname, 'fixtures', 'git', 'working-dir'))
directoryPath = path.join(__dirname, 'fixtures', 'git', 'working-dir', 'dir')
filePath = require.resolve('./fixtures/git/working-dir/dir/b.txt')
originalPathText = fs.readFileSync(filePath, 'utf8')
afterEach ->
fs.writeFileSync(filePath, originalPathText)
it "gets the status based on the files inside the directory", ->
expect(repo.isStatusModified(repo.getDirectoryStatus(directoryPath))).toBe false
fs.writeFileSync(filePath, 'abc')
repo.getPathStatus(filePath)
expect(repo.isStatusModified(repo.getDirectoryStatus(directoryPath))).toBe true
describe ".refreshStatus()", ->
[newPath, modifiedPath, cleanPath, originalModifiedPathText] = []
@@ -203,17 +221,19 @@ describe "Git", ->
statusHandler.callCount > 0
runs ->
statuses = repo.statuses
expect(statuses[cleanPath]).toBeUndefined()
expect(repo.isStatusNew(statuses[newPath])).toBeTruthy()
expect(repo.isStatusModified(statuses[modifiedPath])).toBeTruthy()
expect(repo.getCachedPathStatus(cleanPath)).toBeUndefined()
expect(repo.isStatusNew(repo.getCachedPathStatus(newPath))).toBeTruthy()
expect(repo.isStatusModified(repo.getCachedPathStatus(modifiedPath))).toBeTruthy()
describe "buffer events", ->
[originalContent, editor] = []
beforeEach ->
editor = atom.project.openSync('sample.js')
originalContent = editor.getText()
waitsForPromise ->
atom.workspace.open('sample.js').then (o) -> editor = o
runs ->
originalContent = editor.getText()
afterEach ->
fs.writeFileSync(editor.getPath(), originalContent)
@@ -257,9 +277,12 @@ describe "Git", ->
project2?.destroy()
it "subscribes to all the serialized buffers in the project", ->
atom.project.openSync('sample.js')
project2 = atom.project.testSerialization()
buffer = project2.getBuffers()[0]
waitsForPromise ->
atom.workspace.open('sample.js')
runs ->
project2 = atom.project.testSerialization()
buffer = project2.getBuffers()[0]
waitsFor ->
buffer.loaded
-430
Ver Arquivo
@@ -1,430 +0,0 @@
fs = require 'fs-plus'
path = require 'path'
temp = require 'temp'
Keymap = require '../src/keymap'
{$, $$, WorkspaceView} = require 'atom'
describe "Keymap", ->
fragment = null
keymap = null
resourcePath = atom.getLoadSettings().resourcePath
configDirPath = null
beforeEach ->
configDirPath = temp.mkdirSync('atom')
keymap = new Keymap({configDirPath, resourcePath})
fragment = $ """
<div class="command-mode">
<div class="child-node">
<div class="grandchild-node"/>
</div>
</div>
"""
afterEach ->
keymap.destroy()
describe ".handleKeyEvent(event)", ->
deleteCharHandler = null
insertCharHandler = null
commandZHandler = null
beforeEach ->
keymap.bindKeys 'name', '.command-mode', 'x': 'deleteChar'
keymap.bindKeys 'name', '.insert-mode', 'x': 'insertChar'
keymap.bindKeys 'name', '.command-mode', 'cmd-z': 'commandZPressed'
deleteCharHandler = jasmine.createSpy('deleteCharHandler')
insertCharHandler = jasmine.createSpy('insertCharHandler')
commandZHandler = jasmine.createSpy('commandZHandler')
fragment.on 'deleteChar', deleteCharHandler
fragment.on 'insertChar', insertCharHandler
fragment.on 'commandZPressed', commandZHandler
describe "when no binding matches the event's keystroke", ->
it "does not return false so the event continues to propagate", ->
expect(keymap.handleKeyEvent(keydownEvent('0', target: fragment[0]))).not.toBe false
describe "when a non-English keyboard language is used", ->
it "uses the physical character pressed instead of the character it maps to in the current language", ->
event = keydownEvent('U+03B6', metaKey: true, which: 122, target: fragment[0]) # This is the 'z' key using the Greek keyboard layout
result = keymap.handleKeyEvent(event)
expect(result).toBe(false)
expect(commandZHandler).toHaveBeenCalled()
describe "when at least one binding fully matches the event's keystroke", ->
describe "when the event's target node matches a selector with a matching binding", ->
it "triggers the command event associated with that binding on the target node and returns false", ->
result = keymap.handleKeyEvent(keydownEvent('x', target: fragment[0]))
expect(result).toBe(false)
expect(deleteCharHandler).toHaveBeenCalled()
expect(insertCharHandler).not.toHaveBeenCalled()
deleteCharHandler.reset()
fragment.removeClass('command-mode').addClass('insert-mode')
event = keydownEvent('x', target: fragment[0])
keymap.handleKeyEvent(event)
expect(deleteCharHandler).not.toHaveBeenCalled()
expect(insertCharHandler).toHaveBeenCalled()
describe "when the event's target node *descends* from a selector with a matching binding", ->
it "triggers the command event associated with that binding on the target node and returns false", ->
target = fragment.find('.child-node')[0]
result = keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(result).toBe(false)
expect(deleteCharHandler).toHaveBeenCalled()
expect(insertCharHandler).not.toHaveBeenCalled()
deleteCharHandler.reset()
fragment.removeClass('command-mode').addClass('insert-mode')
keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(deleteCharHandler).not.toHaveBeenCalled()
expect(insertCharHandler).toHaveBeenCalled()
describe "when the event's target node descends from multiple nodes that match selectors with a binding", ->
beforeEach ->
keymap.bindKeys 'name', '.child-node', 'x': 'foo'
it "only triggers bindings on selectors associated with the closest ancestor node", ->
fooHandler = jasmine.createSpy 'fooHandler'
fragment.on 'foo', fooHandler
target = fragment.find('.grandchild-node')[0]
keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(fooHandler).toHaveBeenCalled()
expect(deleteCharHandler).not.toHaveBeenCalled()
expect(insertCharHandler).not.toHaveBeenCalled()
describe "when 'abortKeyBinding' is called on the triggered event", ->
[fooHandler1, fooHandler2] = []
beforeEach ->
fooHandler1 = jasmine.createSpy('fooHandler1').andCallFake (e) ->
expect(deleteCharHandler).not.toHaveBeenCalled()
e.abortKeyBinding()
fooHandler2 = jasmine.createSpy('fooHandler2')
fragment.find('.child-node').on 'foo', fooHandler1
fragment.on 'foo', fooHandler2
it "aborts the current event and tries again with the next-most-specific key binding", ->
target = fragment.find('.grandchild-node')[0]
keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(fooHandler1).toHaveBeenCalled()
expect(fooHandler2).not.toHaveBeenCalled()
expect(deleteCharHandler).toHaveBeenCalled()
it "does not throw an exception if the event was not triggered by the keymap", ->
fragment.find('.grandchild-node').trigger 'foo'
describe "when the event bubbles to a node that matches multiple selectors", ->
describe "when the matching selectors differ in specificity", ->
it "triggers the binding for the most specific selector", ->
keymap.bindKeys 'name', 'div .child-node', 'x': 'foo'
keymap.bindKeys 'name', '.command-mode .child-node !important', 'x': 'baz'
keymap.bindKeys 'name', '.command-mode .child-node', 'x': 'quux'
keymap.bindKeys 'name', '.child-node', 'x': 'bar'
fooHandler = jasmine.createSpy 'fooHandler'
barHandler = jasmine.createSpy 'barHandler'
bazHandler = jasmine.createSpy 'bazHandler'
fragment.on 'foo', fooHandler
fragment.on 'bar', barHandler
fragment.on 'baz', bazHandler
target = fragment.find('.grandchild-node')[0]
keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(fooHandler).not.toHaveBeenCalled()
expect(barHandler).not.toHaveBeenCalled()
expect(bazHandler).toHaveBeenCalled()
describe "when the matching selectors have the same specificity", ->
it "triggers the bindings for the most recently declared selector", ->
keymap.bindKeys 'name', '.child-node', 'x': 'foo', 'y': 'baz'
keymap.bindKeys 'name', '.child-node', 'x': 'bar'
fooHandler = jasmine.createSpy 'fooHandler'
barHandler = jasmine.createSpy 'barHandler'
bazHandler = jasmine.createSpy 'bazHandler'
fragment.on 'foo', fooHandler
fragment.on 'bar', barHandler
fragment.on 'baz', bazHandler
target = fragment.find('.grandchild-node')[0]
keymap.handleKeyEvent(keydownEvent('x', target: target))
expect(barHandler).toHaveBeenCalled()
expect(fooHandler).not.toHaveBeenCalled()
keymap.handleKeyEvent(keydownEvent('y', target: target))
expect(bazHandler).toHaveBeenCalled()
describe "when the event's target is the document body", ->
it "triggers the mapped event on the workspaceView", ->
atom.workspaceView = new WorkspaceView
atom.workspaceView.attachToDom()
keymap.bindKeys 'name', 'body', 'x': 'foo'
fooHandler = jasmine.createSpy("fooHandler")
atom.workspaceView.on 'foo', fooHandler
result = keymap.handleKeyEvent(keydownEvent('x', target: document.body))
expect(result).toBe(false)
expect(fooHandler).toHaveBeenCalled()
expect(deleteCharHandler).not.toHaveBeenCalled()
expect(insertCharHandler).not.toHaveBeenCalled()
describe "when the event matches a 'native!' binding", ->
it "returns true, allowing the browser's native key handling to process the event", ->
keymap.bindKeys 'name', '.grandchild-node', 'x': 'native!'
nativeHandler = jasmine.createSpy("nativeHandler")
fragment.on 'native!', nativeHandler
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment.find('.grandchild-node')[0]))).toBe true
expect(nativeHandler).not.toHaveBeenCalled()
describe "when at least one binding partially matches the event's keystroke", ->
[quitHandler, closeOtherWindowsHandler] = []
beforeEach ->
keymap.bindKeys 'name', "*",
'ctrl-x ctrl-c': 'quit'
'ctrl-x 1': 'close-other-windows'
quitHandler = jasmine.createSpy('quitHandler')
closeOtherWindowsHandler = jasmine.createSpy('closeOtherWindowsHandler')
fragment.on 'quit', quitHandler
fragment.on 'close-other-windows', closeOtherWindowsHandler
it "only matches entire keystroke patterns", ->
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0]))).not.toBe false
describe "when the event's target node matches a selector with a partially matching multi-stroke binding", ->
describe "when a second keystroke added to the first to match a multi-stroke binding completely", ->
it "triggers the event associated with the matched multi-stroke binding", ->
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBeFalsy()
expect(keymap.handleKeyEvent(keydownEvent('ctrl', target: fragment[0]))).toBeFalsy() # This simulates actual key event behavior
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0], ctrlKey: true))).toBeFalsy()
expect(quitHandler).toHaveBeenCalled()
expect(closeOtherWindowsHandler).not.toHaveBeenCalled()
quitHandler.reset()
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBeFalsy()
expect(keymap.handleKeyEvent(keydownEvent('1', target: fragment[0]))).toBeFalsy()
expect(quitHandler).not.toHaveBeenCalled()
expect(closeOtherWindowsHandler).toHaveBeenCalled()
describe "when a second keystroke added to the first doesn't match any bindings", ->
it "clears the queued keystroke without triggering any events", ->
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBe false
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0]))).toBe false
expect(quitHandler).not.toHaveBeenCalled()
expect(closeOtherWindowsHandler).not.toHaveBeenCalled()
expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0]))).not.toBe false
describe "when the event's target node descends from multiple nodes that match selectors with a partial binding match", ->
it "allows any of the bindings to be triggered upon a second keystroke, favoring the most specific selector", ->
keymap.bindKeys 'name', ".grandchild-node", 'ctrl-x ctrl-c': 'more-specific-quit'
grandchildNode = fragment.find('.grandchild-node')[0]
moreSpecificQuitHandler = jasmine.createSpy('moreSpecificQuitHandler')
fragment.on 'more-specific-quit', moreSpecificQuitHandler
expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy()
expect(keymap.handleKeyEvent(keydownEvent('1', target: grandchildNode))).toBeFalsy()
expect(quitHandler).not.toHaveBeenCalled()
expect(moreSpecificQuitHandler).not.toHaveBeenCalled()
expect(closeOtherWindowsHandler).toHaveBeenCalled()
closeOtherWindowsHandler.reset()
expect(keymap.handleKeyEvent(keydownEvent('x', target: grandchildNode, ctrlKey: true))).toBeFalsy()
expect(keymap.handleKeyEvent(keydownEvent('c', target: grandchildNode, ctrlKey: true))).toBeFalsy()
expect(quitHandler).not.toHaveBeenCalled()
expect(closeOtherWindowsHandler).not.toHaveBeenCalled()
expect(moreSpecificQuitHandler).toHaveBeenCalled()
describe "when there is a complete binding with a less specific selector", ->
it "favors the more specific partial match", ->
describe "when there is a complete binding with a more specific selector", ->
it "favors the more specific complete match", ->
describe ".bindKeys(name, selector, bindings)", ->
it "normalizes the key patterns in the hash to put the modifiers in alphabetical order", ->
fooHandler = jasmine.createSpy('fooHandler')
fragment.on 'foo', fooHandler
keymap.bindKeys 'name', '*', 'ctrl-alt-delete': 'foo'
result = keymap.handleKeyEvent(keydownEvent('delete', ctrlKey: true, altKey: true, target: fragment[0]))
expect(result).toBe(false)
expect(fooHandler).toHaveBeenCalled()
fooHandler.reset()
keymap.bindKeys 'name', '*', 'ctrl-alt--': 'foo'
result = keymap.handleKeyEvent(keydownEvent('-', ctrlKey: true, altKey: true, target: fragment[0]))
expect(result).toBe(false)
expect(fooHandler).toHaveBeenCalled()
describe ".remove(name)", ->
it "removes the binding set with the given selector and bindings", ->
keymap.add 'nature',
'.green':
'ctrl-c': 'cultivate'
'.brown':
'ctrl-h': 'harvest'
keymap.add 'medical',
'.green':
'ctrl-v': 'vomit'
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'green')).toHaveLength 2
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'brown')).toHaveLength 1
keymap.remove('nature')
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'green')).toHaveLength 1
expect(keymap.keyBindingsMatchingElement($$ -> @div class: 'brown')).toEqual []
describe ".keystrokeStringForEvent(event)", ->
describe "when no modifiers are pressed", ->
it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('a'))).toBe 'a'
expect(keymap.keystrokeStringForEvent(keydownEvent('['))).toBe '['
expect(keymap.keystrokeStringForEvent(keydownEvent('*'))).toBe '*'
expect(keymap.keystrokeStringForEvent(keydownEvent('left'))).toBe 'left'
expect(keymap.keystrokeStringForEvent(keydownEvent('\b'))).toBe 'backspace'
describe "when ctrl, alt or command is pressed with a non-modifier key", ->
it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('a', altKey: true))).toBe 'alt-a'
expect(keymap.keystrokeStringForEvent(keydownEvent('[', metaKey: true))).toBe 'cmd-['
expect(keymap.keystrokeStringForEvent(keydownEvent('*', ctrlKey: true))).toBe 'ctrl-*'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', ctrlKey: true, metaKey: true, altKey: true))).toBe 'alt-cmd-ctrl-left'
describe "when shift is pressed when a non-modifer key", ->
it "returns a string that identifies the key pressed", ->
expect(keymap.keystrokeStringForEvent(keydownEvent('A', shiftKey: true))).toBe 'A'
expect(keymap.keystrokeStringForEvent(keydownEvent('{', shiftKey: true))).toBe '{'
expect(keymap.keystrokeStringForEvent(keydownEvent('left', shiftKey: true))).toBe 'shift-left'
expect(keymap.keystrokeStringForEvent(keydownEvent('Left', shiftKey: true))).toBe 'shift-left'
describe ".keyBindingsMatchingElement(element)", ->
it "returns the matching bindings for the element", ->
keymap.bindKeys 'name', '.command-mode', 'c': 'c'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'g'
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 2
expect(bindings[0].command).toEqual "g"
expect(bindings[1].command).toEqual "c"
describe "when multiple bindings match a keystroke", ->
it "only returns bindings that match the most specific selector", ->
keymap.bindKeys 'name', '.command-mode', 'g': 'cmd-mode'
keymap.bindKeys 'name', '.command-mode .grandchild-node', 'g': 'cmd-and-grandchild-node'
keymap.bindKeys 'name', '.grandchild-node', 'g': 'grandchild-node'
bindings = keymap.keyBindingsMatchingElement(fragment.find('.grandchild-node'))
expect(bindings).toHaveLength 3
expect(bindings[0].command).toEqual "cmd-and-grandchild-node"
describe ".keyBindingsForCommandMatchingElement(element)", ->
beforeEach ->
keymap.add 'nature',
'.green':
'ctrl-c': 'cultivate'
'.green-2':
'ctrl-o': 'cultivate'
'.brown':
'ctrl-h': 'harvest'
'.blue':
'ctrl-c': 'fly'
it "finds a keymap for an element", ->
el = $$ -> @div class: 'green'
bindings = keymap.keyBindingsForCommandMatchingElement('cultivate', el)
expect(bindings).toHaveLength 1
expect(bindings[0].keystroke).toEqual "ctrl-c"
it "no keymap an element without that map", ->
el = $$ -> @div class: 'brown'
bindings = keymap.keyBindingsForCommandMatchingElement('cultivate', el)
expect(bindings).toHaveLength 0
describe "loading platform specific keybindings", ->
customKeymap = null
beforeEach ->
resourcePath = temp.mkdirSync('atom')
customKeymap = new Keymap({configDirPath, resourcePath})
afterEach ->
customKeymap.destroy()
it "doesn't load keybindings from other platforms", ->
win32FilePath = path.join(resourcePath, "keymaps", "win32.cson")
darwinFilePath = path.join(resourcePath, "keymaps", "darwin.cson")
fs.writeFileSync(win32FilePath, '"body": "ctrl-l": "core:win32-move-left"')
fs.writeFileSync(darwinFilePath, '"body": "ctrl-l": "core:darwin-move-left"')
customKeymap.loadBundledKeymaps()
keyBindings = customKeymap.keyBindingsForKeystroke('ctrl-l')
expect(keyBindings).toHaveLength 1
expect(keyBindings[0].command).toBe "core:#{process.platform}-move-left"
describe "when the user keymap file is changed", ->
it "is reloaded", ->
keymapFilePath = path.join(configDirPath, "keymap.cson")
fs.writeFileSync(keymapFilePath, '"body": "ctrl-l": "core:move-left"')
keymap.loadUserKeymap()
spyOn(keymap, 'loadUserKeymap').andCallThrough()
fs.writeFileSync(keymapFilePath, "'body': 'ctrl-l': 'core:move-right'")
waitsFor ->
keymap.loadUserKeymap.callCount > 0
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding.command).toBe 'core:move-right'
keymap.loadUserKeymap.reset()
fs.removeSync(keymapFilePath)
waitsFor ->
keymap.loadUserKeymap.callCount > 0
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding).toBeUndefined()
it "logs a warning when it can't be parsed", ->
keymapFilePath = path.join(configDirPath, "keymap.json")
fs.writeFileSync(keymapFilePath, '')
keymap.loadUserKeymap()
spyOn(keymap, 'loadUserKeymap').andCallThrough()
fs.writeFileSync(keymapFilePath, '}{')
spyOn(console, 'warn')
waitsFor ->
keymap.loadUserKeymap.callCount > 0
runs ->
expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0
describe "when adding a binding with an invalid selector", ->
it "logs a warning and does not add it", ->
spyOn(console, 'warn')
keybinding =
'##selector':
'cmd-a': 'invalid-command'
keymap.add('test', keybinding)
expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0
expect(-> keymap.keyBindingsMatchingElement(document.body)).not.toThrow()
expect(keymap.keyBindingsForCommand('invalid:command')).toEqual []
+59 -33
Ver Arquivo
@@ -6,8 +6,10 @@ describe "LanguageMode", ->
describe "javascript", ->
beforeEach ->
editor = atom.project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('sample.js', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-javascript')
@@ -46,6 +48,16 @@ describe "LanguageMode", ->
languageMode.toggleLineCommentsForBufferRows(0, 0)
expect(buffer.lineForRow(0)).toBe " // var i;"
buffer.setText(' ')
languageMode.toggleLineCommentsForBufferRows(0, 0)
expect(buffer.lineForRow(0)).toBe " // "
buffer.setText (' a\n \n b')
languageMode.toggleLineCommentsForBufferRows(0, 2)
expect(buffer.lineForRow(0)).toBe " // a"
expect(buffer.lineForRow(1)).toBe " // "
expect(buffer.lineForRow(2)).toBe " // b"
describe ".rowRangeForCodeFoldAtBufferRow(bufferRow)", ->
it "returns the start/end rows of the foldable region starting at the given row", ->
expect(languageMode.rowRangeForCodeFoldAtBufferRow(0)).toEqual [0, 12]
@@ -102,8 +114,10 @@ describe "LanguageMode", ->
describe "coffeescript", ->
beforeEach ->
editor = atom.project.openSync('coffee.coffee', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('coffee.coffee', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-coffee-script')
@@ -151,8 +165,10 @@ describe "LanguageMode", ->
describe "css", ->
beforeEach ->
editor = atom.project.openSync('css.css', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('css.css', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-css')
@@ -168,34 +184,36 @@ describe "LanguageMode", ->
languageMode.toggleLineCommentsForBufferRows(2, 2)
expect(buffer.lineForRow(0)).toBe "/*body {"
expect(buffer.lineForRow(1)).toBe " font-size: 1234px;*/"
expect(buffer.lineForRow(2)).toBe "/* width: 110%;*/"
expect(buffer.lineForRow(2)).toBe " /*width: 110%;*/"
expect(buffer.lineForRow(3)).toBe " font-weight: bold !important;"
languageMode.toggleLineCommentsForBufferRows(0, 1)
expect(buffer.lineForRow(0)).toBe "body {"
expect(buffer.lineForRow(1)).toBe " font-size: 1234px;"
expect(buffer.lineForRow(2)).toBe "/* width: 110%;*/"
expect(buffer.lineForRow(2)).toBe " /*width: 110%;*/"
expect(buffer.lineForRow(3)).toBe " font-weight: bold !important;"
it "uncomments lines with leading whitespace", ->
buffer.change([[2, 0], [2, Infinity]], " /*width: 110%;*/")
buffer.setTextInRange([[2, 0], [2, Infinity]], " /*width: 110%;*/")
languageMode.toggleLineCommentsForBufferRows(2, 2)
expect(buffer.lineForRow(2)).toBe " width: 110%;"
it "uncomments lines with trailing whitespace", ->
buffer.change([[2, 0], [2, Infinity]], "/*width: 110%;*/ ")
buffer.setTextInRange([[2, 0], [2, Infinity]], "/*width: 110%;*/ ")
languageMode.toggleLineCommentsForBufferRows(2, 2)
expect(buffer.lineForRow(2)).toBe "width: 110%; "
it "uncomments lines with leading and trailing whitespace", ->
buffer.change([[2, 0], [2, Infinity]], " /*width: 110%;*/ ")
buffer.setTextInRange([[2, 0], [2, Infinity]], " /*width: 110%;*/ ")
languageMode.toggleLineCommentsForBufferRows(2, 2)
expect(buffer.lineForRow(2)).toBe " width: 110%; "
describe "less", ->
beforeEach ->
editor = atom.project.openSync('sample.less', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('sample.less', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-less')
@@ -208,10 +226,28 @@ describe "LanguageMode", ->
languageMode.toggleLineCommentsForBufferRows(0, 0)
expect(buffer.lineForRow(0)).toBe "// @color: #4D926F;"
describe "xml", ->
beforeEach ->
waitsForPromise ->
atom.workspace.open('sample.xml', autoIndent: false).then (o) ->
editor = o
editor.setText("<!-- test -->")
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-xml')
describe "when uncommenting lines", ->
it "removes the leading whitespace from the comment end pattern match", ->
languageMode.toggleLineCommentsForBufferRows(0, 0)
expect(buffer.lineForRow(0)).toBe "test"
describe "folding", ->
beforeEach ->
editor = atom.project.openSync('sample.js', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('sample.js', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-javascript')
@@ -285,21 +321,6 @@ describe "LanguageMode", ->
expect(fold.getStartRow()).toBe 0
expect(fold.getEndRow()).toBe 13
describe ".unfoldBufferRow(bufferRow)", ->
describe "when bufferRow can be unfolded", ->
it "destroys a fold based on the syntactic region starting at the given row", ->
languageMode.foldBufferRow(1)
expect(editor.lineForScreenRow(1).fold).toBeDefined()
languageMode.unfoldBufferRow(1)
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
describe "when bufferRow can't be unfolded", ->
it "does not throw an error", ->
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
languageMode.unfoldBufferRow(1)
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
describe ".isFoldableAtBufferRow(bufferRow)", ->
it "returns true if the line starts a foldable row range", ->
expect(languageMode.isFoldableAtBufferRow(0)).toBe true
@@ -310,8 +331,10 @@ describe "LanguageMode", ->
describe "folding with comments", ->
beforeEach ->
editor = atom.project.openSync('sample-with-comments.js', autoIndent: false)
{buffer, languageMode} = editor
waitsForPromise ->
atom.workspace.open('sample-with-comments.js', autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-javascript')
@@ -376,7 +399,10 @@ describe "LanguageMode", ->
describe "css", ->
beforeEach ->
editor = atom.project.openSync('css.css', autoIndent: true)
waitsForPromise ->
atom.workspace.open('css.css', autoIndent: true).then (o) ->
editor = o
{buffer, languageMode} = editor
waitsForPromise ->
atom.packages.activatePackage('language-source')
+4 -4
Ver Arquivo
@@ -27,7 +27,7 @@ describe "PaneContainerView", ->
afterEach ->
atom.deserializers.remove(TestView)
describe ".getActivePane()", ->
describe ".getActivePaneView()", ->
it "returns the most-recently focused pane", ->
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
focusStealer.attachToDom()
@@ -35,15 +35,15 @@ describe "PaneContainerView", ->
pane2.focus()
expect(container.getFocusedPane()).toBe pane2
expect(container.getActivePane()).toBe pane2
expect(container.getActivePaneView()).toBe pane2
focusStealer.focus()
expect(container.getFocusedPane()).toBeUndefined()
expect(container.getActivePane()).toBe pane2
expect(container.getActivePaneView()).toBe pane2
pane3.focus()
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3
expect(container.getActivePaneView()).toBe pane3
describe ".eachPaneView(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
+1 -1
Ver Arquivo
@@ -292,7 +292,7 @@ describe "Pane", ->
pane.activeItem.path = __filename
pane.activeItem.saveAs = jasmine.createSpy("saveAs")
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).toHaveBeenCalledWith(__dirname)
expect(atom.showSaveDialogSync).toHaveBeenCalledWith(__filename)
expect(pane.activeItem.saveAs).toHaveBeenCalledWith('/selected/path')
describe "when the current item does not have a saveAs method", ->
+21 -10
Ver Arquivo
@@ -21,11 +21,16 @@ describe "PaneView", ->
container = new PaneContainerView
view1 = new TestView(id: 'view-1', text: 'View 1')
view2 = new TestView(id: 'view-2', text: 'View 2')
editor1 = atom.project.openSync('sample.js')
editor2 = atom.project.openSync('sample.txt')
pane = container.getRoot()
paneModel = pane.model
paneModel.addItems([view1, editor1, view2, editor2])
waitsForPromise ->
atom.workspace.open('sample.js').then (o) -> editor1 = o
waitsForPromise ->
atom.workspace.open('sample.txt').then (o) -> editor2 = o
runs ->
pane = container.getRoot()
paneModel = pane.model
paneModel.addItems([view1, editor1, view2, editor2])
afterEach ->
atom.deserializers.remove(TestView)
@@ -159,13 +164,19 @@ describe "PaneView", ->
describe "when an unmodifed buffer's path is deleted", ->
it "removes the pane item", ->
editor = null
jasmine.unspy(window, 'setTimeout')
filePath = temp.openSync('atom').path
editor = atom.project.openSync(filePath)
pane.activateItem(editor)
expect(pane.items).toHaveLength(5)
fs.removeSync(filePath)
waitsFor 30000, ->
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> editor = o
runs ->
pane.activateItem(editor)
expect(pane.items).toHaveLength(5)
fs.removeSync(filePath)
waitsFor ->
pane.items.length == 4
describe "when a pane is destroyed", ->
+80 -120
Ver Arquivo
@@ -18,111 +18,50 @@ describe "Project", ->
deserializedProject?.destroy()
it "does not include unretained buffers in the serialized state", ->
atom.project.bufferForPathSync('a')
expect(atom.project.getBuffers().length).toBe 1
waitsForPromise ->
atom.project.bufferForPath('a')
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
runs ->
expect(atom.project.getBuffers().length).toBe 1
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
it "listens for destroyed events on deserialized buffers and removes them when they are destroyed", ->
atom.project.openSync('a')
expect(atom.project.getBuffers().length).toBe 1
deserializedProject = atom.project.testSerialization()
waitsForPromise ->
atom.project.open('a')
expect(deserializedProject.getBuffers().length).toBe 1
deserializedProject.getBuffers()[0].destroy()
expect(deserializedProject.getBuffers().length).toBe 0
runs ->
expect(atom.project.getBuffers().length).toBe 1
deserializedProject = atom.project.testSerialization()
describe "when an edit session is destroyed", ->
it "removes edit session and calls destroy on buffer (if buffer is not referenced by other edit sessions)", ->
editor = atom.project.openSync("a")
anotherEditor = atom.project.openSync("a")
expect(deserializedProject.getBuffers().length).toBe 1
deserializedProject.getBuffers()[0].destroy()
expect(deserializedProject.getBuffers().length).toBe 0
expect(atom.project.editors.length).toBe 2
expect(editor.buffer).toBe anotherEditor.buffer
editor.destroy()
expect(atom.project.editors.length).toBe 1
anotherEditor.destroy()
expect(atom.project.editors.length).toBe 0
describe "when an edit session is saved and the project has no path", ->
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
atom.project.setPath(undefined)
expect(atom.project.getPath()).toBeUndefined()
editor = atom.project.openSync()
editor.saveAs(tempFile)
expect(atom.project.getPath()).toBe path.dirname(tempFile)
editor = null
describe "when an edit session is copied", ->
it "emits an 'editor-created' event and stores the edit session", ->
handler = jasmine.createSpy('editorCreatedHandler')
atom.project.on 'editor-created', handler
waitsForPromise ->
atom.project.open().then (o) -> editor = o
editor1 = atom.project.openSync("a")
expect(handler.callCount).toBe 1
expect(atom.project.getEditors().length).toBe 1
expect(atom.project.getEditors()[0]).toBe editor1
editor2 = editor1.copy()
expect(handler.callCount).toBe 2
expect(atom.project.getEditors().length).toBe 2
expect(atom.project.getEditors()[0]).toBe editor1
expect(atom.project.getEditors()[1]).toBe editor2
describe ".openSync(path)", ->
[absolutePath, newBufferHandler, newEditorHandler] = []
beforeEach ->
absolutePath = require.resolve('./fixtures/dir/a')
newBufferHandler = jasmine.createSpy('newBufferHandler')
atom.project.on 'buffer-created', newBufferHandler
newEditorHandler = jasmine.createSpy('newEditorHandler')
atom.project.on 'editor-created', newEditorHandler
describe "when given an absolute path that hasn't been opened previously", ->
it "returns a new edit session for the given path and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync(absolutePath)
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when given a relative path that hasn't been opened previously", ->
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync('a')
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed the path to a buffer that has already been opened", ->
it "returns a new edit session containing previously opened buffer and emits a 'editor-created' event", ->
editor = atom.project.openSync(absolutePath)
newBufferHandler.reset()
expect(atom.project.openSync(absolutePath).buffer).toBe editor.buffer
expect(atom.project.openSync('a').buffer).toBe editor.buffer
expect(newBufferHandler).not.toHaveBeenCalled()
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when not passed a path", ->
it "returns a new edit session and emits 'buffer-created' and 'editor-created' events", ->
editor = atom.project.openSync()
expect(editor.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
expect(newEditorHandler).toHaveBeenCalledWith editor
runs ->
editor.saveAs(tempFile)
expect(atom.project.getPath()).toBe path.dirname(tempFile)
describe ".open(path)", ->
[absolutePath, newBufferHandler, newEditorHandler] = []
[absolutePath, newBufferHandler] = []
beforeEach ->
absolutePath = require.resolve('./fixtures/dir/a')
newBufferHandler = jasmine.createSpy('newBufferHandler')
atom.project.on 'buffer-created', newBufferHandler
newEditorHandler = jasmine.createSpy('newEditorHandler')
atom.project.on 'editor-created', newEditorHandler
describe "when given an absolute path that isn't currently open", ->
it "returns a new edit session for the given path and emits 'buffer-created' and 'editor-created' events", ->
it "returns a new edit session for the given path and emits 'buffer-created'", ->
editor = null
waitsForPromise ->
atom.project.open(absolutePath).then (o) -> editor = o
@@ -130,10 +69,9 @@ describe "Project", ->
runs ->
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when given a relative path that isn't currently opened", ->
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created' and 'editor-created' events", ->
it "returns a new edit session for the given path (relative to the project root) and emits 'buffer-created'", ->
editor = null
waitsForPromise ->
atom.project.open(absolutePath).then (o) -> editor = o
@@ -141,23 +79,28 @@ describe "Project", ->
runs ->
expect(editor.buffer.getPath()).toBe absolutePath
expect(newBufferHandler).toHaveBeenCalledWith editor.buffer
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when passed the path to a buffer that is currently opened", ->
it "returns a new edit session containing currently opened buffer and emits a 'editor-created' event", ->
it "returns a new edit session containing currently opened buffer", ->
editor = null
waitsForPromise ->
atom.project.open(absolutePath).then (o) -> editor = o
runs ->
newBufferHandler.reset()
expect(atom.project.openSync(absolutePath).buffer).toBe editor.buffer
expect(atom.project.openSync('a').buffer).toBe editor.buffer
expect(newBufferHandler).not.toHaveBeenCalled()
expect(newEditorHandler).toHaveBeenCalledWith editor
waitsForPromise ->
atom.project.open(absolutePath).then ({buffer}) ->
expect(buffer).toBe editor.buffer
waitsForPromise ->
atom.project.open('a').then ({buffer}) ->
expect(buffer).toBe editor.buffer
expect(newBufferHandler).not.toHaveBeenCalled()
describe "when not passed a path", ->
it "returns a new edit session and emits 'buffer-created' and 'editor-created' events", ->
it "returns a new edit session and emits 'buffer-created'", ->
editor = null
waitsForPromise ->
atom.project.open().then (o) -> editor = o
@@ -165,7 +108,6 @@ describe "Project", ->
runs ->
expect(editor.buffer.getPath()).toBeUndefined()
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
expect(newEditorHandler).toHaveBeenCalledWith editor
it "returns number of read bytes as progress indicator", ->
filePath = atom.project.resolve 'a'
@@ -179,20 +121,6 @@ describe "Project", ->
runs ->
expect(totalBytes).toBe fs.statSync(filePath).size
describe ".bufferForPathSync(path)", ->
describe "when opening a previously opened path", ->
it "does not create a new buffer", ->
buffer = atom.project.bufferForPathSync("a").retain()
expect(atom.project.bufferForPathSync("a")).toBe buffer
alternativeBuffer = atom.project.bufferForPathSync("b").retain().release()
expect(alternativeBuffer).not.toBe buffer
buffer.release()
it "creates a new buffer if the previous buffer was destroyed", ->
buffer = atom.project.bufferForPathSync("a").retain().release()
expect(atom.project.bufferForPathSync("a").retain().release()).not.toBe buffer
describe ".bufferForPath(path)", ->
[buffer] = []
beforeEach ->
@@ -282,10 +210,15 @@ describe "Project", ->
describe "when a buffer is already open", ->
it "replaces properly and saves when not modified", ->
editor = atom.project.openSync('sample.js')
expect(editor.isModified()).toBeFalsy()
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
expect(editor.isModified()).toBeFalsy()
waitsForPromise ->
atom.project.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
@@ -298,10 +231,12 @@ describe "Project", ->
expect(editor.isModified()).toBeFalsy()
it "does not replace when the path is not specified", ->
editor = atom.project.openSync('sample.js')
editor = atom.project.openSync('sample-with-comments.js')
editor = null
results = []
waitsForPromise ->
atom.project.open('sample-with-comments.js').then (o) -> editor = o
waitsForPromise ->
atom.project.replace /items/gi, 'items', [commentFilePath], (result) ->
results.push(result)
@@ -311,11 +246,16 @@ describe "Project", ->
expect(results[0].filePath).toBe commentFilePath
it "does NOT save when modified", ->
editor = atom.project.openSync('sample.js')
editor.buffer.change([[0,0],[0,0]], 'omg')
expect(editor.isModified()).toBeTruthy()
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
editor.buffer.setTextInRange([[0,0],[0,0]], 'omg')
expect(editor.isModified()).toBeTruthy()
waitsForPromise ->
atom.project.replace /items/gi, 'okthen', [filePath], (result) ->
results.push(result)
@@ -479,9 +419,14 @@ describe "Project", ->
expect(resultHandler).not.toHaveBeenCalled()
it "scans buffer contents if the buffer is modified", ->
editor = atom.project.openSync("a")
editor.setText("Elephant")
editor = null
results = []
waitsForPromise ->
atom.project.open('a').then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.project.scan /a|Elephant/, (result) -> results.push result
@@ -491,6 +436,21 @@ describe "Project", ->
expect(resultForA.matches).toHaveLength 1
expect(resultForA.matches[0].matchText).toBe 'Elephant'
it "ignores buffers outside the project", ->
editor = null
results = []
waitsForPromise ->
atom.project.open(temp.openSync().path).then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.project.scan /Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 0
describe ".eachBuffer(callback)", ->
beforeEach ->
atom.project.bufferForPathSync('a')
+9
Ver Arquivo
@@ -43,6 +43,15 @@ describe "SelectListView", ->
expect(list.find('li:eq(0)')).toHaveClass 'A'
expect(selectList.getSelectedItem()).toBe items[0]
it "allows raw HTML to be returned", ->
selectList.viewForItem = (item) ->
"<li>#{item}</li>"
selectList.setItems(['Bermuda', 'Bahama'])
expect(list.find('li:eq(0)')).toHaveText 'Bermuda'
expect(selectList.getSelectedItem()).toBe 'Bermuda'
describe "when the text of the mini editor changes", ->
beforeEach ->
selectList.attachToDom()
+1 -1
Ver Arquivo
@@ -58,7 +58,7 @@ describe "Selection", ->
describe "when only the selection's tail is moved (regression)", ->
it "emits the 'screen-range-changed' event", ->
selection.setBufferRange([[2, 0], [2, 10]], isReversed: true)
selection.setBufferRange([[2, 0], [2, 10]], reversed: true)
changeScreenRangeHandler = jasmine.createSpy('changeScreenRangeHandler')
selection.on 'screen-range-changed', changeScreenRangeHandler
+8
Ver Arquivo
@@ -1,6 +1,8 @@
# Start the crash reporter before anything else.
require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')
path = require 'path'
try
require '../src/window'
Atom = require '../src/atom'
@@ -12,6 +14,12 @@ try
{runSpecSuite} = require './jasmine-helper'
# Add 'src/exports' to module search path.
exportsPath = path.resolve(atom.getLoadSettings().resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)
# Still set NODE_PATH since tasks may need it.
process.env.NODE_PATH = exportsPath
document.title = "Spec Suite"
runSpecSuite './spec-suite', atom.getLoadSettings().logFile
catch error
+58 -8
Ver Arquivo
@@ -6,8 +6,9 @@ require '../vendor/jasmine-jquery'
path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
{$, WorkspaceView} = require 'atom'
Keymap = require '../src/keymap'
Grim = require 'grim'
KeymapManager = require '../src/keymap-extensions'
{$, WorkspaceView, Workspace} = require 'atom'
Config = require '../src/config'
{Point} = require 'text-buffer'
Project = require '../src/project'
@@ -22,8 +23,8 @@ atom.themes.requireStylesheet '../static/jasmine'
fixturePackagesPath = path.resolve(__dirname, './fixtures/packages')
atom.packages.packageDirPaths.unshift(fixturePackagesPath)
atom.keymap.loadBundledKeymaps()
keyBindingsToRestore = atom.keymap.getKeyBindings()
atom.keymaps.loadBundledKeymaps()
keyBindingsToRestore = atom.keymaps.getKeyBindings()
$(window).on 'core:close', -> window.close()
$(window).on 'unload', ->
@@ -37,6 +38,7 @@ jasmine.getEnv().defaultTimeoutInterval = 5000
specPackageName = null
specPackagePath = null
specProjectPath = null
isCoreSpec = false
{specDirectory, resourcePath} = atom.getLoadSettings()
@@ -46,11 +48,15 @@ if specDirectory
specPackageName = JSON.parse(fs.readFileSync(path.join(specPackagePath, 'package.json')))?.name
specProjectPath = path.join(specDirectory, 'fixtures')
isCoreSpec = specDirectory == fs.realpathSync(__dirname)
beforeEach ->
Grim.clearDeprecations() if isCoreSpec
$.fx.off = true
projectPath = specProjectPath ? path.join(@specDirectory, 'fixtures')
atom.project = new Project(path: projectPath)
atom.keymap.keyBindings = _.clone(keyBindingsToRestore)
atom.workspace = new Workspace()
atom.keymaps.keyBindings = _.clone(keyBindingsToRestore)
window.resetTimeouts()
atom.packages.packageStates = {}
@@ -83,6 +89,7 @@ beforeEach ->
config.set "editor.autoIndent", false
config.set "core.disabledPackages", ["package-that-throws-an-exception",
"package-with-broken-package-json", "package-with-broken-keymap"]
config.set "core.useReactEditor", false
config.save.reset()
atom.config = config
@@ -112,7 +119,7 @@ afterEach ->
atom.workspaceView = null
delete atom.state.workspace
atom.project?.destroy?()
atom.project?.destroy()
atom.project = null
delete atom.state.packageStates
@@ -122,6 +129,7 @@ afterEach ->
jasmine.unspy(atom, 'saveSync')
ensureNoPathSubscriptions()
atom.syntax.off()
ensureNoDeprecatedFunctionsCalled() if isCoreSpec
waits(0) # yield to ui thread to make screen update more frequently
ensureNoPathSubscriptions = ->
@@ -130,6 +138,27 @@ ensureNoPathSubscriptions = ->
if watchedPaths.length > 0
throw new Error("Leaking subscriptions for paths: " + watchedPaths.join(", "))
ensureNoDeprecatedFunctionsCalled = ->
deprecations = Grim.getDeprecations()
if deprecations.length > 0
originalPrepareStackTrace = Error.prepareStackTrace
Error.prepareStackTrace = (error, stack) ->
output = []
for deprecation in deprecations
output.push "#{deprecation.originName} is deprecated. #{deprecation.message}"
output.push _.multiplyString("-", output[output.length - 1].length)
for stack in deprecation.getStacks()
for {functionName, location} in stack
output.push "#{functionName} -- #{location}"
output.push ""
output.join("\n")
error = new Error("Deprecated function(s) #{deprecations.map(({originName}) -> originName).join ', '}) were called.")
error.stack
Error.prepareStackTrace = originalPrepareStackTrace
throw error
emitObject = jasmine.StringPrettyPrinter.prototype.emitObject
jasmine.StringPrettyPrinter.prototype.emitObject = (obj) ->
if obj.inspect
@@ -180,7 +209,15 @@ window.keyIdentifierForKey = (key) ->
"U+00" + charCode.toString(16)
window.keydownEvent = (key, properties={}) ->
properties = $.extend({originalEvent: { keyIdentifier: keyIdentifierForKey(key) }}, properties)
originalEventProperties = {}
originalEventProperties.ctrl = properties.ctrlKey
originalEventProperties.alt = properties.altKey
originalEventProperties.shift = properties.shiftKey
originalEventProperties.cmd = properties.metaKey
originalEventProperties.target = properties.target?[0] ? properties.target
originalEventProperties.which = properties.which
originalEvent = KeymapManager.keydownEvent(key, originalEventProperties)
properties = $.extend({originalEvent}, properties)
$.Event("keydown", properties)
window.mouseEvent = (type, properties) ->
@@ -234,6 +271,15 @@ window.fakeSetTimeout = (callback, ms) ->
window.fakeClearTimeout = (idToClear) ->
window.timeouts = window.timeouts.filter ([id]) -> id != idToClear
window.fakeSetInterval = (callback, ms) ->
action = ->
callback()
window.fakeSetTimeout(action, ms)
window.fakeSetTimeout(action, ms)
window.fakeClearInterval = (idToClear) ->
window.fakeClearTimeout(idToClear)
window.advanceClock = (delta=1) ->
window.now += delta
callbacks = []
@@ -270,7 +316,11 @@ $.fn.resultOfTrigger = (type) ->
event.result
$.fn.enableKeymap = ->
@on 'keydown', (e) => atom.keymap.handleKeyEvent(e)
@on 'keydown', (e) ->
originalEvent = e.originalEvent ? e
Object.defineProperty(originalEvent, 'target', get: -> e.target) unless originalEvent.target?
atom.keymaps.handleKeyboardEvent(originalEvent)
not e.originalEvent.defaultPrevented
$.fn.attachToDom = ->
@appendTo($('#jasmine-content'))
+2 -1
Ver Arquivo
@@ -5,7 +5,7 @@ path = require 'path'
require './spec-helper'
requireSpecs = (specDirectory, specType) ->
for specFilePath in fs.listTreeSync(specDirectory) when /-spec\.coffee$/.test specFilePath
for specFilePath in fs.listTreeSync(specDirectory) when /-spec\.(coffee|js)$/.test specFilePath
require specFilePath
# Set spec directory on spec for setting up the project in spec-helper
@@ -26,6 +26,7 @@ setSpecDirectory = (specDirectory) ->
runAllSpecs = ->
{resourcePath} = atom.getLoadSettings()
# Only run core specs when resource path is the Atom repository
if Git.exists(resourcePath)
requireSpecs(path.join(resourcePath, 'spec'))
+54 -2
Ver Arquivo
@@ -36,6 +36,22 @@ describe "ThemeManager", ->
themes = themeManager.getActiveThemes()
expect(themes).toHaveLength(names.length)
describe "when the core.themes config value contains invalid entry", ->
it "ignores theme", ->
atom.config.set 'core.themes', [
'atom-light-ui'
null
undefined
''
false
4
{}
[]
'atom-dark-ui'
]
expect(themeManager.getEnabledThemeNames()).toEqual ['atom-dark-ui', 'atom-light-ui']
describe "getImportPaths()", ->
it "returns the theme directories before the themes are loaded", ->
atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui', 'atom-light-ui'])
@@ -115,15 +131,21 @@ describe "ThemeManager", ->
describe "requireStylesheet(path)", ->
it "synchronously loads css at the given path and installs a style tag for it in the head", ->
themeManager.on 'stylesheets-changed', stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.on 'stylesheet-added', stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
cssPath = atom.project.resolve('css.css')
lengthBefore = $('head style').length
themeManager.requireStylesheet(cssPath)
expect($('head style').length).toBe lengthBefore + 1
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetsChangedHandler).toHaveBeenCalled()
element = $('head style[id*="css.css"]')
expect(element.attr('id')).toBe themeManager.stringToId(cssPath)
expect(element.text()).toBe fs.readFileSync(cssPath, 'utf8')
expect(element[0].sheet).toBe stylesheetAddedHandler.argsForCall[0][0]
# doesn't append twice
themeManager.requireStylesheet(cssPath)
@@ -170,9 +192,21 @@ describe "ThemeManager", ->
expect($(document.body).css('font-weight')).not.toBe("bold")
themeManager.requireStylesheet(cssPath)
expect($(document.body).css('font-weight')).toBe("bold")
themeManager.on 'stylesheet-removed', stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.on 'stylesheets-changed', stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.removeStylesheet(cssPath)
expect($(document.body).css('font-weight')).not.toBe("bold")
expect(stylesheetRemovedHandler).toHaveBeenCalled()
stylesheet = stylesheetRemovedHandler.argsForCall[0][0]
expect(stylesheet instanceof CSSStyleSheet).toBe true
expect(stylesheet.cssRules[0].selectorText).toBe 'body'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
describe "base stylesheet loading", ->
beforeEach ->
atom.workspaceView = new WorkspaceView
@@ -200,17 +234,21 @@ describe "ThemeManager", ->
describe "when the user stylesheet changes", ->
it "reloads it", ->
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
userStylesheetPath = path.join(temp.mkdirSync("atom"), 'styles.less')
fs.writeFileSync(userStylesheetPath, 'body {border-style: dotted !important;}')
spyOn(themeManager, 'getUserStylesheetPath').andReturn userStylesheetPath
waitsForPromise ->
themeManager.activateThemes()
runs ->
expect($(document.body).css('border-style')).toBe 'dotted'
themeManager.on 'stylesheets-changed', stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.on 'stylesheet-removed', stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.on 'stylesheet-added', stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
expect($(document.body).css('border-style')).toBe 'dotted'
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
waitsFor ->
@@ -218,13 +256,27 @@ describe "ThemeManager", ->
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted'
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
stylesheetRemovedHandler.reset()
stylesheetsChangedHandler.reset()
fs.removeSync(userStylesheetPath)
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
runs ->
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 a non-existent theme is present in the config", ->
it "logs a warning but does not throw an exception (regression)", ->
+91 -6
Ver Arquivo
@@ -119,7 +119,7 @@ describe "TokenizedBuffer", ->
describe "when there is a buffer change surrounding an invalid row", ->
it "pushes the invalid row to the end of the change", ->
buffer.change([[4, 0], [6, 0]], "\n\n\n")
buffer.setTextInRange([[4, 0], [6, 0]], "\n\n\n")
changeHandler.reset()
expect(tokenizedBuffer.firstInvalidRow()).toBe 8
@@ -128,7 +128,7 @@ describe "TokenizedBuffer", ->
describe "when there is a buffer change inside an invalid region", ->
it "does not attempt to tokenize the lines in the change, and preserves the existing invalid row", ->
expect(tokenizedBuffer.firstInvalidRow()).toBe 5
buffer.change([[6, 0], [7, 0]], "\n\n\n")
buffer.setTextInRange([[6, 0], [7, 0]], "\n\n\n")
expect(tokenizedBuffer.lineForScreenRow(6).ruleStack?).toBeFalsy()
expect(tokenizedBuffer.lineForScreenRow(7).ruleStack?).toBeFalsy()
@@ -143,7 +143,7 @@ describe "TokenizedBuffer", ->
describe "when there is a buffer change that is smaller than the chunk size", ->
describe "when lines are updated, but none are added or removed", ->
it "updates tokens to reflect the change", ->
buffer.change([[0, 0], [2, 0]], "foo()\n7\n")
buffer.setTextInRange([[0, 0], [2, 0]], "foo()\n7\n")
expect(tokenizedBuffer.lineForScreenRow(0).tokens[1]).toEqual(value: '(', scopes: ['source.js', 'meta.brace.round.js'])
expect(tokenizedBuffer.lineForScreenRow(1).tokens[0]).toEqual(value: '7', scopes: ['source.js', 'constant.numeric.js'])
@@ -185,7 +185,7 @@ describe "TokenizedBuffer", ->
describe "when lines are both updated and removed", ->
it "updates tokens to reflect the change", ->
buffer.change([[1, 0], [3, 0]], "foo()")
buffer.setTextInRange([[1, 0], [3, 0]], "foo()")
# previous line 0 remains
expect(tokenizedBuffer.lineForScreenRow(0).tokens[0]).toEqual(value: 'var', scopes: ['source.js', 'storage.modifier.js'])
@@ -209,7 +209,7 @@ describe "TokenizedBuffer", ->
buffer.insert([5, 30], '/* */')
changeHandler.reset()
buffer.change([[2, 0], [3, 0]], '/*')
buffer.setTextInRange([[2, 0], [3, 0]], '/*')
expect(tokenizedBuffer.lineForScreenRow(2).tokens[0].scopes).toEqual ['source.js', 'comment.block.js', 'punctuation.definition.comment.js']
expect(tokenizedBuffer.lineForScreenRow(3).tokens[0].scopes).toEqual ['source.js']
expect(changeHandler).toHaveBeenCalled()
@@ -228,7 +228,7 @@ describe "TokenizedBuffer", ->
describe "when lines are both updated and inserted", ->
it "updates tokens to reflect the change", ->
buffer.change([[1, 0], [2, 0]], "foo()\nbar()\nbaz()\nquux()")
buffer.setTextInRange([[1, 0], [2, 0]], "foo()\nbar()\nbaz()\nquux()")
# previous line 0 remains
expect(tokenizedBuffer.lineForScreenRow(0).tokens[0]).toEqual( value: 'var', scopes: ['source.js', 'storage.modifier.js'])
@@ -452,3 +452,88 @@ describe "TokenizedBuffer", ->
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
atom.config.set('editor.tabLength', 6)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
it "does not allow the tab length to be less than 1", ->
buffer = atom.project.bufferForPathSync('sample.js')
buffer.setText('\ttest')
tokenizedBuffer = new TokenizedBuffer({buffer})
fullyTokenize(tokenizedBuffer)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
atom.config.set('editor.tabLength', 1)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
atom.config.set('editor.tabLength', 0)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
describe "leading and trailing whitespace", ->
beforeEach ->
buffer = atom.project.bufferForPathSync('sample.js')
tokenizedBuffer = new TokenizedBuffer({buffer})
fullyTokenize(tokenizedBuffer)
it "sets ::hasLeadingWhitespace to true on tokens that have leading whitespace", ->
expect(tokenizedBuffer.lineForScreenRow(0).tokens[0].hasLeadingWhitespace).toBe false
expect(tokenizedBuffer.lineForScreenRow(1).tokens[0].hasLeadingWhitespace).toBe true
expect(tokenizedBuffer.lineForScreenRow(1).tokens[1].hasLeadingWhitespace).toBe false
expect(tokenizedBuffer.lineForScreenRow(2).tokens[0].hasLeadingWhitespace).toBe true
expect(tokenizedBuffer.lineForScreenRow(2).tokens[1].hasLeadingWhitespace).toBe true
expect(tokenizedBuffer.lineForScreenRow(2).tokens[2].hasLeadingWhitespace).toBe false
# The 4th token *has* leading whitespace, but isn't entirely whitespace
buffer.insert([5, 0], ' ')
expect(tokenizedBuffer.lineForScreenRow(5).tokens[3].hasLeadingWhitespace).toBe true
expect(tokenizedBuffer.lineForScreenRow(5).tokens[4].hasLeadingWhitespace).toBe false
# Lines that are *only* whitespace are not considered to have leading whitespace
buffer.insert([10, 0], ' ')
expect(tokenizedBuffer.lineForScreenRow(10).tokens[0].hasLeadingWhitespace).toBe false
it "sets ::hasTrailingWhitespace to true on tokens that have trailing whitespace", ->
buffer.insert([0, Infinity], ' ')
expect(tokenizedBuffer.lineForScreenRow(0).tokens[11].hasTrailingWhitespace).toBe false
expect(tokenizedBuffer.lineForScreenRow(0).tokens[12].hasTrailingWhitespace).toBe true
# The last token *has* trailing whitespace, but isn't entirely whitespace
buffer.setTextInRange([[2, 39], [2, 40]], ' ')
expect(tokenizedBuffer.lineForScreenRow(2).tokens[14].hasTrailingWhitespace).toBe false
expect(tokenizedBuffer.lineForScreenRow(2).tokens[15].hasTrailingWhitespace).toBe true
# Lines that are *only* whitespace are considered to have trailing whitespace
buffer.insert([10, 0], ' ')
expect(tokenizedBuffer.lineForScreenRow(10).tokens[0].hasTrailingWhitespace).toBe true
it "only marks trailing whitespace on the last segment of a soft-wrapped line", ->
buffer.insert([0, Infinity], ' ')
tokenizedLine = tokenizedBuffer.lineForScreenRow(0)
[segment1, segment2] = tokenizedLine.softWrapAt(16)
expect(segment1.tokens[5].value).toBe ' '
expect(segment1.tokens[5].hasTrailingWhitespace).toBe false
expect(segment2.tokens[6].value).toBe ' '
expect(segment2.tokens[6].hasTrailingWhitespace).toBe true
describe "indent level", ->
beforeEach ->
buffer = atom.project.bufferForPathSync('sample.js')
tokenizedBuffer = new TokenizedBuffer({buffer})
fullyTokenize(tokenizedBuffer)
describe "when the line is non-empty", ->
it "has an indent level based on the leading whitespace on the line", ->
expect(tokenizedBuffer.lineForScreenRow(0).indentLevel).toBe 0
expect(tokenizedBuffer.lineForScreenRow(1).indentLevel).toBe 1
expect(tokenizedBuffer.lineForScreenRow(2).indentLevel).toBe 2
buffer.insert([2, 0], ' ')
expect(tokenizedBuffer.lineForScreenRow(2).indentLevel).toBe 2.5
describe "when the line is empty", ->
it "assumes the indentation level of the first non-empty line below or above if one exists", ->
buffer.insert([12, 0], ' ')
buffer.insert([12, Infinity], '\n\n')
expect(tokenizedBuffer.lineForScreenRow(13).indentLevel).toBe 2
expect(tokenizedBuffer.lineForScreenRow(14).indentLevel).toBe 2
buffer.insert([1, Infinity], '\n\n')
expect(tokenizedBuffer.lineForScreenRow(2).indentLevel).toBe 2
expect(tokenizedBuffer.lineForScreenRow(3).indentLevel).toBe 2
buffer.setText('\n\n\n')
expect(tokenizedBuffer.lineForScreenRow(1).indentLevel).toBe 0
+26
Ver Arquivo
@@ -0,0 +1,26 @@
describe "TokenizedLine", ->
editor = null
beforeEach ->
waitsForPromise -> atom.packages.activatePackage('language-coffee-script')
describe "::getScopeTree()", ->
it "returns a tree whose inner nodes are scopes and whose leaf nodes are tokens in those scopes", ->
[tokens, tokenIndex] = []
ensureValidScopeTree = (scopeTree, scopes=[]) ->
if scopeTree.children?
for child in scopeTree.children
ensureValidScopeTree(child, scopes.concat([scopeTree.scope]))
else
expect(scopeTree).toBe tokens[tokenIndex++]
expect(scopes).toEqual scopeTree.scopes
waitsForPromise ->
atom.project.open('coffee.coffee').then (o) -> editor = o
runs ->
tokenIndex = 0
tokens = editor.lineForScreenRow(1).tokens
scopeTree = editor.lineForScreenRow(1).getScopeTree()
ensureValidScopeTree(scopeTree)
+39 -20
Ver Arquivo
@@ -64,49 +64,68 @@ describe "Window", ->
describe "when pane items are are modified", ->
it "prompts user to save and and calls workspaceView.confirmClose", ->
editor = null
spyOn(atom.workspaceView, 'confirmClose').andCallThrough()
spyOn(atom, "confirm").andReturn(2)
editor = atom.workspaceView.openSync("sample.js")
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.workspaceView.confirmClose).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
waitsForPromise ->
atom.workspace.open("sample.js").then (o) -> editor = o
runs ->
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.workspaceView.confirmClose).toHaveBeenCalled()
expect(atom.confirm).toHaveBeenCalled()
it "prompts user to save and handler returns true if don't save", ->
editor = null
spyOn(atom, "confirm").andReturn(2)
editor = atom.workspaceView.openSync("sample.js")
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
waitsForPromise ->
atom.workspace.open("sample.js").then (o) -> editor = o
runs ->
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
it "prompts user to save and handler returns false if dialog is canceled", ->
editor = null
spyOn(atom, "confirm").andReturn(1)
editor = atom.workspaceView.openSync("sample.js")
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
waitsForPromise ->
atom.workspace.open("sample.js").then (o) -> editor = o
runs ->
editor.insertText("I look different, I feel different.")
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
describe ".unloadEditorWindow()", ->
it "saves the serialized state of the window so it can be deserialized after reload", ->
workspaceState = atom.workspace.serialize()
syntaxState = atom.syntax.serialize()
projectState = atom.project.serialize()
atom.unloadEditorWindow()
expect(atom.state.workspace).toEqual workspaceState
expect(atom.state.syntax).toEqual syntaxState
expect(atom.state.project).toEqual projectState
expect(atom.saveSync).toHaveBeenCalled()
it "unsubscribes from all buffers", ->
atom.workspaceView.openSync('sample.js')
buffer = atom.workspaceView.getActivePaneItem().buffer
pane = atom.workspaceView.getActivePane()
pane.splitRight(pane.copyActiveItem())
expect(atom.workspaceView.find('.editor').length).toBe 2
waitsForPromise ->
atom.workspace.open("sample.js")
atom.unloadEditorWindow()
runs ->
buffer = atom.workspace.getActivePaneItem().buffer
pane = atom.workspaceView.getActivePaneView()
pane.splitRight(pane.copyActiveItem())
expect(atom.workspaceView.find('.editor').length).toBe 2
expect(buffer.getSubscriptionCount()).toBe 0
atom.unloadEditorWindow()
expect(buffer.getSubscriptionCount()).toBe 0
describe "drag and drop", ->
buildDragEvent = (type, files) ->
+153 -79
Ver Arquivo
@@ -5,7 +5,7 @@ describe "Workspace", ->
beforeEach ->
atom.project.setPath(atom.project.resolve('dir'))
workspace = new Workspace
atom.workspace = workspace = new Workspace
describe "::open(uri, options)", ->
beforeEach ->
@@ -14,25 +14,40 @@ describe "Workspace", ->
describe "when the 'searchAllPanes' option is false (default)", ->
describe "when called without a uri", ->
it "adds and activates an empty editor on the active pane", ->
editor = null
[editor1, editor2] = []
waitsForPromise ->
workspace.open().then (o) -> editor = o
workspace.open().then (editor) -> editor1 = editor
runs ->
expect(editor.getPath()).toBeUndefined()
expect(workspace.activePane.items).toEqual [editor]
expect(workspace.activePaneItem).toBe editor
expect(editor1.getPath()).toBeUndefined()
expect(workspace.activePane.items).toEqual [editor1]
expect(workspace.activePaneItem).toBe editor1
expect(workspace.activePane.activate).toHaveBeenCalled()
waitsForPromise ->
workspace.open().then (editor) -> editor2 = editor
runs ->
expect(editor2.getPath()).toBeUndefined()
expect(workspace.activePane.items).toEqual [editor1, editor2]
expect(workspace.activePaneItem).toBe editor2
expect(workspace.activePane.activate).toHaveBeenCalled()
describe "when called with a uri", ->
describe "when the active pane already has an editor for the given uri", ->
it "activates the existing editor on the active pane", ->
editor1 = workspace.openSync('a')
editor2 = workspace.openSync('b')
editor = null
editor1 = null
editor2 = null
waitsForPromise ->
workspace.open('a').then (o) -> editor = o
workspace.open('a').then (o) ->
editor1 = o
workspace.open('b').then (o) ->
editor2 = o
workspace.open('a').then (o) ->
editor = o
runs ->
expect(editor).toBe editor1
@@ -54,11 +69,21 @@ describe "Workspace", ->
describe "when the 'searchAllPanes' option is true", ->
describe "when an editor for the given uri is already open on an inactive pane", ->
it "activates the existing editor on the inactive pane, then activates that pane", ->
editor1 = workspace.openSync('a')
pane1 = workspace.activePane
pane2 = workspace.activePane.splitRight()
editor2 = workspace.openSync('b')
expect(workspace.activePaneItem).toBe editor2
editor1 = null
editor2 = null
pane1 = workspace.getActivePane()
pane2 = workspace.getActivePane().splitRight()
waitsForPromise ->
pane1.activate()
workspace.open('a').then (o) -> editor1 = o
waitsForPromise ->
pane2.activate()
workspace.open('b').then (o) -> editor2 = o
runs ->
expect(workspace.activePaneItem).toBe editor2
waitsForPromise ->
workspace.open('a', searchAllPanes: true)
@@ -102,6 +127,22 @@ describe "Workspace", ->
expect(pane1.items).toEqual [editor]
expect(pane2.items).toEqual []
describe "when a pane axis is the leftmost sibling of the current pane", ->
it "opens the new item in the current pane", ->
editor = null
pane1 = workspace.activePane
pane2 = pane1.splitLeft()
pane3 = pane2.splitDown()
pane1.activate()
expect(workspace.activePane).toBe pane1
waitsForPromise ->
workspace.open('a', split: 'left').then (o) -> editor = o
runs ->
expect(workspace.activePane).toBe pane1
expect(pane1.items).toEqual [editor]
describe "when the 'split' option is 'right'", ->
it "opens the editor in the rightmost pane of the current pane axis", ->
editor = null
@@ -126,6 +167,26 @@ describe "Workspace", ->
expect(pane1.items).toEqual []
expect(pane2.items).toEqual [editor]
describe "when a pane axis is the rightmost sibling of the current pane", ->
it "opens the new item in a new pane split to the right of the current pane", ->
editor = null
pane1 = workspace.activePane
pane2 = pane1.splitRight()
pane3 = pane2.splitDown()
pane1.activate()
expect(workspace.activePane).toBe pane1
pane4 = null
waitsForPromise ->
workspace.open('a', split: 'right').then (o) -> editor = o
runs ->
pane4 = workspace.getPanes().filter((p) -> p != pane1)[0]
expect(workspace.activePane).toBe pane4
expect(pane4.items).toEqual [editor]
expect(workspace.paneContainer.root.children[0]).toBe pane1
expect(workspace.paneContainer.root.children[1]).toBe pane4
describe "when passed a path that matches a custom opener", ->
it "returns the resource returned by the custom opener", ->
fooOpener = (pathToOpen, options) -> { foo: pathToOpen, options } if pathToOpen?.match(/\.foo/)
@@ -142,80 +203,67 @@ describe "Workspace", ->
workspace.open("bar://baz").then (item) ->
expect(item).toEqual { bar: "bar://baz" }
describe "::openSync(uri, options)", ->
[activePane, initialItemCount] = []
it "emits an 'editor-created' event", ->
absolutePath = require.resolve('./fixtures/dir/a')
newEditorHandler = jasmine.createSpy('newEditorHandler')
workspace.on 'editor-created', newEditorHandler
beforeEach ->
activePane = workspace.activePane
spyOn(activePane, 'activate')
initialItemCount = activePane.items.length
editor = null
waitsForPromise ->
workspace.open(absolutePath).then (e) -> editor = e
describe "when called without a uri", ->
it "adds and activates an empty editor on the active pane", ->
editor = workspace.openSync()
expect(activePane.items.length).toBe initialItemCount + 1
expect(activePane.activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(activePane.activate).toHaveBeenCalled()
runs ->
expect(newEditorHandler).toHaveBeenCalledWith editor
describe "when called with a uri", ->
describe "when the active pane already has an editor for the given uri", ->
it "activates the existing editor on the active pane", ->
editor1 = workspace.openSync('a')
editor2 = workspace.openSync('b')
expect(activePane.activeItem).toBe editor2
expect(activePane.items.length).toBe 2
editor = workspace.openSync(editor1.getPath())
expect(editor).toBe editor1
expect(activePane.activeItem).toBe editor
expect(activePane.activate).toHaveBeenCalled()
expect(activePane.items.length).toBe 2
describe "when the active pane does not have an editor for the given uri", ->
it "adds and activates a new editor for the given path on the active pane", ->
editor = workspace.openSync('a')
expect(activePane.items.length).toBe 1
expect(activePane.activeItem).toBe editor
expect(activePane.activate).toHaveBeenCalled()
describe "when the 'activatePane' option is false", ->
it "does not activate the active pane", ->
workspace.openSync('b', activatePane: false)
expect(activePane.activate).not.toHaveBeenCalled()
describe "::reopenItemSync()", ->
describe "::reopenItem()", ->
it "opens the uri associated with the last closed pane that isn't currently open", ->
pane = workspace.activePane
workspace.openSync('a')
workspace.openSync('b')
workspace.openSync('file1')
workspace.openSync()
waitsForPromise ->
workspace.open('a').then ->
workspace.open('b').then ->
workspace.open('file1').then ->
workspace.open()
# does not reopen items with no uri
expect(workspace.activePaneItem.getUri()).toBeUndefined()
pane.destroyActiveItem()
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).not.toBeUndefined()
runs ->
# does not reopen items with no uri
expect(workspace.activePaneItem.getUri()).toBeUndefined()
pane.destroyActiveItem()
# destroy all items
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('file1')
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('b')
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('a')
pane.destroyActiveItem()
waitsForPromise ->
workspace.reopenItem()
# reopens items with uris
expect(workspace.activePaneItem).toBeUndefined()
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('a')
runs ->
expect(workspace.activePaneItem.getUri()).not.toBeUndefined()
# destroy all items
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('file1')
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('b')
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('a')
pane.destroyActiveItem()
# reopens items with uris
expect(workspace.activePaneItem).toBeUndefined()
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('a')
# does not reopen items that are already open
workspace.openSync('b')
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('b')
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('file1')
waitsForPromise ->
workspace.open('b')
runs ->
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('b')
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.activePaneItem.getUri()).toBe atom.project.resolve('file1')
describe "::increase/decreaseFontSize()", ->
it "increases/decreases the font size without going below 1", ->
@@ -235,3 +283,29 @@ describe "Workspace", ->
it "opens the license as plain-text in a buffer", ->
waitsForPromise -> workspace.openLicense()
runs -> expect(workspace.activePaneItem.getText()).toMatch /Copyright/
describe "when an editor is destroyed", ->
it "removes the editor", ->
editor = null
waitsForPromise ->
workspace.open("a").then (e) -> editor = e
runs ->
expect(workspace.getEditors()).toHaveLength 1
editor.destroy()
expect(workspace.getEditors()).toHaveLength 0
describe "when an editor is copied", ->
it "emits an 'editor-created' event", ->
editor = null
handler = jasmine.createSpy('editorCreatedHandler')
workspace.on 'editor-created', handler
waitsForPromise ->
workspace.open("a").then (o) -> editor = o
runs ->
expect(handler.callCount).toBe 1
editorCopy = editor.copy()
expect(handler.callCount).toBe 2
+110 -59
Ver Arquivo
@@ -2,6 +2,7 @@
Q = require 'q'
path = require 'path'
temp = require 'temp'
EditorView = require '../src/editor-view'
PaneView = require '../src/pane-view'
Workspace = require '../src/workspace'
@@ -14,9 +15,12 @@ describe "WorkspaceView", ->
atom.workspace = new Workspace
atom.workspaceView = new WorkspaceView(atom.workspace)
atom.workspaceView.enableKeymap()
atom.workspaceView.openSync(pathToOpen)
atom.workspaceView.focus()
waitsForPromise ->
atom.workspace.open(pathToOpen)
describe "@deserialize()", ->
viewState = null
@@ -32,64 +36,82 @@ describe "WorkspaceView", ->
describe "when the serialized WorkspaceView has an unsaved buffer", ->
it "constructs the view with the same panes", ->
atom.workspaceView.attachToDom()
atom.workspaceView.openSync()
editorView1 = atom.workspaceView.getActiveView()
buffer = editorView1.getEditor().getBuffer()
editorView1.splitRight()
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]
simulateReload()
waitsForPromise ->
atom.workspace.open()
expect(atom.workspaceView.getEditorViews().length).toBe 2
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]
expect(atom.workspaceView.title).toBe "untitled - #{atom.project.getPath()}"
runs ->
editorView1 = atom.workspaceView.getActiveView()
buffer = editorView1.getEditor().getBuffer()
editorView1.splitRight()
expect(atom.workspaceView.getActivePaneView()).toBe atom.workspaceView.getPaneViews()[1]
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 2
expect(atom.workspaceView.getActivePaneView()).toBe atom.workspaceView.getPaneViews()[1]
expect(atom.workspaceView.title).toBe "untitled - #{atom.project.getPath()}"
describe "when there are open editors", ->
it "constructs the view with the same panes", ->
atom.workspaceView.attachToDom()
pane1 = atom.workspaceView.getActivePane()
pane1 = atom.workspaceView.getActivePaneView()
pane2 = pane1.splitRight()
pane3 = pane2.splitRight()
pane4 = pane2.splitDown()
pane2.activateItem(atom.project.openSync('b'))
pane3.activateItem(atom.project.openSync('../sample.js'))
pane3.activeItem.setCursorScreenPosition([2, 4])
pane4.activateItem(atom.project.openSync('../sample.txt'))
pane4.activeItem.setCursorScreenPosition([0, 2])
pane2.focus()
pane4 = null
simulateReload()
waitsForPromise ->
atom.workspace.open('b').then (editor) ->
pane2.activateItem(editor)
expect(atom.workspaceView.getEditorViews().length).toBe 4
editorView1 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(0)').view()
editorView3 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(1)').view()
editorView2 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(0)').view()
editorView4 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(1)').view()
waitsForPromise ->
atom.workspace.open('../sample.js').then (editor) ->
pane3.activateItem(editor)
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
runs ->
pane3.activeItem.setCursorScreenPosition([2, 4])
pane4 = pane2.splitDown()
# ensure adjust pane dimensions is called
expect(editorView1.width()).toBeGreaterThan 0
expect(editorView2.width()).toBeGreaterThan 0
expect(editorView3.width()).toBeGreaterThan 0
expect(editorView4.width()).toBeGreaterThan 0
waitsForPromise ->
atom.workspace.open('../sample.txt').then (editor) ->
pane4.activateItem(editor)
# ensure correct editorView is focused again
expect(editorView2.isFocused).toBeTruthy()
expect(editorView1.isFocused).toBeFalsy()
expect(editorView3.isFocused).toBeFalsy()
expect(editorView4.isFocused).toBeFalsy()
runs ->
pane4.activeItem.setCursorScreenPosition([0, 2])
pane2.focus()
expect(atom.workspaceView.title).toBe "#{path.basename(editorView2.getEditor().getPath())} - #{atom.project.getPath()}"
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 4
editorView1 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(0)').view()
editorView3 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(1)').view()
editorView2 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(0)').view()
editorView4 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(1)').view()
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
# ensure adjust pane dimensions is called
expect(editorView1.width()).toBeGreaterThan 0
expect(editorView2.width()).toBeGreaterThan 0
expect(editorView3.width()).toBeGreaterThan 0
expect(editorView4.width()).toBeGreaterThan 0
# ensure correct editorView is focused again
expect(editorView2).toHaveFocus()
expect(editorView1).not.toHaveFocus()
expect(editorView3).not.toHaveFocus()
expect(editorView4).not.toHaveFocus()
expect(atom.workspaceView.title).toBe "#{path.basename(editorView2.getEditor().getPath())} - #{atom.project.getPath()}"
describe "where there are no open editors", ->
it "constructs the view with no open editors", ->
atom.workspaceView.getActivePane().remove()
atom.workspaceView.getActivePaneView().remove()
expect(atom.workspaceView.getEditorViews().length).toBe 0
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 0
@@ -99,11 +121,11 @@ describe "WorkspaceView", ->
atom.workspaceView.attachToDom()
it "hands off focus to the active pane", ->
activePane = atom.workspaceView.getActivePane()
activePane = atom.workspaceView.getActivePaneView()
$('body').focus()
expect(activePane.hasFocus()).toBe false
expect(activePane).not.toHaveFocus()
atom.workspaceView.focus()
expect(activePane.hasFocus()).toBe true
expect(activePane).toHaveFocus()
describe "keymap wiring", ->
commandHandler = null
@@ -111,7 +133,7 @@ describe "WorkspaceView", ->
commandHandler = jasmine.createSpy('commandHandler')
atom.workspaceView.on('foo-command', commandHandler)
atom.keymap.bindKeys('name', '*', 'x': 'foo-command')
atom.keymaps.add('name', '*': {'x': 'foo-command'})
describe "when a keydown event is triggered in the WorkspaceView", ->
it "triggers matching keybindings for that event", ->
@@ -128,43 +150,44 @@ describe "WorkspaceView", ->
describe "when the project has a path", ->
beforeEach ->
atom.workspaceView.openSync('b')
waitsForPromise ->
atom.workspace.open('b')
describe "when there is an active pane item", ->
it "sets the title to the pane item's title plus the project path", ->
item = atom.workspaceView.getActivePaneItem()
item = atom.workspace.getActivePaneItem()
expect(atom.workspaceView.title).toBe "#{item.getTitle()} - #{atom.project.getPath()}"
describe "when the title of the active pane item changes", ->
it "updates the window title based on the item's new title", ->
editor = atom.workspaceView.getActivePaneItem()
editor = atom.workspace.getActivePaneItem()
editor.buffer.setPath(path.join(temp.dir, 'hi'))
expect(atom.workspaceView.title).toBe "#{editor.getTitle()} - #{atom.project.getPath()}"
describe "when the active pane's item changes", ->
it "updates the title to the new item's title plus the project path", ->
atom.workspaceView.getActivePane().showNextItem()
item = atom.workspaceView.getActivePaneItem()
atom.workspaceView.getActivePaneView().activateNextItem()
item = atom.workspace.getActivePaneItem()
expect(atom.workspaceView.title).toBe "#{item.getTitle()} - #{atom.project.getPath()}"
describe "when the last pane item is removed", ->
it "updates the title to contain the project's path", ->
atom.workspaceView.getActivePane().remove()
expect(atom.workspaceView.getActivePaneItem()).toBeUndefined()
atom.workspaceView.getActivePaneView().remove()
expect(atom.workspace.getActivePaneItem()).toBeUndefined()
expect(atom.workspaceView.title).toBe atom.project.getPath()
describe "when an inactive pane's item changes", ->
it "does not update the title", ->
pane = atom.workspaceView.getActivePane()
pane = atom.workspaceView.getActivePaneView()
pane.splitRight()
initialTitle = atom.workspaceView.title
pane.showNextItem()
pane.activateNextItem()
expect(atom.workspaceView.title).toBe initialTitle
describe "when the root view is deserialized", ->
it "updates the title to contain the project's path", ->
workspaceView2 = new WorkspaceView(atom.workspace.testSerialization())
item = atom.workspaceView.getActivePaneItem()
item = atom.workspace.getActivePaneItem()
expect(workspaceView2.title).toBe "#{item.getTitle()} - #{atom.project.getPath()}"
workspaceView2.remove()
@@ -222,6 +245,14 @@ describe "WorkspaceView", ->
expect(count).toBe 1
expect(callbackEditor).toBe atom.workspaceView.getActiveView()
it "does not invoke the callback for mini editors", ->
editorViewCreatedHandler = jasmine.createSpy('editorViewCreatedHandler')
atom.workspaceView.eachEditorView(editorViewCreatedHandler)
editorViewCreatedHandler.reset()
miniEditor = new EditorView(mini: true)
atom.workspaceView.append(miniEditor)
expect(editorViewCreatedHandler).not.toHaveBeenCalled()
it "returns a subscription that can be disabled", ->
count = 0
callback = (editor) -> count++
@@ -237,7 +268,27 @@ describe "WorkspaceView", ->
describe "core:close", ->
it "closes the active pane item until all that remains is a single empty pane", ->
atom.config.set('core.destroyEmptyPanes', true)
atom.project.openSync('../sample.txt')
expect(atom.workspaceView.getActivePane().getItems()).toHaveLength 1
paneView1 = atom.workspaceView.getActivePaneView()
editorView = atom.workspaceView.getActiveView()
editorView.splitRight()
paneView2 = atom.workspaceView.getActivePaneView()
expect(paneView1).not.toBe paneView2
expect(atom.workspaceView.getPaneViews()).toHaveLength 2
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePane().getItems()).toHaveLength 0
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 1
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePaneView().getItems()).toHaveLength 0
expect(atom.workspaceView.getPaneViews()).toHaveLength 1
describe "the scrollbar visibility class", ->
it "has a class based on the style of the scrollbar", ->
scrollbarStyle = require 'scrollbar-style'
scrollbarStyle.emitValue 'legacy'
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-always'
scrollbarStyle.emitValue 'overlay'
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-when-scrolling'
+65 -41
Ver Arquivo
@@ -1,6 +1,5 @@
crypto = require 'crypto'
ipc = require 'ipc'
keytar = require 'keytar'
os = require 'os'
path = require 'path'
remote = require 'remote'
@@ -8,6 +7,7 @@ screen = require 'screen'
shell = require 'shell'
_ = require 'underscore-plus'
{deprecated} = require 'grim'
{Model} = require 'theorist'
fs = require 'fs-plus'
@@ -24,7 +24,7 @@ WindowEventHandler = require './window-event-handler'
# * `atom.config` - A {Config} instance
# * `atom.contextMenu` - A {ContextMenuManager} instance
# * `atom.deserializers` - A {DeserializerManager} instance
# * `atom.keymap` - A {Keymap} instance
# * `atom.keymaps` - A {Keymap} instance
# * `atom.menu` - A {MenuManager} instance
# * `atom.packages` - A {PackageManager} instance
# * `atom.project` - A {Project} instance
@@ -34,6 +34,8 @@ WindowEventHandler = require './window-event-handler'
# * `atom.workspaceView` - A {WorkspaceView} instance
module.exports =
class Atom extends Model
@version: 1 # Increment this when the serialization format changes
# Public: Load or create the Atom environment in the given mode.
#
# - mode: Pass 'editor' or 'spec' depending on the kind of environment you
@@ -41,11 +43,11 @@ class Atom extends Model
#
# Returns an Atom instance, fully initialized
@loadOrCreate: (mode) ->
@deserialize(@loadState(mode)) ? new this({mode, version: @getVersion()})
@deserialize(@loadState(mode)) ? new this({mode, @version})
# Deserializes the Atom environment from a state object
@deserialize: (state) ->
new this(state) if state?.version is @getVersion()
new this(state) if state?.version is @version
# Loads and returns the serialized state corresponding to this window
# if it exists; otherwise returns undefined.
@@ -110,7 +112,7 @@ class Atom extends Model
# Get the version of the Atom application.
@getVersion: ->
@version ?= @getLoadSettings().appVersion
@appVersion ?= @getLoadSettings().appVersion
# Determine whether the current version is an official release.
@isReleasedVersion: ->
@@ -130,6 +132,7 @@ class Atom extends Model
initialize: ->
window.onerror = =>
@openDevTools()
@executeJavaScriptInDevTools('InspectorFrontendAPI.showConsole()')
@emit 'uncaught-error', arguments...
@unsubscribe()
@@ -138,19 +141,29 @@ class Atom extends Model
@loadTime = null
Config = require './config'
Keymap = require './keymap'
KeymapManager = require './keymap-extensions'
PackageManager = require './package-manager'
Clipboard = require './clipboard'
Syntax = require './syntax'
ThemeManager = require './theme-manager'
ContextMenuManager = require './context-menu-manager'
MenuManager = require './menu-manager'
{devMode, resourcePath} = @getLoadSettings()
{devMode, safeMode, resourcePath} = @getLoadSettings()
configDirPath = @getConfigDirPath()
# Add 'src/exports' to module search path.
exportsPath = path.resolve(resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)
# Still set NODE_PATH since tasks may need it.
process.env.NODE_PATH = exportsPath
# Make react.js faster
process.env.NODE_ENV ?= 'production'
@config = new Config({configDirPath, resourcePath})
@keymap = new Keymap({configDirPath, resourcePath})
@packages = new PackageManager({devMode, configDirPath, resourcePath})
@keymaps = new KeymapManager({configDirPath, resourcePath})
@keymap = @keymaps # Deprecated
@packages = new PackageManager({devMode, configDirPath, resourcePath, safeMode})
@themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath})
@contextMenu = new ContextMenuManager(devMode)
@menu = new MenuManager({resourcePath})
@@ -171,9 +184,11 @@ class Atom extends Model
# Deprecated: Callers should be converted to use atom.deserializers
registerRepresentationClass: ->
deprecated("Callers should be converted to use atom.deserializers")
# Deprecated: Callers should be converted to use atom.deserializers
registerRepresentationClasses: ->
deprecated("Callers should be converted to use atom.deserializers")
setBodyPlatformClass: ->
document.body.classList.add("platform-#{process.platform}")
@@ -210,12 +225,26 @@ class Atom extends Model
else
@center()
storeDefaultWindowDimensions: ->
dimensions = JSON.stringify(atom.getWindowDimensions())
localStorage.setItem("defaultWindowDimensions", dimensions)
getDefaultWindowDimensions: ->
{windowDimensions} = @getLoadSettings()
return windowDimensions if windowDimensions?
dimensions = null
try
dimensions = JSON.parse(localStorage.getItem("defaultWindowDimensions"))
catch error
console.warn "Error parsing default window dimensions", error
localStorage.removeItem("defaultWindowDimensions")
{width, height} = screen.getPrimaryDisplay().workAreaSize
dimensions ? {x: 0, y: 0, width: Math.min(1024, width), height: height}
restoreWindowDimensions: ->
workAreaSize = screen.getPrimaryDisplay().workAreaSize
windowDimensions = @state.windowDimensions ? {}
{initialSize} = @getLoadSettings()
windowDimensions.height ?= initialSize?.height ? workAreaSize.height
windowDimensions.width ?= initialSize?.width ? Math.min(workAreaSize.width, 1024)
windowDimensions = @state.windowDimensions ? @getDefaultWindowDimensions()
@setWindowDimensions(windowDimensions)
storeWindowDimensions: ->
@@ -229,13 +258,14 @@ class Atom extends Model
deserializeProject: ->
Project = require './project'
@project ?= @deserializers.deserialize(@project) ? new Project(path: @getLoadSettings().initialPath)
@project ?= @deserializers.deserialize(@state.project) ? new Project(path: @getLoadSettings().initialPath)
deserializeWorkspaceView: ->
Workspace = require './workspace'
WorkspaceView = require './workspace-view'
@workspace = Workspace.deserialize(@state.workspace) ? new Workspace
@workspaceView = new WorkspaceView(@workspace)
@keymaps.defaultTarget = @workspaceView[0]
$(@workspaceViewParentSelector).append(@workspaceView)
deserializePackageStates: ->
@@ -260,12 +290,12 @@ class Atom extends Model
@config.load()
@config.setDefaults('core', require('./workspace-view').configDefaults)
@config.setDefaults('editor', require('./editor-view').configDefaults)
@keymap.loadBundledKeymaps()
@keymaps.loadBundledKeymaps()
@themes.loadBaseStylesheets()
@packages.loadPackages()
@deserializeEditorWindow()
@packages.activate()
@keymap.loadUserKeymap()
@keymaps.loadUserKeymap()
@requireUserInitScript()
@menu.update()
@@ -280,6 +310,7 @@ class Atom extends Model
return if not @project and not @workspaceView
@state.syntax = @syntax.serialize()
@state.project = @project.serialize()
@state.workspace = @workspace.serialize()
@packages.deactivatePackages()
@state.packageStates = @packages.packageStates
@@ -288,7 +319,7 @@ class Atom extends Model
@workspaceView = null
@project.destroy()
@windowEventHandler?.unsubscribe()
@keymap.destroy()
@keymaps.destroy()
@windowState = null
loadThemes: ->
@@ -309,7 +340,7 @@ class Atom extends Model
# options - An {Object} with the following keys:
# :pathsToOpen - An {Array} of {String} paths to open.
open: (options) ->
ipc.sendChannel('open', options)
ipc.send('open', options)
# Public: Open a confirm dialog.
#
@@ -363,46 +394,50 @@ class Atom extends Model
# Public: Open the dev tools for the current window.
openDevTools: ->
ipc.sendChannel('call-window-method', 'openDevTools')
ipc.send('call-window-method', 'openDevTools')
# Public: Toggle the visibility of the dev tools for the current window.
toggleDevTools: ->
ipc.sendChannel('call-window-method', 'toggleDevTools')
ipc.send('call-window-method', 'toggleDevTools')
# Public: Execute code in dev tools.
executeJavaScriptInDevTools: (code) ->
ipc.send('call-window-method', 'executeJavaScriptInDevTools', code)
# Public: Reload the current window.
reload: ->
ipc.sendChannel('call-window-method', 'restart')
ipc.send('call-window-method', 'restart')
# Public: Focus the current window.
focus: ->
ipc.sendChannel('call-window-method', 'focus')
ipc.send('call-window-method', 'focus')
$(window).focus()
# Public: Show the current window.
show: ->
ipc.sendChannel('call-window-method', 'show')
ipc.send('call-window-method', 'show')
# Public: Hide the current window.
hide: ->
ipc.sendChannel('call-window-method', 'hide')
ipc.send('call-window-method', 'hide')
# Public: Set the size of current window.
#
# width - The {Number} of pixels.
# height - The {Number} of pixels.
setSize: (width, height) ->
ipc.sendChannel('call-window-method', 'setSize', width, height)
ipc.send('call-window-method', 'setSize', width, height)
# Public: Set the position of current window.
#
# x - The {Number} of pixels.
# y - The {Number} of pixels.
setPosition: (x, y) ->
ipc.sendChannel('call-window-method', 'setPosition', x, y)
ipc.send('call-window-method', 'setPosition', x, y)
# Public: Move current window to the center of the screen.
center: ->
ipc.sendChannel('call-window-method', 'center')
ipc.send('call-window-method', 'center')
# Schedule the window to be shown and focused on the next tick.
#
@@ -421,7 +456,7 @@ class Atom extends Model
exit: (status) ->
app = remote.require('app')
app.emit('will-exit')
app.exit(status)
remote.process.exit(status)
# Public: Is the current window in development mode?
inDevMode: ->
@@ -437,7 +472,7 @@ class Atom extends Model
# Public: Set the full screen state of the current window.
setFullScreen: (fullScreen=false) ->
ipc.sendChannel('call-window-method', 'setFullScreen', fullScreen)
ipc.send('call-window-method', 'setFullScreen', fullScreen)
# Public: Is the current window in full screen mode?
isFullScreen: ->
@@ -451,17 +486,6 @@ class Atom extends Model
isReleasedVersion: ->
@constructor.isReleasedVersion()
getGitHubAuthTokenName: ->
'Atom GitHub API Token'
# Public: Set the the github token in the keychain
setGitHubAuthToken: (token) ->
keytar.replacePassword(@getGitHubAuthTokenName(), 'github', token)
# Public: Get the github token from the keychain
getGitHubAuthToken: ->
keytar.getPassword(@getGitHubAuthTokenName(), 'github')
# Public: Get the directory path to Atom's configuration area.
#
# Returns the absolute path to ~/.atom
+45 -40
Ver Arquivo
@@ -9,30 +9,28 @@ _ = require 'underscore-plus'
# and maintain the state of all menu items.
module.exports =
class ApplicationMenu
version: null
menu: null
constructor: (@version) ->
@menu = Menu.buildFromTemplate @getDefaultTemplate()
Menu.setApplicationMenu @menu
global.atomApplication.autoUpdateManager.on 'state-changed', (state) =>
@showUpdateMenuItem(state)
# Public: Updates the entire menu with the given keybindings.
#
# * template:
# The Object which describes the menu to display.
# * keystrokesByCommand:
# An Object where the keys are commands and the values are Arrays containing
# the keystroke.
# template - The Object which describes the menu to display.
# keystrokesByCommand - An Object where the keys are commands and the values
# are Arrays containing the keystroke.
update: (template, keystrokesByCommand) ->
@translateTemplate(template, keystrokesByCommand)
@substituteVersion(template)
@menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(@menu)
@showUpdateMenuItem(global.atomApplication.autoUpdateManager.getState())
# Flattens the given menu and submenu items into an single Array.
#
# * menu:
# A complete menu configuration object for atom-shell's menu API.
# menu - A complete menu configuration object for atom-shell's menu API.
#
# Returns an Array of native menu items.
flattenMenuItems: (menu) ->
@@ -44,8 +42,7 @@ class ApplicationMenu
# Flattens the given menu template into an single Array.
#
# * template:
# An object describing the menu item.
# template - An object describing the menu item.
#
# Returns an Array of native menu items.
flattenMenuTemplate: (template) ->
@@ -57,27 +54,36 @@ class ApplicationMenu
# Public: Used to make all window related menu items are active.
#
# * enable:
# If true enables all window specific items, if false disables all window
# specific items.
# enable - If true enables all window specific items, if false disables all
# window specific items.
enableWindowSpecificItems: (enable) ->
for item in @flattenMenuItems(@menu)
item.enabled = enable if item.metadata?['windowSpecific']
# Replaces VERSION with the current version.
substituteVersion: (template) ->
if (item = _.find(@flattenMenuTemplate(template), (i) -> i.label == 'VERSION'))
if (item = _.find(@flattenMenuTemplate(template), ({label}) -> label == 'VERSION'))
item.label = "Version #{@version}"
# Toggles Install Update Item
showInstallUpdateItem: (visible=true) ->
if (item = _.find(@flattenMenuItems(@menu), (i) -> i.label == 'Restart and Install Update'))
item.visible = visible
# Sets the proper visible state the update menu items
showUpdateMenuItem: (state) ->
checkForUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Check for Update')
downloadingUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Downloading Update')
installUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Restart and Install Update')
# Toggles Check For Update Item
showCheckForUpdateItem: (visible=true) ->
if (item = _.find(@flattenMenuItems(@menu), (i) -> i.label == 'Check for Update'))
item.visible = visible
return unless checkForUpdateItem? and downloadingUpdateItem? and installUpdateItem?
checkForUpdateItem.visible = false
downloadingUpdateItem.visible = false
installUpdateItem.visible = false
switch state
when 'idle', 'error', 'no-update-available'
checkForUpdateItem.visible = true
when 'checking', 'downloading'
downloadingUpdateItem.visible = true
when 'update-available'
installUpdateItem.visible = true
# Default list of menu items.
#
@@ -86,26 +92,28 @@ class ApplicationMenu
[
label: "Atom"
submenu: [
{ label: 'Reload', accelerator: 'Command+R', click: -> @focusedWindow()?.reload() }
{ label: 'Close Window', accelerator: 'Command+Shift+W', click: -> @focusedWindow()?.close() }
{ label: 'Toggle Dev Tools', accelerator: 'Command+Alt+I', click: -> @focusedWindow()?.toggleDevTools() }
{ label: "Check for Update", metadata: {autoUpdate: true}}
{ label: 'Reload', accelerator: 'Command+R', click: => @focusedWindow()?.reload() }
{ label: 'Close Window', accelerator: 'Command+Shift+W', click: => @focusedWindow()?.close() }
{ label: 'Toggle Dev Tools', accelerator: 'Command+Alt+I', click: => @focusedWindow()?.toggleDevTools() }
{ label: 'Quit', accelerator: 'Command+Q', click: -> app.quit() }
]
]
focusedWindow: ->
_.find global.atomApplication.windows, (atomWindow) -> atomWindow.isFocused()
# Combines a menu template with the appropriate keystroke.
#
# * template:
# An Object conforming to atom-shell's menu api but lacking accelerator and
# click properties.
# * keystrokesByCommand:
# An Object where the keys are commands and the values are Arrays containing
# the keystroke.
# template - An Object conforming to atom-shell's menu api but lacking
# accelerator and click properties.
# keystrokesByCommand - An Object where the keys are commands and the values
# are Arrays containing the keystroke.
#
# Returns a complete menu configuration object for atom-shell's menu API.
translateTemplate: (template, keystrokesByCommand) ->
template.forEach (item) =>
item.metadata = {}
item.metadata ?= {}
if item.command
item.accelerator = @acceleratorForCommand(item.command, keystrokesByCommand)
item.click = => global.atomApplication.sendCommand(item.command)
@@ -115,11 +123,9 @@ class ApplicationMenu
# Determine the accelerator for a given command.
#
# * command:
# The name of the command.
# * keystrokesByCommand:
# An Object where the keys are commands and the values are Arrays containing
# the keystroke.
# command - The name of the command.
# keystrokesByCommand - An Object where the keys are commands and the values
# are Arrays containing the keystroke.
#
# Returns a String containing the keystroke in a format that can be interpreted
# by atom shell to provide nice icons where available.
@@ -130,7 +136,6 @@ class ApplicationMenu
modifiers = firstKeystroke.split('-')
key = modifiers.pop()
modifiers.push("Shift") if key != key.toLowerCase()
modifiers = modifiers.map (modifier) ->
modifier.replace(/shift/ig, "Shift")
.replace(/cmd/ig, "Command")
+165 -162
Ver Arquivo
@@ -1,9 +1,9 @@
AtomWindow = require './atom-window'
ApplicationMenu = require './application-menu'
AtomProtocolHandler = require './atom-protocol-handler'
AutoUpdateManager = require './auto-update-manager'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
autoUpdater = require 'auto-updater'
app = require 'app'
dialog = require 'dialog'
fs = require 'fs'
@@ -30,7 +30,6 @@ socketPath =
module.exports =
class AtomApplication
_.extend @prototype, EventEmitter.prototype
updateVersion: null
# Public: The entry point into the Atom application.
@open: (options) ->
@@ -60,33 +59,33 @@ class AtomApplication
exit: (status) -> app.exit(status)
constructor: (options) ->
{@resourcePath, @version, @devMode} = options
{@resourcePath, @version, @devMode, @safeMode} = options
global.atomApplication = this
@pidsToOpenWindows = {}
@pathsToOpen ?= []
@windows = []
@autoUpdateManager = new AutoUpdateManager(@version)
@applicationMenu = new ApplicationMenu(@version)
@atomProtocolHandler = new AtomProtocolHandler(@resourcePath)
@listenForArgumentsFromNewProcess()
@setupJavaScriptArguments()
@handleEvents()
@setupAutoUpdater()
@openWithOptions(options)
# Opens a new window based on the options provided.
openWithOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, newWindow, specDirectory, logFile}) ->
openWithOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, newWindow, specDirectory, logFile}) ->
if test
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory, logFile})
else if pathsToOpen.length > 0
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode})
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode})
else if urlsToOpen.length > 0
@openUrl({urlToOpen, devMode}) for urlToOpen in urlsToOpen
@openUrl({urlToOpen, devMode, safeMode}) for urlToOpen in urlsToOpen
else
@openPath({pidToKillWhenClosed, newWindow, devMode}) # Always open a editor window if this is the first instance of Atom.
@openPath({pidToKillWhenClosed, newWindow, devMode, safeMode}) # Always open a editor window if this is the first instance of Atom.
# Public: Removes the {AtomWindow} from the global window list.
removeWindow: (window) ->
@@ -97,6 +96,8 @@ class AtomApplication
addWindow: (window) ->
@windows.push window
@applicationMenu?.enableWindowSpecificItems(true)
window.once 'window:loaded', =>
@autoUpdateManager.emitUpdateAvailableEvent(window)
# Creates server to listen for additional atom application launches.
#
@@ -126,77 +127,39 @@ class AtomApplication
# Configures required javascript environment flags.
setupJavaScriptArguments: ->
app.commandLine.appendSwitch 'js-flags', '--harmony_collections --harmony-proxies'
# Enable updates unless running from a local build of Atom.
setupAutoUpdater: ->
autoUpdater.setFeedUrl "https://atom.io/api/updates?version=#{@version}"
autoUpdater.on 'checking-for-update', =>
@applicationMenu.showInstallUpdateItem(false)
@applicationMenu.showCheckForUpdateItem(false)
autoUpdater.on 'update-not-available', =>
@applicationMenu.showInstallUpdateItem(false)
@applicationMenu.showCheckForUpdateItem(true)
autoUpdater.on 'update-downloaded', (event, releaseNotes, releaseName, releaseDate, releaseURL) =>
atomWindow.sendCommand('window:update-available', releaseName) for atomWindow in @windows
@applicationMenu.showInstallUpdateItem(true)
@applicationMenu.showCheckForUpdateItem(false)
@updateVersion = releaseName
autoUpdater.on 'error', (event, message) =>
@applicationMenu.showInstallUpdateItem(false)
@applicationMenu.showCheckForUpdateItem(true)
# Check for update after Atom has fully started and the menus are created
setTimeout((-> autoUpdater.checkForUpdates()), 5000)
checkForUpdate: ->
autoUpdater.once 'update-available', ->
dialog.showMessageBox
type: 'info'
buttons: ['OK']
message: 'Update available.'
detail: 'A new update is being downloaded.'
autoUpdater.once 'update-not-available', =>
dialog.showMessageBox
type: 'info'
buttons: ['OK']
message: 'No update available.'
detail: "Version #{@version} is the latest version."
autoUpdater.once 'error', (event, message)->
dialog.showMessageBox
type: 'warning'
buttons: ['OK']
message: 'There was an error checking for updates.'
detail: message
autoUpdater.checkForUpdates()
app.commandLine.appendSwitch 'js-flags', '--harmony'
# Registers basic application commands, non-idempotent.
handleEvents: ->
@on 'application:about', -> Menu.sendActionToFirstResponder('orderFrontStandardAboutPanel:')
@on 'application:run-all-specs', -> @runSpecs(exitWhenDone: false, resourcePath: global.devResourcePath)
@on 'application:run-benchmarks', -> @runBenchmarks()
@on 'application:quit', -> app.quit()
@on 'application:hide', -> Menu.sendActionToFirstResponder('hide:')
@on 'application:hide-other-applications', -> Menu.sendActionToFirstResponder('hideOtherApplications:')
@on 'application:unhide-all-applications', -> Menu.sendActionToFirstResponder('unhideAllApplications:')
@on 'application:new-window', -> @openPath(initialSize: @getFocusedWindowSize())
@on 'application:new-window', -> @openPath(windowDimensions: @focusedWindow()?.getDimensions())
@on 'application:new-file', -> (@focusedWindow() ? this).openPath()
@on 'application:open', -> @promptForPath()
@on 'application:open', -> @promptForPath(type: 'all')
@on 'application:open-file', -> @promptForPath(type: 'file')
@on 'application:open-folder', -> @promptForPath(type: 'folder')
@on 'application:open-dev', -> @promptForPath(devMode: true)
@on 'application:minimize', -> Menu.sendActionToFirstResponder('performMiniaturize:')
@on 'application:zoom', -> Menu.sendActionToFirstResponder('zoom:')
@on 'application:bring-all-windows-to-front', -> Menu.sendActionToFirstResponder('arrangeInFront:')
@on 'application:inspect', ({x,y}) -> @focusedWindow().browserWindow.inspectElement(x, y)
@on 'application:open-safe', -> @promptForPath(safeMode: true)
@on 'application:inspect', ({x,y, atomWindow}) ->
atomWindow ?= @focusedWindow()
atomWindow?.browserWindow.inspectElement(x, y)
@on 'application:open-documentation', -> shell.openExternal('https://atom.io/docs/latest/?app')
@on 'application:install-update', -> autoUpdater.quitAndInstall()
@on 'application:check-for-update', => @checkForUpdate()
@on 'application:install-update', -> @autoUpdateManager.install()
@on 'application:check-for-update', => @autoUpdateManager.check()
if process.platform is 'darwin'
@on 'application:about', -> Menu.sendActionToFirstResponder('orderFrontStandardAboutPanel:')
@on 'application:bring-all-windows-to-front', -> Menu.sendActionToFirstResponder('arrangeInFront:')
@on 'application:hide', -> Menu.sendActionToFirstResponder('hide:')
@on 'application:hide-other-applications', -> Menu.sendActionToFirstResponder('hideOtherApplications:')
@on 'application:minimize', -> Menu.sendActionToFirstResponder('performMiniaturize:')
@on 'application:unhide-all-applications', -> Menu.sendActionToFirstResponder('unhideAllApplications:')
@on 'application:zoom', -> Menu.sendActionToFirstResponder('zoom:')
else
@on 'application:minimize', -> @focusedWindow()?.minimize()
@on 'application:zoom', -> @focusedWindow()?.maximize()
@openPathOnEvent('application:show-settings', 'atom://config')
@openPathOnEvent('application:open-your-config', 'atom://.atom/config')
@@ -204,12 +167,18 @@ class AtomApplication
@openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap')
@openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets')
@openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet')
@openPathOnEvent('application:open-license', path.join(@resourcePath, 'LICENSE.md'))
app.on 'window-all-closed', ->
app.quit() if process.platform is 'win32'
app.quit() if process.platform in ['win32', 'linux']
app.on 'will-quit', => @deleteSocketFile()
app.on 'will-exit', => @deleteSocketFile()
app.on 'will-quit', =>
@killAllProcesses()
@deleteSocketFile()
app.on 'will-exit', =>
@killAllProcesses()
@deleteSocketFile()
app.on 'open-file', (event, pathToOpen) =>
event.preventDefault()
@@ -217,10 +186,14 @@ class AtomApplication
app.on 'open-url', (event, urlToOpen) =>
event.preventDefault()
@openUrl({urlToOpen, @devMode})
@openUrl({urlToOpen, @devMode, @safeMode})
app.on 'activate-with-no-open-windows', (event) =>
event.preventDefault()
@emit('application:new-window')
# A request from the associated render process to open a new render process.
ipc.on 'open', (processId, routingId, options) =>
ipc.on 'open', (event, options) =>
if options?
if options.pathsToOpen?.length > 0
@openPaths(options)
@@ -229,42 +202,71 @@ class AtomApplication
else
@promptForPath()
ipc.on 'update-application-menu', (processId, routingId, template, keystrokesByCommand) =>
ipc.on 'update-application-menu', (event, template, keystrokesByCommand) =>
@applicationMenu.update(template, keystrokesByCommand)
ipc.on 'run-package-specs', (processId, routingId, specDirectory) =>
ipc.on 'run-package-specs', (event, specDirectory) =>
@runSpecs({resourcePath: global.devResourcePath, specDirectory: specDirectory, exitWhenDone: false})
ipc.on 'command', (processId, routingId, command) =>
ipc.on 'command', (event, command) =>
@emit(command)
ipc.on 'window-command', (processId, routingId, command, args...) ->
win = BrowserWindow.fromProcessIdAndRoutingId(processId, routingId)
ipc.on 'window-command', (event, command, args...) ->
win = BrowserWindow.fromWebContents(event.sender)
win.emit(command, args...)
ipc.on 'call-window-method', (processId, routingId, method, args...) ->
win = BrowserWindow.fromProcessIdAndRoutingId(processId, routingId)
ipc.on 'call-window-method', (event, method, args...) ->
win = BrowserWindow.fromWebContents(event.sender)
win[method](args...)
# Public: Executes the given command.
#
# If it isn't handled globally, delegate to the currently focused window.
#
# * command:
# The string representing the command.
# * args:
# The optional arguments to pass along.
# command - The string representing the command.
# args - The optional arguments to pass along.
sendCommand: (command, args...) ->
unless @emit(command, args...)
@focusedWindow()?.sendCommand(command, args...)
focusedWindow = @focusedWindow()
if focusedWindow?
focusedWindow.sendCommand(command, args...)
else
@sendCommandToFirstResponder(command)
# Public: Executes the given command on the given window.
#
# command - The string representing the command.
# atomWindow - The {AtomWindow} to send the command to.
# args - The optional arguments to pass along.
sendCommandToWindow: (command, atomWindow, args...) ->
unless @emit(command, args...)
if atomWindow?
atomWindow.sendCommand(command, args...)
else
@sendCommandToFirstResponder(command)
# Translates the command into OS X action and sends it to application's first
# responder.
sendCommandToFirstResponder: (command) ->
return false unless process.platform is 'darwin'
switch command
when 'core:undo' then Menu.sendActionToFirstResponder('undo:')
when 'core:redo' then Menu.sendActionToFirstResponder('redo:')
when 'core:copy' then Menu.sendActionToFirstResponder('copy:')
when 'core:cut' then Menu.sendActionToFirstResponder('cut:')
when 'core:paste' then Menu.sendActionToFirstResponder('paste:')
when 'core:select-all' then Menu.sendActionToFirstResponder('selectAll:')
else return false
true
# Public: Open the given path in the focused window when the event is
# triggered.
#
# A new window will be created if there is no currently focused window.
#
# * eventName: The event to listen for.
# * pathToOpen: The path to open when the event is triggered.
# eventName - The event to listen for.
# pathToOpen - The path to open when the event is triggered.
openPathOnEvent: (eventName, pathToOpen) ->
@on eventName, ->
if window = @focusedWindow()
@@ -281,56 +283,42 @@ class AtomApplication
focusedWindow: ->
_.find @windows, (atomWindow) -> atomWindow.isFocused()
# Public: Get the height and width of the focused window.
#
# Returns an object with height and width keys or null if there is no
# focused window.
getFocusedWindowSize: ->
if focusedWindow = @focusedWindow()
[width, height] = focusedWindow.getSize()
{width, height}
else
null
# Public: Opens multiple paths, in existing windows if possible.
#
# * options
# + pathsToOpen:
# The array of file paths to open
# + pidToKillWhenClosed:
# The integer of the pid to kill
# + newWindow:
# Boolean of whether this should be opened in a new window.
# + devMode:
# Boolean to control the opened window's dev mode.
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode}) ->
@openPath({pathToOpen, pidToKillWhenClosed, newWindow, devMode}) for pathToOpen in pathsToOpen ? []
# options -
# :pathsToOpen - The array of file paths to open
# :pidToKillWhenClosed - The integer of the pid to kill
# :newWindow - Boolean of whether this should be opened in a new window.
# :devMode - Boolean to control the opened window's dev mode.
# :safeMode - Boolean to control the opened window's safe mode.
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode}) ->
for pathToOpen in pathsToOpen ? []
@openPath({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode})
# Public: Opens a single path, in an existing window if possible.
#
# * options
# + pathToOpen:
# The file path to open
# + pidToKillWhenClosed:
# The integer of the pid to kill
# + newWindow:
# Boolean of whether this should be opened in a new window.
# + devMode:
# Boolean to control the opened window's dev mode.
# + initialSize:
# Object with height and width keys.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, initialSize}={}) ->
# options -
# :pathToOpen - The file path to open
# :pidToKillWhenClosed - The integer of the pid to kill
# :newWindow - Boolean of whether this should be opened in a new window.
# :devMode - Boolean to control the opened window's dev mode.
# :safeMode - Boolean to control the opened window's safe mode.
# :windowDimensions - Object with height and width keys.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions}={}) ->
if pathToOpen
[basename, initialLine] = path.basename(pathToOpen).split(':')
if initialLine
pathToOpen = "#{path.dirname(pathToOpen)}/#{basename}"
initialLine -= 1 # Convert line numbers to a base of 0
[basename, initialLine, initialColumn] = path.basename(pathToOpen).split(':')
pathToOpen = path.join(path.dirname(pathToOpen), basename) if initialLine
# Convert line numbers to a base of 0
initialLine -= 1 if initialLine
initialColumn -= 1 if initialColumn
unless devMode
existingWindow = @windowForPath(pathToOpen) unless pidToKillWhenClosed or newWindow
if existingWindow
openedWindow = existingWindow
openedWindow.openPath(pathToOpen, initialLine)
openedWindow.restore()
else
if devMode
try
@@ -339,19 +327,31 @@ class AtomApplication
bootstrapScript ?= require.resolve('../window-bootstrap')
resourcePath ?= @resourcePath
openedWindow = new AtomWindow({pathToOpen, initialLine, bootstrapScript, resourcePath, devMode, initialSize})
openedWindow = new AtomWindow({pathToOpen, initialLine, initialColumn, bootstrapScript, resourcePath, devMode, safeMode, windowDimensions})
if pidToKillWhenClosed?
@pidsToOpenWindows[pidToKillWhenClosed] = openedWindow
openedWindow.browserWindow.on 'destroyed', =>
for pid, trackedWindow of @pidsToOpenWindows when trackedWindow is openedWindow
try
process.kill(pid)
catch error
if error.code isnt 'ESRCH'
console.log("Killing process #{pid} failed: #{error.code}")
delete @pidsToOpenWindows[pid]
openedWindow.browserWindow.on 'closed', =>
@killProcessForWindow(openedWindow)
# Kill all processes associated with opened windows.
killAllProcesses: ->
@killProcess(pid) for pid of @pidsToOpenWindows
# Kill process associated with the given opened window.
killProcessForWindow: (openedWindow) ->
for pid, trackedWindow of @pidsToOpenWindows
@killProcess(pid) if trackedWindow is openedWindow
# Kill the process with the given pid.
killProcess: (pid) ->
try
process.kill(pid)
catch error
if error.code isnt 'ESRCH'
console.log("Killing process #{pid} failed: #{error.code}")
delete @pidsToOpenWindows[pid]
# Open an atom:// url.
#
@@ -359,12 +359,11 @@ class AtomApplication
# responsible for opening the URL. A new window will be created with
# that package's `urlMain` as the bootstrap script.
#
# * options
# + urlToOpen:
# The atom:// url to open.
# + devMode:
# Boolean to control the opened window's dev mode.
openUrl: ({urlToOpen, devMode}) ->
# options -
# :urlToOpen - The atom:// url to open.
# :devMode - Boolean to control the opened window's dev mode.
# :safeMode - Boolean to control the opened window's safe mode.
openUrl: ({urlToOpen, devMode, safeMode}) ->
unless @packages?
PackageManager = require '../package-manager'
fs = require 'fs-plus'
@@ -379,7 +378,8 @@ class AtomApplication
if pack.urlMain
packagePath = @packages.resolvePackagePath(packageName)
bootstrapScript = path.resolve(packagePath, pack.urlMain)
new AtomWindow({bootstrapScript, @resourcePath, devMode, urlToOpen, initialSize: @getFocusedWindowSize()})
windowDimensions = @focusedWindow()?.getDimensions()
new AtomWindow({bootstrapScript, @resourcePath, devMode, safeMode, urlToOpen, windowDimensions})
else
console.log "Package '#{pack.name}' does not have a url main: #{urlToOpen}"
else
@@ -387,13 +387,11 @@ class AtomApplication
# Opens up a new {AtomWindow} to run specs within.
#
# * options
# + exitWhenDone:
# A Boolean that if true, will close the window upon completion.
# + resourcePath:
# The path to include specs from.
# + specPath:
# The directory to load specs from.
# options -
# :exitWhenDone - A Boolean that if true, will close the window upon
# completion.
# :resourcePath - The path to include specs from.
# :specPath - The directory to load specs from.
runSpecs: ({exitWhenDone, resourcePath, specDirectory, logFile}) ->
if resourcePath isnt @resourcePath and not fs.existsSync(resourcePath)
resourcePath = @resourcePath
@@ -420,15 +418,20 @@ class AtomApplication
#
# Once paths are selected, they're opened in a new or existing {AtomWindow}s.
#
# * options
# + devMode:
# A Boolean which controls whether any newly opened windows should be in
# dev mode or not.
promptForPath: ({devMode}={}) ->
dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory'], (pathsToOpen) =>
@openPaths({pathsToOpen, devMode})
# Public: If an update is available, it returns the new version string
# otherwise it returns null.
getUpdateVersion: ->
@updateVersion
# options -
# :type - A String which specifies the type of the dialog, could be 'file',
# 'folder' or 'all'. The 'all' is only available on OS X.
# :devMode - A Boolean which controls whether any newly opened windows
# should be in dev mode or not.
# :safeMode - A Boolean which controls whether any newly opened windows
# should be in safe mode or not.
promptForPath: ({type, devMode, safeMode}={}) ->
type ?= 'all'
properties =
switch type
when 'file' then ['openFile']
when 'folder' then ['openDirectory']
when 'all' then ['openFile', 'openDirectory']
else throw new Error("#{type} is an invalid type for promptForPath")
dialog.showOpenDialog title: 'Open', properties: properties.concat(['multiSelections', 'createDirectory']), (pathsToOpen) =>
@openPaths({pathsToOpen, devMode, safeMode})
+28 -35
Ver Arquivo
@@ -1,16 +1,17 @@
BrowserWindow = require 'browser-window'
Menu = require 'menu'
ContextMenu = require './context-menu'
app = require 'app'
dialog = require 'dialog'
ipc = require 'ipc'
path = require 'path'
fs = require 'fs'
url = require 'url'
_ = require 'underscore-plus'
{EventEmitter} = require 'events'
module.exports =
class AtomWindow
_.extend @prototype, EventEmitter.prototype
@iconPath: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
@includeShellLoadTime: true
@@ -19,15 +20,10 @@ class AtomWindow
isSpec: null
constructor: (settings={}) ->
{@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings
{@resourcePath, pathToOpen, initialLine, initialColumn, @isSpec, @exitWhenDone} = settings
global.atomApplication.addWindow(this)
@setupNodePath(@resourcePath)
@browserWindow = new BrowserWindow show: false, title: 'Atom', icon: @constructor.iconPath
@browserWindow.restart = _.wrap _.bind(@browserWindow.restart, @browserWindow), (restart) =>
@setupNodePath(@resourcePath)
restart()
@handleEvents()
loadSettings = _.extend({}, settings)
@@ -44,14 +40,14 @@ class AtomWindow
loadSettings.initialPath = path.dirname(pathToOpen)
@browserWindow.loadSettings = loadSettings
@browserWindow.once 'window:loaded', => @loaded = true
@browserWindow.once 'window:loaded', =>
@emit 'window:loaded'
@loaded = true
@browserWindow.loadUrl @getUrl(loadSettings)
@browserWindow.focusOnWebView() if @isSpec
@openPath(pathToOpen, initialLine)
setupNodePath: (resourcePath) ->
process.env['NODE_PATH'] = path.resolve(resourcePath, 'exports')
@openPath(pathToOpen, initialLine, initialColumn)
getUrl: (loadSettingsObj) ->
# Ignore the windowState when passing loadSettings via URL, since it could
@@ -84,7 +80,7 @@ class AtomWindow
false
handleEvents: ->
@browserWindow.on 'destroyed', =>
@browserWindow.on 'closed', =>
global.atomApplication.removeWindow(this)
@browserWindow.on 'unresponsive', =>
@@ -97,37 +93,36 @@ class AtomWindow
detail: 'The editor is not responding. Would you like to force close it or just keep waiting?'
@browserWindow.destroy() if chosen is 0
@browserWindow.on 'crashed', =>
@browserWindow.webContents.on 'crashed', =>
global.atomApplication.exit(100) if @exitWhenDone
chosen = dialog.showMessageBox @browserWindow,
type: 'warning'
buttons: ['Close Window', 'Reload', 'Keep It Open']
message: 'The editor has crashed'
detail: 'Please report this issue to https://github.com/atom/atom/issues'
detail: 'Please report this issue to atom@github.com'
switch chosen
when 0 then @browserWindow.destroy()
when 1 then @browserWindow.restart()
@browserWindow.on 'context-menu', (menuTemplate) =>
new ContextMenu(menuTemplate, @browserWindow)
new ContextMenu(menuTemplate, this)
if @isSpec
# Spec window's web view should always have focus
@browserWindow.on 'blur', =>
@browserWindow.focusOnWebView()
openPath: (pathToOpen, initialLine) ->
openPath: (pathToOpen, initialLine, initialColumn) ->
if @loaded
@focus()
@sendCommand('window:open-path', {pathToOpen, initialLine})
@sendCommand('window:update-available', global.atomApplication.getUpdateVersion()) if global.atomApplication.getUpdateVersion()
@sendCommand('window:open-path', {pathToOpen, initialLine, initialColumn})
else
@browserWindow.once 'window:loaded', => @openPath(pathToOpen, initialLine)
@browserWindow.once 'window:loaded', => @openPath(pathToOpen, initialLine, initialColumn)
sendCommand: (command, args...) ->
if @isSpecWindow()
unless @sendCommandToFirstResponder(command)
unless global.atomApplication.sendCommandToFirstResponder(command)
switch command
when 'window:reload' then @reload()
when 'window:toggle-dev-tools' then @toggleDevTools()
@@ -135,29 +130,27 @@ class AtomWindow
else if @isWebViewFocused()
@sendCommandToBrowserWindow(command, args...)
else
unless @sendCommandToFirstResponder(command)
unless global.atomApplication.sendCommandToFirstResponder(command)
@sendCommandToBrowserWindow(command, args...)
sendCommandToBrowserWindow: (command, args...) ->
action = if args[0]?.contextCommand then 'context-command' else 'command'
ipc.sendChannel @browserWindow.getProcessId(), @browserWindow.getRoutingId(), action, command, args...
@browserWindow.webContents.send action, command, args...
sendCommandToFirstResponder: (command) ->
switch command
when 'core:undo' then Menu.sendActionToFirstResponder('undo:')
when 'core:redo' then Menu.sendActionToFirstResponder('redo:')
when 'core:copy' then Menu.sendActionToFirstResponder('copy:')
when 'core:cut' then Menu.sendActionToFirstResponder('cut:')
when 'core:paste' then Menu.sendActionToFirstResponder('paste:')
when 'core:select-all' then Menu.sendActionToFirstResponder('selectAll:')
else return false
true
getDimensions: ->
[x, y] = @browserWindow.getPosition()
[width, height] = @browserWindow.getSize()
{x, y, width, height}
close: -> @browserWindow.close()
focus: -> @browserWindow.focus()
getSize: -> @browserWindow.getSize()
minimize: -> @browserWindow.minimize()
maximize: -> @browserWindow.maximize()
restore: -> @browserWindow.restore()
handlesAtomCommands: ->
not @isSpecWindow() and @isWebViewFocused()
+76
Ver Arquivo
@@ -0,0 +1,76 @@
autoUpdater = require 'auto-updater'
dialog = require 'dialog'
_ = require 'underscore-plus'
{EventEmitter} = require 'events'
IDLE_STATE='idle'
CHECKING_STATE='checking'
DOWNLOADING_STATE='downloading'
UPDATE_AVAILABLE_STATE='update-available'
NO_UPDATE_AVAILABLE_STATE='no-update-available'
ERROR_STATE='error'
module.exports =
class AutoUpdateManager
_.extend @prototype, EventEmitter.prototype
constructor: (@version) ->
@state = IDLE_STATE
# Only released versions should check for updates.
return if /\w{7}/.test(@version)
autoUpdater.setFeedUrl "https://atom.io/api/updates?version=#{@version}"
autoUpdater.on 'checking-for-update', =>
@setState(CHECKING_STATE)
autoUpdater.on 'update-not-available', =>
@setState(NO_UPDATE_AVAILABLE_STATE)
autoUpdater.on 'update-available', =>
@setState(DOWNLOADING_STATE)
autoUpdater.on 'error', (event, message) =>
@setState(ERROR_STATE)
console.error "Error Downloading Update: #{message}"
autoUpdater.on 'update-downloaded', (event, @releaseNotes, @releaseVersion) =>
@setState(UPDATE_AVAILABLE_STATE)
@emitUpdateAvailableEvent(@getWindows()...)
@check(hidePopups: true)
emitUpdateAvailableEvent: (windows...) ->
return unless @releaseVersion? and @releaseNotes
for atomWindow in windows
atomWindow.sendCommand('window:update-available', [@releaseVersion, @releaseNotes])
setState: (state) ->
return unless @state != state
@state = state
@emit 'state-changed', @state
getState: ->
@state
check: ({hidePopups}={})->
unless hidePopups
autoUpdater.once 'update-not-available', @onUpdateNotAvailable
autoUpdater.once 'error', @onUpdateError
autoUpdater.checkForUpdates()
install: ->
autoUpdater.quitAndInstall()
onUpdateNotAvailable: =>
autoUpdater.removeListener 'error', @onUpdateError
dialog.showMessageBox type: 'info', buttons: ['OK'], message: 'No update available.', detail: "Version #{@version} is the latest version."
onUpdateError: (event, message) =>
autoUpdater.removeListener 'update-not-available', @onUpdateNotAvailable
dialog.showMessageBox type: 'warning', buttons: ['OK'], message: 'There was an error checking for updates.', detail: message
getWindows: ->
global.atomApplication.windows
+8 -5
Ver Arquivo
@@ -2,10 +2,10 @@ Menu = require 'menu'
module.exports =
class ContextMenu
constructor: (template, browserWindow) ->
constructor: (template, @atomWindow) ->
template = @createClickHandlers(template)
menu = Menu.buildFromTemplate(template)
menu.popup(browserWindow)
menu.popup(@atomWindow.browserWindow)
# It's necessary to build the event handlers in this process, otherwise
# closures are drug across processes and failed to be garbage collected
@@ -13,7 +13,10 @@ class ContextMenu
createClickHandlers: (template) ->
for item in template
if item.command
(item.commandOptions ?= {}).contextCommand = true
item.click = do (item) ->
=> global.atomApplication.sendCommand(item.command, item.commandOptions)
item.commandOptions ?= {}
item.commandOptions.contextCommand = true
item.commandOptions.atomWindow = @atomWindow
do (item) =>
item.click = =>
global.atomApplication.sendCommandToWindow(item.command, @atomWindow, item.commandOptions)
item
+5 -8
Ver Arquivo
@@ -9,12 +9,7 @@ optimist = require 'optimist'
nslog = require 'nslog'
dialog = require 'dialog'
console.log = (args...) ->
# TODO: Make NSLog work as expected
output = args.map((arg) -> JSON.stringify(arg)).join(" ")
nslog(output)
if process.platform isnt 'darwin'
fs.writeFileSync('debug.log', output, flag: 'a')
console.log = nslog
process.on 'uncaughtException', (error={}) ->
nslog(error.message) if error.message?
@@ -77,7 +72,8 @@ parseCommandLine = ->
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.')
options.alias('l', 'log-file').string('l').describe('l', 'Log all output to file.')
options.alias('n', 'new-window').boolean('n').describe('n', 'Open a new window.')
options.alias('s', 'spec-directory').string('s').describe('s', 'Set the directory from which specs are loaded (default: Atom\'s spec directory).')
options.alias('s', 'spec-directory').string('s').describe('s', 'Set the spec directory (default: Atom\'s spec directory).')
options.boolean('safe').describe('safe', 'Do not load packages from ~/.atom/packages or ~/.atom/dev/packages.')
options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.')
options.alias('v', 'version').boolean('v').describe('v', 'Print the version.')
options.alias('w', 'wait').boolean('w').describe('w', 'Wait for window to be closed before returning.')
@@ -93,6 +89,7 @@ parseCommandLine = ->
executedFrom = args['executed-from']
devMode = args['dev']
safeMode = args['safe']
pathsToOpen = args._
pathsToOpen = [executedFrom] if executedFrom and pathsToOpen.length is 0
test = args['test']
@@ -112,6 +109,6 @@ parseCommandLine = ->
catch
resourcePath = path.dirname(path.dirname(__dirname))
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow, specDirectory, logFile}
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, safeMode, newWindow, specDirectory, logFile}
start()
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@ ChildProcess = require 'child_process'
# args = ['-ef']
# stdout = (output) -> console.log(output)
# exit = (code) -> console.log("ps -ef exited with #{code}")
# process = new BufferredProcess({command, args, stdout, exit})
# process = new BufferedProcess({command, args, stdout, exit})
# ```
module.exports =
class BufferedProcess
+6 -10
Ver Arquivo
@@ -1,33 +1,29 @@
crypto = require 'crypto'
fs = require 'fs'
path = require 'path'
os = require 'os'
CoffeeScript = require 'coffee-script'
CSON = require 'season'
mkdir = require('mkdirp').sync
fs = require 'fs-plus'
tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp'
cacheDir = path.join(tmpDir, 'atom-compile-cache')
cacheDir = path.join(fs.absolute('~/.atom'), 'compile-cache')
coffeeCacheDir = path.join(cacheDir, 'coffee')
CSON.setCacheDir(path.join(cacheDir, 'cson'))
getCachePath = (coffee) ->
digest = crypto.createHash('sha1').update(coffee, 'utf8').digest('hex')
path.join(coffeeCacheDir, "#{digest}.coffee")
path.join(coffeeCacheDir, "#{digest}.js")
getCachedJavaScript = (cachePath) ->
if stat = fs.statSyncNoException(cachePath)
if fs.isFileSync(cachePath)
try
fs.readFileSync(cachePath, 'utf8') if stat.isFile()
fs.readFileSync(cachePath, 'utf8')
compileCoffeeScript = (coffee, filePath, cachePath) ->
{js,v3SourceMap} = CoffeeScript.compile(coffee, filename: filePath, sourceMap: true)
{js, v3SourceMap} = CoffeeScript.compile(coffee, filename: filePath, sourceMap: true)
# 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=#{filePath}"
try
mkdir(path.dirname(cachePath))
fs.writeFileSync(cachePath, js)
js
+41 -20
Ver Arquivo
@@ -18,9 +18,9 @@ pathWatcher = require 'pathwatcher'
# ## Example
#
# ```coffeescript
# atom.config.set('myplugin.key', 'value')
# atom.config.observe 'myplugin.key', ->
# console.log 'My configuration changed:', atom.config.get('myplugin.key')
# atom.config.set('my-package.key', 'value')
# atom.config.observe 'my-package.key', ->
# console.log 'My configuration changed:', atom.config.get('my-package.key')
# ```
module.exports =
class Config
@@ -86,9 +86,9 @@ class Config
hash = hash[key]
_.extend hash, defaults
@update()
@emit 'updated'
# Public: Get the path to the config file being used.
# Public: Get the {String} path to the config file being used.
getUserConfigPath: ->
@configFilePath
@@ -98,10 +98,10 @@ class Config
# Public: Retrieves the setting for the given key.
#
# keyPath - The {String} name of the key to retrieve
# keyPath - The {String} name of the key to retrieve.
#
# Returns the value from Atom's default settings, the user's configuration file,
# or `null` if the key doesn't exist in either.
# Returns the value from Atom's default settings, the user's configuration
# file, or `null` if the key doesn't exist in either.
get: (keyPath) ->
value = _.valueForKeyPath(@settings, keyPath) ? _.valueForKeyPath(@defaultSettings, keyPath)
_.deepClone(value)
@@ -110,8 +110,8 @@ class Config
#
# keyPath - The {String} name of the key to retrieve
#
# Returns the value from Atom's default settings, the user's configuration file,
# or `NaN` if the key doesn't exist in either.
# Returns the value from Atom's default settings, the user's configuration
# file, or `NaN` if the key doesn't exist in either.
getInt: (keyPath) ->
parseInt(@get(keyPath))
@@ -121,8 +121,8 @@ class Config
# defaultValue - The integer {Number} to fall back to if the value isn't
# positive, defaults to 0.
#
# Returns the value from Atom's default settings, the user's configuration file,
# or `defaultValue` if the key value isn't greater than zero.
# Returns the value from Atom's default settings, the user's configuration
# file, or `defaultValue` if the key value isn't greater than zero.
getPositiveInt: (keyPath, defaultValue=0) ->
Math.max(@getInt(keyPath), 0) or defaultValue
@@ -130,13 +130,14 @@ class Config
#
# This value is stored in Atom's internal configuration file.
#
# keyPath - The {String} name of the key
# value - The value of the setting
# keyPath - The {String} name of the key.
# value - The value of the setting.
#
# Returns the `value`.
set: (keyPath, value) ->
if @get(keyPath) != value
value = undefined if _.valueForKeyPath(@defaultSettings, keyPath) == value
if @get(keyPath) isnt value
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
value = undefined if _.isEqual(defaultValue, value)
_.setValueForKeyPath(@settings, keyPath, value)
@update()
value
@@ -146,6 +147,8 @@ class Config
# The new value will be `true` if the value is currently falsy and will be
# `false` if the value is currently truthy.
#
# keyPath - The {String} name of the key.
#
# Returns the new value.
toggle: (keyPath) ->
@set(keyPath, !@get(keyPath))
@@ -158,12 +161,30 @@ class Config
restoreDefault: (keyPath) ->
@set(keyPath, _.valueForKeyPath(@defaultSettings, keyPath))
# Public: Get the default value of the key path.
#
# keyPath - The {String} name of the key.
#
# Returns the default value.
getDefault: (keyPath) ->
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
_.deepClone(defaultValue)
# Public: Is the key path value its default value?
#
# keyPath - The {String} name of the key.
#
# Returns a {Boolean}, `true` if the current value is the default, `false`
# otherwise.
isDefault: (keyPath) ->
not _.valueForKeyPath(@settings, keyPath)?
# Public: Push the value to the array at the key path.
#
# keyPath - The {String} key path.
# value - The value to push to the array.
#
# Returns the new array length of the setting.
# Returns the new array length {Number} of the setting.
pushAtKeyPath: (keyPath, value) ->
arrayValue = @get(keyPath) ? []
result = arrayValue.push(value)
@@ -175,7 +196,7 @@ class Config
# keyPath - The {String} key path.
# value - The value to shift onto the array.
#
# Returns the new array length of the setting.
# Returns the new array length {Number} of the setting.
unshiftAtKeyPath: (keyPath, value) ->
arrayValue = @get(keyPath) ? []
result = arrayValue.unshift(value)
@@ -225,9 +246,9 @@ class Config
callback(value) if options.callNow ? true
subscription
# Public: Unobserve all callbacks on a given key
# Public: Unobserve all callbacks on a given key.
#
# keyPath - The {String} name of the key to unobserve
# keyPath - The {String} name of the key to unobserve.
unobserve: (keyPath) ->
@off("updated.#{keyPath.replace(/\./, '-')}")
+1 -1
Ver Arquivo
@@ -18,7 +18,7 @@ class ContextMenuManager
label: 'Inspect Element'
command: 'application:inspect'
executeAtBuild: (e) ->
@.commandOptions = x: e.pageX, y: e.pageY
@commandOptions = x: e.pageX, y: e.pageY
]
# Public: Creates menu definitions from the object specified by the menu
+13
Ver Arquivo
@@ -0,0 +1,13 @@
React = require 'react'
{div} = require 'reactionary'
module.exports =
CursorComponent = React.createClass
displayName: 'CursorComponent'
render: ->
{top, left, height, width} = @props.cursor.getPixelRect()
className = 'cursor'
className += ' blink-off' if @props.blinkOff
div className: className, style: {top, left, height, width}
+33 -12
Ver Arquivo
@@ -1,5 +1,5 @@
{Point, Range} = require 'text-buffer'
{Emitter} = require 'emissary'
{Model} = require 'theorist'
_ = require 'underscore-plus'
# Public: The `Cursor` class represents the little blinking line identifying
@@ -8,9 +8,7 @@ _ = require 'underscore-plus'
# Cursors belong to {Editor}s and have some metadata attached in the form
# of a {Marker}.
module.exports =
class Cursor
Emitter.includeInto(this)
class Cursor extends Model
screenPosition: null
bufferPosition: null
goalColumn: null
@@ -18,7 +16,8 @@ class Cursor
needsAutoscroll: null
# Instantiated by an {Editor}
constructor: ({@editor, @marker}) ->
constructor: ({@editor, @marker, id}) ->
@assignId(id)
@updateVisibility()
@marker.on 'changed', (e) =>
@updateVisibility()
@@ -27,7 +26,12 @@ class Cursor
{textChanged} = e
return if oldHeadScreenPosition.isEqual(newHeadScreenPosition)
# Supports old editor view
@needsAutoscroll ?= @isLastCursor() and !textChanged
# Supports react editor view
@autoscroll() if @needsAutoscroll and @editor.manageScrollPosition
@goalColumn = null
movedEvent =
@@ -38,7 +42,7 @@ class Cursor
textChanged: textChanged
@emit 'moved', movedEvent
@editor.emit 'cursor-moved', movedEvent
@editor.cursorMoved(movedEvent)
@marker.on 'destroyed', =>
@destroyed = true
@editor.removeCursor(this)
@@ -54,6 +58,9 @@ class Cursor
unless fn()
@emit 'autoscrolled' if @needsAutoscroll
getPixelRect: ->
@editor.pixelRectForScreenRange(@getScreenRange())
# Public: Moves a cursor to a given screen position.
#
# screenPosition - An {Array} of two numbers: the screen row, and the screen
@@ -69,6 +76,10 @@ class Cursor
getScreenPosition: ->
@marker.getHeadScreenPosition()
getScreenRange: ->
{row, column} = @getScreenPosition()
new Range(new Point(row, column), new Point(row, column + 1))
# Public: Moves a cursor to a given buffer position.
#
# bufferPosition - An {Array} of two numbers: the buffer row, and the buffer
@@ -84,6 +95,9 @@ class Cursor
getBufferPosition: ->
@marker.getHeadBufferPosition()
autoscroll: ->
@editor.scrollToScreenRange(@getScreenRange())
# Public: If the marker range is empty, the cursor is marked as being visible.
updateVisibility: ->
@setVisible(@marker.getBufferRange().isEmpty())
@@ -124,13 +138,13 @@ class Cursor
# Public: Identifies if the cursor is surrounded by whitespace.
#
# "Surrounded" here means that all characters before and after the cursor is
# whitespace.
# "Surrounded" here means that the character directly before and after the
# cursor are both whitespace.
#
# Returns a {Boolean}.
isSurroundedByWhitespace: ->
{row, column} = @getBufferPosition()
range = [[row, Math.min(0, column - 1)], [row, Math.max(0, column + 1)]]
range = [[row, column - 1], [row, column + 1]]
/^\s+$/.test @editor.getTextInBufferRange(range)
# Public: Returns whether the cursor is currently between a word and non-word
@@ -315,12 +329,14 @@ class Cursor
# :includeNonWordCharacters - A {Boolean} indicating whether to include
# non-word characters in the default word regex.
# Has no effect if wordRegex is set.
# :allowPrevious - A {Boolean} indicating whether the beginning of the
# previous word can be returned.
#
# Returns a {Range}.
getBeginningOfCurrentWordBufferPosition: (options = {}) ->
allowPrevious = options.allowPrevious ? true
currentBufferPosition = @getBufferPosition()
previousNonBlankRow = @editor.buffer.previousNonBlankRow(currentBufferPosition.row)
previousNonBlankRow = @editor.buffer.previousNonBlankRow(currentBufferPosition.row) ? 0
scanRange = [[previousNonBlankRow, 0], currentBufferPosition]
beginningOfWordPosition = null
@@ -330,7 +346,12 @@ class Cursor
if not beginningOfWordPosition?.isEqual(currentBufferPosition)
stop()
beginningOfWordPosition or currentBufferPosition
if beginningOfWordPosition?
beginningOfWordPosition
else if allowPrevious
new Point(0, 0)
else
currentBufferPosition
# Public: Retrieves buffer position of previous word boundary. It might be on
# the current word, or the previous word.
@@ -444,7 +465,7 @@ class Cursor
getCurrentParagraphBufferRange: ->
@editor.languageMode.rowRangeForParagraphAtBufferRow(@getBufferRow())
# Public: Returns the characters preceeding the cursor in the current word.
# Public: Returns the characters preceding the cursor in the current word.
getCurrentWordPrefix: ->
@editor.getTextInBufferRange([@getBeginningOfCurrentWordBufferPosition(), @getBufferPosition()])

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