Comparar commits

..

363 Commits

Autor SHA1 Mensagem Data
Ben Ogle ec5cd6a68e Add method organization docs 2014-08-19 19:09:56 -06:00
Ben Ogle 0fc94faf29 Changes based on feedback 2014-08-01 11:03:13 -07:00
Ben Ogle de2d9739c8 Initial API guidelines doc 2014-07-31 12:33:59 -07:00
Kevin Sawicki a4fe594441 Upgrade to apm 0.87 2014-07-30 17:42:32 -07:00
Kevin Sawicki 9d0e46126b Upgrade to language-coffee-script@0.28 2014-07-30 16:24:54 -07:00
Kevin Sawicki cb1bb4a691 Upgrade to apm 0.86 2014-07-30 10:55:18 -07:00
Kevin Sawicki d3a24c3749 Upgrade to runas 1.0.1 2014-07-30 10:54:23 -07:00
Kevin Sawicki 092849835e Upgrade to pathwatcher 2.0.6 2014-07-30 10:49:45 -07:00
Nathan Sobo b24ade4de5 Upgrade to React 0.11.1 2014-07-29 21:26:21 -06:00
Nathan Sobo 0f77a2eef9 Only unmount ReactEditorView's component before removing if its mounted
Fixes #3108

Unmounting the component the first time can cause a focusout event,
which leads to a redundant removal and an attempt to unmount again. This
protects against that.
2014-07-29 20:02:01 -06:00
Kevin Sawicki 662c2fc9d3 Upgrade to apm 0.85 2014-07-29 17:22:13 -07:00
Kevin Sawicki 510b1a7068 Upgrade to symbols-view@0.63 2014-07-29 17:22:13 -07:00
Kevin Sawicki c4f9914df6 Upgrade to scrollbar-style 1.0.1 2014-07-29 17:22:13 -07:00
Kevin Sawicki 2140ce3beb Upgrade to pathwatcher 2.0.5 2014-07-29 17:22:13 -07:00
Kevin Sawicki a597bca75e Upgrade to oniguruma 3.0.3 2014-07-29 17:22:12 -07:00
Kevin Sawicki 2895aae121 Upgrade to spell-check@0.40 2014-07-29 17:22:12 -07:00
Kevin Sawicki 4e20d93f03 Upgrade to oniguruma 3.0.2 2014-07-29 17:22:12 -07:00
Kevin Sawicki 1cc4e2e045 Upgrade to nslog@1.0.1 2014-07-29 17:22:12 -07:00
Kevin Sawicki 9fb427c468 Upgrade to git-utils 2.1.3 2014-07-29 17:22:12 -07:00
Nathan Sobo a9bd061144 Un-f 2014-07-29 16:52:21 -06:00
Nathan Sobo 0736b28abf Merge pull request #3102 from dmnd/export-atom-react
Export Atom's version of React and Reactionary
2014-07-29 15:43:53 -06:00
Ben Ogle 9ac5b67b6e Merge pull request #3121 from atom/bo-style-mini
Style mini editors
2014-07-29 13:39:49 -07:00
Ben Ogle 25601d691d Pull the mini editor styles out from react rule 2014-07-29 13:07:07 -07:00
Ben Ogle 0d1c11764b Upgrade dark-ui theme for new variable 2014-07-29 12:54:49 -07:00
Ben Ogle 729ff461f1 Upgrade settings-view for mini editor changes 2014-07-29 12:46:01 -07:00
Ben Ogle 0360a1918c Upgrade atom-light-ui for mini editor fixes 2014-07-29 12:33:01 -07:00
Ben Ogle 23f21bcda2 Style the mini editors for a constant height
Adds an @input-font-size variable.
2014-07-29 12:31:34 -07:00
Ben Ogle 800d65e3de Absolutify the placeholder text in mini editors.
Fixes #3118
2014-07-29 12:19:16 -07:00
Ben Ogle 5ce9b3ac55 Upgrade solarized syntax themes for scala support 2014-07-29 10:37:11 -07:00
Kevin Sawicki f86191dff8 Upgrade to incompatible-packages@0.3 2014-07-29 09:26:38 -07:00
Cheng Zhao 412793697f Merge pull request #3112 from atom/chrome36
Upgrade to Chrome36
2014-07-29 14:44:34 +08:00
Cheng Zhao 3274ef9fb9 Upgrade to atom-shell@0.15.0 2014-07-29 14:27:32 +08:00
Nathan Sobo f8e2231dfc Increase overdraw margin to avoid intermittent full screen repaints
On Chromium 35, the screen seems to be full-screen painting on a Cinema
Display every few frames, causing frame rates to drop from 60 to 30 when
autoscrolling with the cursor. Increasing the overdraw avoids this.
2014-07-28 21:57:06 -06:00
Nathan Sobo 837eaccd16 Remove extra nextAnimationFrame call 2014-07-28 21:53:18 -06:00
Nathan Sobo 4f3570b56b Merge pull request #3106 from atom/ns-react-css-font-styling
Apply React editor font styles via CSS instead of inline styles
2014-07-28 21:08:51 -06:00
Nathan Sobo 8918a42b3b Merge pull request #3104 from dmnd/react-dev-mode
Show detailed React errors/warnings in devMode
2014-07-28 21:02:11 -06:00
Nathan Sobo bd77a02207 Measure DOM in EditorComponent when a stylesheet is updated 2014-07-28 21:00:15 -06:00
Nathan Sobo eebbb99fc8 Handle editor font config options with a global stylesheet
Previously, each editor observed font-related config values on its own
and applied inline styles to honor them. This made it difficult to style
the editor like a normal element with CSS.

Moving this to a global stylesheet that targets editors via the .editor
selector means that the font size setting can be overridden in specific
contexts, such as when using mini editors.
2014-07-28 21:00:15 -06:00
Nathan Sobo 2b27c0b440 Only handle stylesheet changes after initial measurement 2014-07-28 20:59:28 -06:00
Nathan Sobo 8e69b0c4a0 Base font styling on the computed style of the editor element
Previously, font styling was always explicitly assigned via the config.
This commit is the first step in basing the font styling of the editor
on the styles assigned via CSS. This will allow the editor's
font-family, font-size, and line-height to be assigned via CSS just like
they are for any other element, which will make it easier to style mini
editors.

We still need to switch the font settings to adjust a global stylesheet
rather than updating inline styles on each editor individually.
2014-07-28 20:59:28 -06:00
Kevin Sawicki 532744b4eb 📝 Mention installed apm command 2014-07-28 18:49:53 -07:00
Kevin Sawicki ddd89ed6d1 📝 Remove step that is only is supported on Mac 2014-07-28 18:49:03 -07:00
Kevin Sawicki 5a53e5b96a 📝 Mark mdkeb step as optional 2014-07-28 18:48:15 -07:00
Kevin Sawicki 69f84f7e6d Merge pull request #2680 from Bengt/patch-1
individual descriptions for instructions
2014-07-28 18:46:51 -07:00
Kevin Sawicki e2c65345ab Upgrade to language-javascript@0.39 2014-07-28 18:43:32 -07:00
Bengt Lüers f47bcddf10 individual descriptions for instructions 2014-07-29 02:33:02 +02:00
Kevin Sawicki 5e19230809 Upgrade to language-javascript@0.38 2014-07-28 17:31:46 -07:00
Kevin Sawicki f8961fbd53 Upgrade to autocomplete@0.29 2014-07-28 17:19:45 -07:00
Kevin Sawicki bef750cb1f Upgrade to fs-plus 2.2.6 2014-07-28 17:11:21 -07:00
Kevin Sawicki 4e2f06aec7 Merge pull request #3098 from Bengt/patch-2
Update linux.md
2014-07-28 16:51:09 -07:00
Kevin Sawicki 02c47ba1ea 💄 2014-07-28 16:49:08 -07:00
Kevin Sawicki f6cb59be47 Merge pull request #3062 from ehuss/win32-sourcemaps
Fix source maps for CoffeeScript on Windows.
2014-07-28 16:44:06 -07:00
Kevin Sawicki 397871a012 Upgrade to language-gfm@0.44 2014-07-28 16:04:11 -07:00
Kevin Sawicki 10239e0466 Upgrade to fs-plus 2.2.5 2014-07-28 16:03:18 -07:00
Kevin Sawicki 69ef99481b Upgrade to language-source@0.8 2014-07-28 15:37:59 -07:00
Kevin Sawicki fc20de82ce Downgrade to tree-view@0.112 2014-07-28 15:34:41 -07:00
Kevin Sawicki 0232da27f5 Downgrade to symbols-view@0.62 2014-07-28 15:30:42 -07:00
Kevin Sawicki ba452e2400 Downgrade to 0.39.0 2014-07-28 15:25:07 -07:00
Kevin Sawicki 9b5b8e7528 Downgrade to snippets@0.50 2014-07-28 15:18:27 -07:00
Kevin Sawicki 6e65947d54 Downgrade to link@0.25 2014-07-28 15:12:47 -07:00
Kevin Sawicki 93c5e241f3 Downgrade to markdown-preview@0.94 2014-07-28 15:10:32 -07:00
Kevin Sawicki e0c61136a6 Upgrade to dev-live-reload@0.33 2014-07-28 15:07:50 -07:00
Kevin Sawicki c5cc13ddb3 Downgrade to bracket-matcher@0.51 2014-07-28 15:03:54 -07:00
Kevin Sawicki fd47c89f9d Add trailing .0 for consistency 2014-07-28 15:01:25 -07:00
Kevin Sawicki 34ad902cb3 Downgrade to archive-view 0.35 2014-07-28 15:00:52 -07:00
Kevin Sawicki 9678418e56 Downgrade to apm 0.84 2014-07-28 14:58:49 -07:00
Kevin Sawicki 691d6c3b5f Merge pull request #3032 from atom/chrome35
Upgrade to Chrome 35
2014-07-28 14:52:34 -07:00
Kevin Sawicki 431555195a Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-28 14:40:14 -07:00
Kevin Sawicki b0aa5e6c88 Prepare 0.121 2014-07-28 14:36:07 -07:00
Kevin Sawicki b3c2417578 Upgrade to exception-reporting@0.19 2014-07-28 14:08:13 -07:00
Nathan Sobo 7f882b00f5 Don't allow updates to be requested for unmounted components
In 444c18be34, I stopped polling the DOM
when an update was pending to prevent delay of the next animation frame.

Unfortunately, we rely on synchronously polling the DOM when an editor
view is attached to perform the initial measurement of the default char
width, which is required to position the wrap guide.

In componentWillMount, observing the config was requesting an update,
causing us to skip this synchronous update at attachment time and
position the wrap guide wrong.

This prevents update requests that occur before mount from pausing the
polling that we perform on attachment, restoring correct function to the
wrap guide.
2014-07-28 14:42:35 -06:00
Nathan Sobo 3a9aa80914 Add ReactEditorView::lineElementForScreenRow shim 2014-07-28 11:36:40 -06:00
Kevin Sawicki 3af3a0d27e Upgrade to incompatible-packages@0.2 2014-07-28 10:25:08 -07:00
Kevin Sawicki 7e415ffdb7 Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-28 09:02:38 -07:00
Kevin Sawicki e70c696fef Upgrade to tabs@0.48 2014-07-28 09:00:54 -07:00
Kevin Sawicki b2258d9b8a Merge pull request #3096 from marcbachmann/patch-1
Remove duplicate addUrlToOpen() in browser/main.coffee
2014-07-28 08:51:18 -07:00
Kevin Sawicki 40eab806c4 Upgrade to base16-tomorrow-light-theme@0.4 2014-07-28 08:49:28 -07:00
Kevin Sawicki 319455f2da Upgrade to language-xml@0.17 2014-07-28 08:45:18 -07:00
Kevin Sawicki 63867ba803 Upgrade to language-go@0.16 2014-07-28 08:43:52 -07:00
Desmond Brand 65ffd21574 Show detailed React errors/warnings in devMode
Fixes #3099.

React development mode has a lot of useful warnings and exceptions. These don't
show up in production mode. This change puts React into dev mode when Atom is
run via `atom --dev`.
2014-07-27 16:10:47 -07:00
Nathan Sobo 393552a4b6 Take cursors off the GPU and position them on the lines layer
The compositor overhead is not worth it.
2014-07-27 11:47:33 -06:00
Nathan Sobo 444c18be34 Stop polling when an update is pending 2014-07-27 11:46:22 -06:00
Nathan Sobo dca096b8e3 Use requestAnimationFrame to batch updates in Chrome 35
In Chrome 31, setImmediate was yielding better behavior. But now Chrome
35 seems to behave more smoothly when we use requestAnimationFrame, and
the delay for keystrokes is non-existent.
2014-07-27 11:46:22 -06:00
Nathan Sobo 57a03e7884 Kill dummy highlight component now that Chrome 35 fixes render artifact
Previously, removing the last highlight caused rendering artifacts.
Chrome 35 no longer exhibits this problem so we can remove this
workaround.
2014-07-27 11:46:22 -06:00
Cheng Zhao fe1819f587 Revert "Don't start crash reporter on Windows."
This reverts commit 684f15ab89.
2014-07-27 11:07:36 +08:00
Cheng Zhao aa157af93e Upgrade to atom-shell@0.14.3 2014-07-27 11:07:07 +08:00
Desmond Brand 0e58e03de7 Export Atom's version of React and Reactionary
Fixes #3101 and works around facebook/react#1939.
2014-07-26 17:49:51 -07:00
Bengt Lüers e011c80b07 Update linux.md
Add step for checking out the latest release by git tag.
2014-07-26 18:44:38 +02:00
Marc Bachmann 9ae007a6d7 Remove duplicate addUrlToOpen() in browser/main.coffee
I don't think that this was the desired behaviour.
I do not know if that caused a bug.
2014-07-26 10:54:15 +02:00
Kevin Sawicki 9dc59b9807 💄 2014-07-25 17:12:03 -07:00
Kevin Sawicki 15689ebfb5 📝 2014-07-25 17:11:33 -07:00
Kevin Sawicki 6250419fcb containsNativeModule -> isNativeModule 2014-07-25 17:09:46 -07:00
Kevin Sawicki 70621afe62 📝 2014-07-25 17:08:10 -07:00
Kevin Sawicki 6f29710d88 Upgrade to incompatible-packages@0.1 2014-07-25 17:00:17 -07:00
Kevin Sawicki 7b07d7116b Store string in local storage 2014-07-25 16:06:35 -07:00
Kevin Sawicki f175086865 Always return boolean from Package::isCompatible 2014-07-25 15:56:09 -07:00
Kevin Sawicki c6071a9802 Don't throw incompatible error, log instead 2014-07-25 15:49:34 -07:00
Kevin Sawicki ac138c1dc8 Throw error when activating incompatible package 2014-07-25 15:46:35 -07:00
Kevin Sawicki 85b7261d31 Don't store incompatible packages in custom object
The info is on the Package object itself to the loaded/activated
packages can just be iterated over.
2014-07-25 15:36:09 -07:00
Kevin Sawicki d47348e8f9 Cache incompatible modules in local storage 2014-07-25 15:34:03 -07:00
Kevin Sawicki 56df7bdbe3 Add version to package 2014-07-25 15:23:36 -07:00
Kevin Sawicki 1ea909d4db Check installed packages for working native modules
Test require each native module in each installed package to make sure
it can be required successfully in Atom.
2014-07-25 15:19:16 -07:00
Ben Ogle c748fc49bb Fix split-selection-into-lines
Don’t create cursor on last row when selection on row is empty


Fixes #1704
Closes #3080
2014-07-25 11:29:40 -07:00
Ivan Žužak 3bd1ec08e1 Upgrade to settings-view@0.136.0 2014-07-25 18:19:54 +02:00
Kevin Sawicki caa6f9b06e Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-25 09:19:44 -07:00
Kevin Sawicki 32045a3f22 Prepare 0.120 2014-07-25 09:17:23 -07:00
Kevin Sawicki 736952d0a2 Upgrade to language-c@0.26 2014-07-25 08:38:35 -07:00
Cheng Zhao 684f15ab89 Don't start crash reporter on Windows.
It is causing crashes on Windows, before it is fixed in atom-shell we
temporarily disable the crash reporter.
2014-07-25 23:28:29 +08:00
Cheng Zhao 4238e031da Upgrade to atom-shell@0.14.2 2014-07-25 23:27:03 +08:00
Kevin Sawicki a457d8a849 Upgrade to symbols-view@0.61 2014-07-24 20:10:16 -07:00
Kevin Sawicki 0b3c0fc622 Upgrade to release-notes@0.36 2014-07-24 18:31:09 -07:00
Nathan Sobo a3d82e9414 Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-24 18:14:11 -07:00
Nathan Sobo 37165f3293 Invoke pollDOM after attach so character width is calculated
Now that we mount the react component in the constructor of the wrapper
view, it's never actually visible at the time of mount. By invoking
pollDOM manually after attaching and before emitting the attach event,
the character width is available for the wrap guide to calculate its
initial position.
2014-07-24 18:12:02 -07:00
Kevin Sawicki f2507fc9d4 Upgrade to bracket-matcher@0.50 2014-07-24 17:46:05 -07:00
Nathan Sobo 7515fd94ba Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-24 17:40:37 -07:00
Nathan Sobo 8cc1029bbf Merge pull request #3077 from atom/ns-fix-scroll-perf-regression
Fix performance regression caused by transparent backgrounds on lines and gutter
2014-07-24 17:37:54 -07:00
Nathan Sobo 85363f8eaa Resample background colors whenever stylesheets change
This prevents a flicker that occurred on theme changes when we just
detected this via polling. I'm going to leave the polling as a catch-all
in case the editor is styled inline in some way.
2014-07-24 17:25:04 -07:00
Kevin Sawicki c5b3f18783 Upgrade to bracket-matcher@0.49 2014-07-24 17:24:41 -07:00
Nathan Sobo 7738eeeacc Give the line-numbers div an opaque background for better GPU perf
We sample both the background color of the editor and the gutter. If the
gutter has an actual background color, we use it. Otherwise we fall back
to the same background as the editor.
2014-07-24 17:23:04 -07:00
Nathan Sobo c6116468e4 Apply background color of root editor node to lines as an inline style
This ensures lines have an opaque background that matches whatever the
editor is styled as, but avoids the need to apply the .editor-colors
class to the .lines div. That approach fell down when people were
setting the background color via means other than .editor-colors, such
as styling mini editors via the .editor.mini selector in the settings
view.
2014-07-24 16:54:01 -07:00
Nathan Sobo 2a2d0b60f7 💄 2014-07-24 16:41:25 -07:00
Kevin Sawicki 9a5fddbcbb Upgrade to timecop@0.22 2014-07-24 16:35:32 -07:00
Kevin Sawicki 25c737de56 Upgrade to settings-view@0.135 2014-07-24 16:27:15 -07:00
Kevin Sawicki 8ad8be2583 Merge branch 'master' into chrome35 2014-07-24 14:53:24 -07:00
Nathan Sobo f29f8e37d1 Merge pull request #3071 from atom/ns-react-select-list-editor
Use React for select list mini editors when config option is toggled
2014-07-24 14:36:38 -07:00
Kevin Sawicki b922f01257 Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-24 14:17:17 -07:00
Nathan Sobo c1ec87c41b Don't apply special styles React mini editors 2014-07-24 12:57:12 -07:00
Nathan Sobo c8aea97f16 Use ReactEditorView in SelectListView when flag is enabled 2014-07-24 12:57:12 -07:00
Nathan Sobo c9587a8638 Mount EditorComponent as soon as ReactEditorView is constructed
...instead of waiting for it to be attached. This makes it simpler to
get shim references when using ReactEditorView for mini editors.
2014-07-24 12:57:12 -07:00
Kevin Sawicki 15fc7a8bc5 Upgrade to tabs@0.47 2014-07-24 12:23:25 -07:00
Kevin Sawicki 76eb3b4c72 Prepare 0.119 2014-07-24 12:16:28 -07:00
Kevin Sawicki c03d34f535 Upgrade to language-c@0.25 2014-07-24 11:21:32 -07:00
Kevin Sawicki 7cfdcf0c1b Start caching compiled CSON files
Compiling CSON takes ~45 seconds so only compile files that aren't
in cache speeding up the build once the cache is primed.
2014-07-24 10:40:37 -07:00
Nathan Sobo d3a46b6bc9 Don't try to update lines/line numbers until after initial measurement
Fixes #3047
2014-07-24 10:27:38 -07:00
Kevin Sawicki cc27f2dbb6 Remove spaces around = 2014-07-24 09:35:44 -07:00
Kevin Sawicki 54ce852be4 Store nohup.out in ~/.atom
Storing it in the temp directory can lead to permissions issues when
Atom is run by multiple users.

Closes #3056
2014-07-24 09:27:47 -07:00
Cheng Zhao 83ad1fe8af Upgrade to atom-shell@0.14.1 2014-07-24 23:37:00 +08:00
Cheng Zhao dcbf730129 Merge branch 'master' into chrome35
Conflicts:
	apm/package.json
	package.json
2014-07-24 17:17:35 +08:00
Cheng Zhao 39868a2330 Make atom.setSize synchronous. 2014-07-24 16:29:20 +08:00
Kevin Sawicki 5d00ca8bb6 Check platform not env 2014-07-23 20:03:02 -07:00
Eric Huss 772726ca96 Fix source maps for CoffeeScript on Windows.
The sourceURL needs to be a URL, not a file path.
2014-07-23 16:49:53 -07:00
Ben Ogle 00275d95ec Merge pull request #3044 from atom/bo-h-scrollbar
Horizontal scrollbar no longer covers the gutter
2014-07-23 16:35:02 -07:00
Ben Ogle 242df788e6 Remove unnecessary scrollbar specs 2014-07-23 16:25:24 -07:00
Ben Ogle 3295b9b0dd Romove runSetImmediateCallbacks() in many cases
This is because of the removal of the gutter measurement. When there 
was measurement, every load of the editor would measure and request at 
least one render based on the reset of the gutter width. These 
specs don’t need to call runSetImmediateCallbacks() as they either 
don’t do anything to cause a render or they render immediately
(in the case of updated options).

In some cases, we need to make sure nothing happened, so I added a
hasSetImmediateCallbacks() function, which is used in specs where 
nothing should have happened.
2014-07-23 16:25:10 -07:00
Ben Ogle 2a9c78ef92 Move horiz scrollbar into the scrollView
Also remove all the gutter width calculation. It was flawed anyway,
2014-07-23 16:20:48 -07:00
Kevin Sawicki a896d71948 Upgrade to language-c@0.24 2014-07-23 15:37:24 -07:00
Kevin Sawicki e3e0df7728 Upgrade to language-javascript@0.37 2014-07-23 15:34:50 -07:00
probablycorey 0acd3ebd4b Use Tab instead of Buffer in menu items.
Closes #1645
2014-07-23 13:55:29 -07:00
Kevin Sawicki 82f0a68419 Upgrade to snippets@0.49 2014-07-23 13:03:14 -07:00
Kevin Sawicki 9a95c3acef Upgrade to language-go@0.15 2014-07-23 12:31:28 -07:00
Kevin Sawicki 22eb16352c Add more config file items to File menu 2014-07-23 11:30:00 -07:00
Kevin Sawicki 5355310cc7 Upgrade to apm 0.83 2014-07-23 10:59:26 -07:00
Kevin Sawicki 9f9ca0a2cf Don't dedupe node-gyp
npm has hard-coded paths to it so it can't be moved up.
2014-07-23 10:45:21 -07:00
Kevin Sawicki 29970acaa9 📝 Document second argument of callback 2014-07-23 10:29:46 -07:00
Kevin Sawicki 8c0b9017c2 Merge pull request #2982 from atom/ks-file-diet
Remove unneeded files from distribution
2014-07-23 10:27:29 -07:00
Kevin Sawicki e9890810d3 Don't include more dot files 2014-07-23 10:11:03 -07:00
Kevin Sawicki 0e201d539a Sort by name when type count is the same 2014-07-23 10:11:03 -07:00
Kevin Sawicki 6a0e7cfb24 Add task to output file types in build folder 2014-07-23 10:11:03 -07:00
Kevin Sawicki e13defc0f7 Don't include broken symlinks 2014-07-23 10:11:03 -07:00
Kevin Sawicki 3326cf357f Dedupe semver in apm 2014-07-23 10:11:03 -07:00
Kevin Sawicki 9c78b9832b Dedupe node-gyp in apm 2014-07-23 10:11:02 -07:00
Kevin Sawicki 662b8b30a1 Don't include pegjs when grammars are precompiled 2014-07-23 10:11:02 -07:00
Kevin Sawicki caa15e42ac Don't include npm docs 2014-07-23 10:11:02 -07:00
Kevin Sawicki 75410e07da Don't include .node.dSYM folders 2014-07-23 10:11:02 -07:00
Kevin Sawicki 72727c2a81 Don't include generated Makefiles 2014-07-23 10:11:02 -07:00
Kevin Sawicki adaee84933 Remove unused fixtures 2014-07-23 10:11:02 -07:00
Kevin Sawicki d761684212 Don't include nan 2014-07-23 10:11:02 -07:00
Kevin Sawicki 307d4984a2 Don't include binding.gyp files 2014-07-23 10:11:02 -07:00
Kevin Sawicki 09711d5a88 Don't include target.mk or linker.lock files 2014-07-23 10:11:02 -07:00
Kevin Sawicki 2e1239345e Don't include bootstrap site files 2014-07-23 10:11:02 -07:00
Kevin Sawicki 8d6325b081 Don't include benchmark folders 2014-07-23 10:11:02 -07:00
Kevin Sawicki 8a8144defa Upgrade to dev-live-reload@0.32 2014-07-23 10:11:01 -07:00
Kevin Sawicki ed867666ed Specify regex directly as filter 2014-07-23 10:11:01 -07:00
Kevin Sawicki 84ff28ee69 Remove unused package fixtures 2014-07-23 10:11:01 -07:00
Kevin Sawicki 97f032c66f Make e optional in test regex 2014-07-23 10:11:01 -07:00
Kevin Sawicki 18ea3bcb99 Don't include atom-shell's default_app folder 2014-07-23 10:11:01 -07:00
Kevin Sawicki 8da4ed147b Don't include .travis.yml and .npmignore files 2014-07-23 10:11:01 -07:00
Kevin Sawicki edd1f46ad2 Don't include more build files 2014-07-23 10:11:01 -07:00
Kevin Sawicki cfb1501720 Remove unused replication fixture 2014-07-23 10:11:01 -07:00
Kevin Sawicki 17ceb34140 Don't include jasmine-node/spec files 2014-07-23 10:11:01 -07:00
Kevin Sawicki c551b58490 Update comment with .h files 2014-07-23 10:11:01 -07:00
Kevin Sawicki 6c736ace1a Don't include .h files from native modules 2014-07-23 10:11:01 -07:00
Kevin Sawicki 4ff2429f71 Don't include .cc files from native modules 2014-07-23 10:11:00 -07:00
Kevin Sawicki 01499fe674 Uncomment grunt.task.run call 2014-07-23 10:11:00 -07:00
Kevin Sawicki c4d26f6405 Filter example files from built app 2014-07-23 10:11:00 -07:00
Kevin Sawicki bd93f243dc Filter out all test and tests folders
Prevent all test/tests folders from ending up in the built
app instead of an explicit and ever-growing list
2014-07-23 10:11:00 -07:00
Kevin Sawicki 1663315323 Merge pull request #3049 from dsandstrom/add-linux-select-line-key
Add key binding for select-line to linux and win keymaps
2014-07-23 10:08:01 -07:00
Ben Ogle ffb041a160 Only render an nbsp on empty lines when no eol character defined
Fixes #3053
2014-07-23 09:30:52 -07:00
Kevin Sawicki f5f9de1bf8 Upgrade to tabs@0.46 2014-07-23 08:26:28 -07:00
Darrell Sandstrom 2f47e8a462 Add key binding for select-line to linux and win keymaps 2014-07-22 22:48:27 -07:00
Kevin Sawicki 119b446c3b Upgrade to language-c@0.23 2014-07-22 20:31:21 -07:00
Kevin Sawicki c2042ad74a Upgrade to apm 0.82 2014-07-22 18:40:50 -07:00
Ben Ogle 361f8ec770 Add specs for toggling the gutter when the editor is hidden 2014-07-22 18:26:58 -07:00
Ben Ogle 48a5123202 💄 Move logic into measureGutterIfNeeded 2014-07-22 18:26:58 -07:00
Ben Ogle 0f1d155685 Move gutterWidth into state; add specs for scrollbar position 2014-07-22 18:26:58 -07:00
Ben Ogle d3a6e79428 The horizontal scrollbar takes gutter width into account 2014-07-22 18:26:58 -07:00
Kevin Sawicki 5f7f5b5367 Merge branch 'master' into chrome35 2014-07-22 17:56:24 -07:00
Kevin Sawicki 2fe647c950 Store atom-shell cache in ~/.atom/atom-shell
There were several CI failures today where it seemed like the
atom-shell version in the temp directory wasn't complete, it was
missing many files causing the build to fail when the specs were
run.

What made this worse was that running script/clean on these machines
didn't clean out these bad versions since the temp directory was different
when run via Jenkins vs. ssh'ing into the machines so the folders were
left there and the builds kept failing.

Atom already stores the compile cache to ~/.atom as well as the node cache
so putting atom-shell there as well keeps things consistent.
2014-07-22 17:44:41 -07:00
Kevin Sawicki 683f8e06f8 Upgrade to underscore-plus@1.5.1 2014-07-22 15:57:49 -07:00
Kevin Sawicki bc4173f856 Remove logging of screen lines in spec 2014-07-22 14:51:13 -07:00
Kevin Sawicki 8443f0e2b9 Merge pull request #3042 from kubekhrm/patch-1
Added Ctrl-Shift-Z for Linux Redo.
2014-07-22 14:46:09 -07:00
Kube Khrm b9e2c47321 Added Ctrl-Shift-Z for Linux Redo. 2014-07-22 23:41:51 +02:00
Kevin Sawicki 8099c46c8e Use OnigRegExp::testSync 2014-07-22 14:38:08 -07:00
probablycorey a3f046b948 Fix getVersion spec 2014-07-22 14:10:29 -07:00
probablycorey 911ca0d846 Remove Atom.isReleasedVersion 2014-07-22 14:10:29 -07:00
probablycorey 88d1ba2271 Remove Atom.getVersion() 2014-07-22 14:10:29 -07:00
Kevin Sawicki bbfd9b8178 Use testSync instead of test 2014-07-22 14:08:40 -07:00
Kevin Sawicki 3818dee175 Prepare 0.118 2014-07-22 13:48:53 -07:00
Kevin Sawicki 6d34de68ac Add Sync suffix to oniguruma methods 2014-07-22 13:31:52 -07:00
Kevin Sawicki 10fb929a1b Upgrade to first-mate@2.0.1 2014-07-22 13:24:39 -07:00
Ben Ogle d1a610dcb6 Merge pull request #2919 from atom/bo-the-wiggle
Fix width too wide when softwrap enabled when editor can vertical scroll
2014-07-22 12:42:49 -07:00
Ben Ogle 17364cd528 Take the scrollbar width into account in specs 2014-07-22 11:54:26 -07:00
Ben Ogle c67f8493e0 Softwrap always takes into account the vertical scrollbar width 2014-07-22 11:52:23 -07:00
Ben Ogle 1a90588752 Visible is now a member variable. 2014-07-22 11:46:34 -07:00
Kevin Sawicki 4f4b840f67 Upgrade to language-go@0.14 2014-07-22 11:37:38 -07:00
Kevin Sawicki 77158738e6 Merge pull request #3038 from atom/ks-add-tomorrow-light-theme
Ship with tomorrow light theme
2014-07-22 11:19:48 -07:00
Kevin Sawicki 27d0743edc Upgrade to base16-tomorrow-light-theme@0.3 2014-07-22 11:10:34 -07:00
Kevin Sawicki 9aca6a4489 Upgrade to base16-tomorrow-dark-theme@0.20 2014-07-22 11:10:26 -07:00
Kevin Sawicki 866fd69008 Add tomorrow light theme to cache 2014-07-22 11:00:36 -07:00
Kevin Sawicki d9a942d6c6 Bundle base16-tomorrow-light-theme 2014-07-22 11:00:36 -07:00
Kevin Sawicki 6f0920c04b Prepare 0.117 2014-07-22 10:59:23 -07:00
Ben Ogle 2e4893c786 Be more defensive in ReactEditorView::activate
It is conceivable that a package could have a reference to a view
that is not within a pane. 

Fixes #2853
2014-07-22 10:37:37 -07:00
Nathan Sobo 5871bee791 Make spec assertions insensitive to scrollbars on Windows 2014-07-22 10:16:43 -07:00
Kevin Sawicki adea792b78 Use tmpDir variable 2014-07-22 09:24:06 -07:00
Ben Ogle 36f1ebfb6f Merge pull request #2423 from atom/cj-make-react-the-default-editor
Make react the default editor
2014-07-22 08:59:26 -07:00
Kevin Sawicki a45e38cd8a Merge pull request #2779 from atom/document-atom-io-pagination
Document pagination for atom.io/api/packages
2014-07-22 08:44:48 -07:00
Kevin Sawicki 46b95318a1 Wrap header name in backticks 2014-07-22 08:43:43 -07:00
Daniel Hengeveld 50086df804 document pagination for atom.io/api/packages 2014-07-22 08:43:10 -07:00
Cheng Zhao 52e049bedc Merge branch 'master' into chrome35
Conflicts:
	apm/package.json
	package.json
2014-07-22 10:13:40 +08:00
Cheng Zhao a6640f6da7 Upgrade to atom-shell@0.14.0 2014-07-22 09:58:53 +08:00
Ben Ogle 2f82fb2ceb Upgrade find-and-replace to fold results 2014-07-21 18:02:02 -07:00
Kevin Sawicki c50c25b2d4 Merge pull request #3031 from atom/ks-copy-desktop-file-during-install
Don't write .deb files in place
2014-07-21 17:19:10 -07:00
Kevin Sawicki 89733300a5 💄 2014-07-21 17:00:53 -07:00
Kevin Sawicki b9658e23f4 Write file using grunt API 2014-07-21 16:53:27 -07:00
Kevin Sawicki 1757ff18f2 Write control/desktop files to build dir 2014-07-21 16:52:20 -07:00
Kevin Sawicki a26cb6023e Track temp folders 2014-07-21 16:47:08 -07:00
Kevin Sawicki ccd631a934 Write control/desktop files to temp folder 2014-07-21 16:45:59 -07:00
Kevin Sawicki ab980d78d2 💄 2014-07-21 16:39:46 -07:00
Kevin Sawicki f5951425c3 grunt.file.write creates parent dirs 2014-07-21 16:39:23 -07:00
Kevin Sawicki 74992b1397 Group template variables together 2014-07-21 16:38:49 -07:00
Kevin Sawicki 4b07b803b3 Move install file var under if block 2014-07-21 16:37:42 -07:00
probablycorey 94f871e37e Make react editor the default 2014-07-21 16:33:25 -07:00
Kevin Sawicki 4a8a741ef0 Write Atom.desktop file directly from template
Previously this was written to resources/linux/Atom.desktop
which would create issues when running `sudo script/grunt install`
followed by `script/grunt mkdeb`
2014-07-21 16:30:27 -07:00
Kevin Sawicki 162d5a0e0d Map ctrl-shift-z to core:redo on Windows
Closes #2988
2014-07-21 16:09:56 -07:00
Kevin Sawicki a22cf44b49 Upgrade to git-utils 1.6
Closes atom/tree-view#53
2014-07-21 16:07:49 -07:00
Kevin Sawicki 10bad42e7a Upgrade to language-less@0.13 2014-07-21 15:28:55 -07:00
Kevin Sawicki 8a6753905c Upgrade to language-sass@0.14 2014-07-21 15:28:13 -07:00
Kevin Sawicki 73354f56f4 Upgrade to language-yaml@0.13 2014-07-21 15:28:01 -07:00
Nathan Sobo 43c9e21f1d Make setEditorHeightInLines/WidthInChars spec helpers work with React
Fixes #3019
2014-07-21 15:04:44 -07:00
Nathan Sobo ba21f0b0d8 Eliminate duplicate 'gutter' class
This was previously needed when we applied 'editor-colors' to the
line numbers to give them an opaque background in hopes of supporting
sub pixel AA, but that dream is dead for now anyway. This makes the
gutter harder to style, so I'm nixing it.
2014-07-21 14:56:09 -07:00
Nathan Sobo 0ee953fe26 Merge pull request #2955 from atom/ns-react-mini-editors
Allow React editors to be used as mini-editors with core.useReactMiniEditors option
2014-07-21 14:44:17 -07:00
Nathan Sobo a68b9a793f Don't update the GutterComponent if there's no renderedRowRange 2014-07-21 14:28:48 -07:00
Nathan Sobo fb4361e976 Guard React mini-editors with core.useReactMiniEditors feature flag
I'm not adding a default for this one so it won't show up in the
settings view unless the user sets it in their config explicitly. I'm
hoping it won't need to be flagged for very long.
2014-07-21 14:13:05 -07:00
Kevin Sawicki f9d866fa32 Upgrade to tree-view@0.111 2014-07-21 14:12:00 -07:00
Nathan Sobo 0c4da92d6b Handle hide and show entirely in the wrapper view
Enable sync updates and manually invoke the pollDOM function on the
component when we call hide/show on the wrapper view. This ensures that
we perform initial measurements when showing the editor for the first
time.
2014-07-21 14:09:16 -07:00
Kevin Sawicki 6377c7ebf4 Upgrade to fs-plus 2.2.4
Closes #2313
2014-07-21 13:54:17 -07:00
Kevin Sawicki 08ecba72e6 Upgrade to pathwatcher 1.5
Closes atom/tree-view#194
2014-07-21 13:53:58 -07:00
Nathan Sobo 38b286f989 Remove 'editor-colors' class from lines and gutter for mini editors
Having the editor-colors class on these elements was causing the theme
to be applied to lines in mini editors in the settings view, which
caused a black inset box to appear with dark syntax themes.

This was added to give the lines an opaque background which was supposed
to enable sub pixel anti-aliasing despite being on the GPU, but it
didn't seem to be working. Perhaps we can revisit this issue after the
Chrome 35 upgrade to see if sub pixel antialiasing works with opaque
backgrounds afterward.
2014-07-21 13:50:58 -07:00
Nathan Sobo df7f816c88 Move 'editor-colors' to wrapper view to support padding on mini editors 2014-07-21 13:43:00 -07:00
Nathan Sobo ca1220a682 Delay initial measurement until the editor becomes visible
Previously, these measurements were always performed when the editor
component was mounted. This didn't work in situations where the
component was mounted in a non-visible state. This commit includes a
visibility check in the resize polling we were already doing, kicking
off the measurement process as soon as the editor is visible.
2014-07-21 13:40:10 -07:00
Ben Ogle 9bb6c3cc3d Merge pull request #3022 from batjko/patch-1
Update Windows build instructions
2014-07-21 10:58:54 -07:00
Nathan Sobo 4a8ac85ffb Restrict ReactEditorView::getPane implementation 2014-07-21 10:43:32 -07:00
Nathan Sobo c4177aba3e Handle 'attributes' param to ReactEditorView 2014-07-21 10:43:31 -07:00
Nathan Sobo 3206fdce9e Add ReactEditorView::setPlaceholderText shim 2014-07-21 10:43:31 -07:00
Nathan Sobo 0346e5809a Only prevent default on mousewheel events if editor actually scrolls
This prevents mini editors from capturing scroll events.
2014-07-21 10:43:31 -07:00
Nathan Sobo 99704517bb Remove animation frame batching of mousewheel events
This doesn't seem to adversely affect the scroll experience, and it's
much simpler. I want to avoid preventing the default action of
mousewheel events if they don't actually lead to scrolling, and making
the behavior synchronous will make that a lot easier.
2014-07-21 10:43:31 -07:00
Nathan Sobo 783ef730e2 Rename EditorComponent::measureScrollView to ::measureHeightAndWidth
Since we also check if we're auto-height in this method, this name seems
like a better description of the objectives of this method.
2014-07-21 10:43:31 -07:00
Nathan Sobo e81db5d706 Pull out EditorComponent::pollDOM method
This makes the actions that we perform in the poll loop explicit, and
will prevent the accumulation of polling-related behavior in the
::measureScrollView method.
2014-07-21 10:43:31 -07:00
Nathan Sobo a0f75f1639 Determine visibility by checking offsetWidth/Height of the editor's node
This could still use some cleanup
2014-07-21 10:43:31 -07:00
Nathan Sobo d0893ccdaf Add placeholderText to React editors 2014-07-21 10:43:31 -07:00
Nathan Sobo a9c7842a50 Don't render line decorations on mini editors 2014-07-21 10:43:31 -07:00
Nathan Sobo 544c759fd1 Don't set an explicit line height on mini editors
This allows the line height to be styled via CSS. I would actually
like to allow all these properties to be assigned via CSS rather than
explicitly via the settings view, but that can be deferred until the
old editor is removed.
2014-07-21 10:43:31 -07:00
Nathan Sobo 759dbc061d Don't render invisible characters in React mini editors 2014-07-21 10:43:31 -07:00
Nathan Sobo 56c9f75e8c Add the 'mini' class to the React wrapper view for mini editors 2014-07-21 10:43:30 -07:00
Nathan Sobo 635f288050 Explicitly assign height of editor-contents when height is auto 2014-07-21 10:43:30 -07:00
Nathan Sobo cc8b7b13b3 Don't show the gutter when 'mini' is true on React editors 2014-07-21 10:43:30 -07:00
Nathan Sobo 4020ed1535 Support ReactEditorView construction with params hash 2014-07-21 10:43:30 -07:00
Nathan Sobo e999ef00e7 Base editor dimensions on the wrapper view
The goal is to make the editor behave like a standard block-level
element.

The horizontal behavior is simple: we stretch horizontally to fill our
container.

The vertical behavior is more nuanced. If an explicit height is assigned
on the wrapper view, we honor that height. But if no explicit height is
assigned, the editor stretches vertically so that its contents are
visible.

This prepares us to support mini editors, which need to be 1-line tall
without an explicit height assignment.
2014-07-21 10:43:30 -07:00
Nathan Sobo f16ea63a95 Export ReactEditorView as EditorView from 'atom' module
Also, remove a few early requires of 'exports/atom.coffee' in the spec
suite that were causing failures.
2014-07-21 10:43:30 -07:00
Kevin Sawicki 754f995c91 Upgrade to language-yaml@0.12 2014-07-21 10:34:10 -07:00
Kevin Sawicki ac8a67822e Upgrade to apm 0.81 2014-07-21 10:14:58 -07:00
Kevin Sawicki 1c7926dea6 Merge pull request #2994 from jordanbtucker/patch-1
support ctrl-shift-home/end on Windows
2014-07-21 09:13:58 -07:00
Kevin Sawicki 2bd8015a9d Merge pull request #3021 from dmnd/patch-1
Fix typo in event trigger
2014-07-21 08:51:49 -07:00
batjko 09e8aa0571 typo 2014-07-21 09:38:00 +01:00
batjko 364e06483c corrected grammar 2014-07-21 09:37:16 +01:00
batjko 2d07d6662c Update Windows build instructions
Just a few suggested changes to reflect experiences over a few months of building on several Windows machines.
- The Posix tools comment doesn't seem to be applicable (anymore)? 
- Added further instructions when using pre-installed Git.
- Added the frequent issue of first-time build failures (random `node-gyp` errors), which don't reoccur on second try.
- Added a few extra words on opening a new issue, to clarify that appropriate details should be provided, if the issue hasn't been reported before.

Feel free to amend or suggest further changes.
2014-07-21 09:33:17 +01:00
Desmond Brand 3d53749771 Fix typo in event trigger
destoryed -> destroyed
2014-07-21 00:20:39 -07:00
Cheng Zhao eeadd823e6 Upgrade to atom-keymap@1.0.0 2014-07-21 09:40:13 +08:00
Cheng Zhao 8a5bd357cd Upgrade to text-buffer@3.0.0 2014-07-21 09:39:48 +08:00
Nathan Sobo 79ee887c9a Fix a bug where scopes were being duplicated for every single token
This improves scroll performance by generating many fewer span elements
to render lines.
2014-07-20 15:09:14 -07:00
Ben Ogle 37d0a7f7e5 Merge pull request #2992 from maschs/ms-buildArch
Add build instructions for Arch
2014-07-20 11:01:02 -07:00
Ben Ogle ed4324dedc Merge pull request #3014 from Frozenfire92/patch-1
Improve Linux install instructions
2014-07-20 11:00:13 -07:00
Joel Kuntz d2da914151 Fix abbreviation 2014-07-19 14:20:32 -03:00
Joel Kuntz ca39e7f7de Fix typo 2014-07-19 13:08:24 -03:00
Joel Kuntz 7bf2b7237e Update linux.md
Improve installation instructions
2014-07-19 13:06:36 -03:00
Maximilian Schüßler c264855f87 Cleanup linux build instructions 2014-07-19 15:33:11 +02:00
Maximilian Schüßler a5f2a44a45 Arch requires export PYTHON=/usr/bin/python2 to build 2014-07-19 14:50:02 +02:00
Ben Ogle 4960a63bd8 Upgrade solarized dark for better C and py styles 2014-07-18 17:14:10 -07:00
Cheng Zhao 42621805a7 Upgrade to link@1.0.0 2014-07-18 23:10:56 +08:00
Cheng Zhao fed55b8896 Upgrade to bracket-matcher@1.0.0 2014-07-18 22:50:31 +08:00
Cheng Zhao 73daa4bb74 Upgrade to scrollbar-style@1.0.0 2014-07-18 22:24:03 +08:00
Cheng Zhao 92546c60b3 Upgrade to scandal@1.0.0 2014-07-18 22:18:11 +08:00
Cheng Zhao 2fa91e5dfb Upgrade to frist-mate@2.0.0 2014-07-18 22:06:12 +08:00
Cheng Zhao aac0913b8b Upgrade to tree-view@1.0.0 2014-07-18 21:50:06 +08:00
Cheng Zhao acc75ca859 Upgrade to symbols-view@1.0.0 2014-07-18 21:40:52 +08:00
Cheng Zhao 8eb4e13df8 Upgrade to spell-check@1.0.0 2014-07-18 21:07:47 +08:00
Cheng Zhao 087d9c1da6 Upgrade to snippets@1.0.0 2014-07-18 14:54:03 +08:00
Cheng Zhao 18336076a8 Upgrade to markdown-preview@1.0.0 2014-07-18 14:46:46 +08:00
Cheng Zhao 7fee5f5f25 Upgrade to dev-live-reload@1.0.0 2014-07-18 14:37:16 +08:00
Cheng Zhao c2f04a00d2 Upgrade to archive-view@1.0.0 2014-07-18 14:28:09 +08:00
Cheng Zhao cc927123f9 Upgrade to nslog@1.0.0 2014-07-18 11:28:03 +08:00
Cheng Zhao 97b426429b Upgrade to oniguruma@3.0.0 2014-07-18 10:16:17 +08:00
Cheng Zhao 3686530943 Upgrade to pathwatcher@2.0.2 2014-07-18 10:15:35 +08:00
Cheng Zhao 621ef450da Upgrade to runas@1.0.0 2014-07-18 10:14:56 +08:00
Cheng Zhao 1e08bcd634 Upgrade to git-utils@2.0 2014-07-18 10:14:14 +08:00
Cheng Zhao ede468d4c9 Upgrade to apm 1.0.0 2014-07-18 10:09:45 +08:00
Kevin Sawicki 1278f88dd9 Upgrade to language-gfm@0.43 2014-07-17 19:00:21 -07:00
Nathan Sobo 6faf3bd827 Merge pull request #3006 from atom/ns-abort-key-binding
Upgrade keymap to support 'abort!' directive in keybindings
2014-07-17 18:16:59 -07:00
Nathan Sobo 92a2b52f53 Upgrade keymap to support 'abort!' directive in keybindings
Closes atom/vim-mode#348
2014-07-17 18:03:51 -07:00
Kevin Sawicki 8135458670 Upgrade to whitespace@0.25 2014-07-16 21:16:47 -07:00
Kevin Sawicki 160a1cd690 Upgrade to language-ruby@0.33 2014-07-16 21:12:59 -07:00
Kevin Sawicki 2d3a133790 Upgrade to git-diff@0.37 2014-07-16 21:06:31 -07:00
jordanbtucker af5384cd51 support ctrl-shift-home/end on Windows
fixes issue #2989
2014-07-16 11:30:47 -07:00
Maximilian Schüßler 27423fcc15 Add Arch build instructions 2014-07-16 18:14:30 +02:00
Nathan Sobo cdb5fe15d2 Render nbsp on empty lines to ensure they have a non-zero height
Fixes #2958
2014-07-16 00:56:14 -07:00
Ivan Žužak 608c2b5354 Merge pull request #2977 from atom/iz-multiple-separators
Support multiple separators in context menu
2014-07-15 15:22:37 -07:00
Kevin Sawicki 121350f8e5 Upgrade to language-coffee-script@0.27 2014-07-15 11:44:50 -07:00
Kevin Sawicki 7bcc91e7d2 Upgrade to apm 0.80 2014-07-15 11:39:57 -07:00
Kevin Sawicki b192622ad8 Upgrade to language-javascript@0.36 2014-07-15 11:37:09 -07:00
Kevin Sawicki 778e6f4492 Upgrade to apm 0.79.0 2014-07-15 08:50:28 -07:00
Ben Ogle 8614777af4 Merge pull request #2943 from atom/bo-ms-fix-tab-stops
Fix tab stops for soft tabs
2014-07-15 08:45:13 -07:00
Ben Ogle cce49da18c Fix spec 2014-07-15 08:44:58 -07:00
Ben Ogle 66bfefc09d Upgrade snippets to fix specs with tab stops 2014-07-15 08:44:58 -07:00
Ben Ogle 29e883cf36 Add specs 2014-07-15 08:44:21 -07:00
Maximilian Schüßler 381d5b91b2 Indentation respects tab stops now, fix #2672 2014-07-15 08:44:21 -07:00
Ben Ogle b744997201 Merge pull request #2950 from lee-dohm/ld-bug-2274
🐛 Fix regression in indent-guide in React editor
2014-07-15 08:06:02 -07:00
Kevin Sawicki 0357872558 Use repository URL in crashed message
Now that the repository is public, issues there are better than
emailing the help address.
2014-07-15 06:25:53 -07:00
Kevin Sawicki 844186f5fc Upgrade to settings-view@0.134.0 2014-07-14 20:49:53 -07:00
Kevin Sawicki 0a818cfdd7 Map ctrl-, to application:show-settings on Windows
Refs #2962
2014-07-14 20:29:53 -07:00
Ivan Zuzak cd1a17fb0a Support multiple separators in context menu 2014-07-14 17:10:13 -07:00
Kevin Sawicki 9abab27ba7 Merge pull request #2968 from atom/ks-dont-quote-explorer-arguments
Don't quote certain explorer arguments
2014-07-14 08:03:19 -07:00
Kevin Sawicki 0faff626d1 Remove stray # 2014-07-14 07:55:28 -07:00
Kevin Sawicki c355ade477 Upgrade to tree-view@0.110.0 2014-07-14 07:55:28 -07:00
Kevin Sawicki 18818c9ba5 Special case quoting of certain explorer args
This is required for things like:

`explorer.exe /root,C:\a\folder` to spawn correctly.

Refs atom/tree-view#180
2014-07-14 07:55:28 -07:00
Kevin Sawicki b4ca3e46e6 Upgrade to language-coffee-script@0.26 2014-07-14 07:52:40 -07:00
Kevin Sawicki 262ba6be20 📝 Mention downloading .zip Windows release 2014-07-13 17:56:55 -07:00
Kevin Sawicki 50c5d12ced Upgrade to archive-view@0.34 2014-07-13 16:42:03 -07:00
Kevin Sawicki d6d51155ac Upgrade to symbols-view@0.60 2014-07-13 16:29:39 -07:00
Lee Dohm b100310764 Add failing test for #2274
Tested first on a branch off of `master` to ensure that it would
actually fail 😀
2014-07-13 13:27:32 -07:00
Lee Dohm 7ac3e6d9a5 🐛 Fix regression in indent-guide in React editor
Previously the indent guide was always showing on the whitespace only
lines in the React editor. This is the same behavior as in the old
editor and had the same fix, just ported to `LinesComponent`.

See: 314833bbac

Fixes #2274
2014-07-13 09:39:21 -07:00
Kevin Sawicki 2742995541 Upgrade to language-c@0.22 2014-07-11 16:21:46 -07:00
Ben Ogle b8c0c125a2 Merge pull request #2941 from atom/bo-fallback-vars
Import base *-variables files as fallback vars when loading packages/themes
2014-07-11 15:16:30 -07:00
Kevin Sawicki d78eb3d142 Upgrade to apm 0.78 2014-07-11 15:11:02 -07:00
Ben Ogle 36769c35fc Don’t need the absolute path, just variables
`static` is already on the path
2014-07-11 15:04:00 -07:00
Ben Ogle e6c0c38894 Upgrade to tabs to fix tab size issue 2014-07-11 14:48:56 -07:00
Ben Ogle 1f77450f7e Use less-cache@0.13.0 2014-07-11 14:22:04 -07:00
Ben Ogle c4204eb9e9 import the fallback variables in the base theme 2014-07-11 14:08:29 -07:00
Ben Ogle 9a393a6ec9 Load fallback variables in the user’s stylesheet 2014-07-11 14:08:09 -07:00
Ben Ogle bbe02fc6b0 Load packages with the fallback variables 2014-07-11 14:07:48 -07:00
Ben Ogle 9fbc6d4f02 Add cssForFile to LessCompileCache 2014-07-11 14:06:46 -07:00
Ben Ogle e620121953 Add spec for loading theme with incomplete variable file 2014-07-11 14:04:54 -07:00
Kevin Sawicki 41c8878769 📝 Add missing : 2014-07-11 13:30:30 -07:00
Kevin Sawicki d2834fa651 Prepare 0.116 2014-07-11 13:29:11 -07:00
93 arquivos alterados com 1629 adições e 1054 exclusões
-2
Ver Arquivo
@@ -13,5 +13,3 @@ debug.log
docs/output
docs/includes
spec/fixtures/evil-files/
resources/linux/Atom.desktop
resources/linux/debian/control
+4
Ver Arquivo
@@ -21,6 +21,10 @@ Install the [Atom chocolatey package](https://chocolatey.org/packages/Atom).
3. Run `cinst Atom`
4. In the future run `cup Atom` to upgrade to the latest release.
You can also download a `.zip` file from the [releases page](https://github.com/atom/atom/releases/latest).
The Windows version does not currently automatically update so you will need to
manually upgrade to future releases by re-downloading the `.zip` file.
## Building
* [Linux](docs/build-instructions/linux.md)
+1 -1
Ver Arquivo
@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.77.0"
"atom-package-manager": "0.87.0"
}
}
+7 -2
Ver Arquivo
@@ -69,6 +69,11 @@ elif [ $OS == 'Linux' ]; then
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
DOT_ATOM_DIR="$HOME/.atom"
if [ ! -d "$DOT_ATOM_DIR" ]; then
mkdir -p "$DOT_ATOM_DIR"
fi
: ${TMPDIR:=/tmp}
@@ -79,9 +84,9 @@ elif [ $OS == 'Linux' ]; then
exit $?
else
(
nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$TMPDIR/atom-nohup.out" 2>&1
nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$DOT_ATOM_DIR/nohup.out" 2>&1
if [ $? -ne 0 ]; then
cat "$TMPDIR/atom-nohup.out"
cat "$DOT_ATOM_DIR/nohup.out"
exit $?
fi
) &
+6 -1
Ver Arquivo
@@ -40,7 +40,10 @@ module.exports = (grunt) ->
appName = if process.platform is 'darwin' then 'Atom.app' else 'Atom'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
installDir = grunt.option('install-dir')
atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells')
home = if process.platform is 'win32' then process.env.USERPROFILE else process.env.HOME
atomShellDownloadDir = path.join(home, '.atom', 'atom-shell')
symbolsDir = path.join(buildDir, 'Atom.breakpad.syms')
shellAppDir = path.join(buildDir, appName)
if process.platform is 'win32'
@@ -93,6 +96,8 @@ module.exports = (grunt) ->
csonConfig =
options:
rootObject: true
cachePath: path.join(home, '.atom', 'compile-cache', 'grunt-cson')
glob_to_multiple:
expand: true
src: [
+6 -6
Ver Arquivo
@@ -14,10 +14,10 @@
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.9.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.8.0",
"grunt-cson": "0.10.0",
"grunt-download-atom-shell": "~0.8.0",
"grunt-lesslint": "0.13.0",
"grunt-markdown": "~0.4.0",
@@ -27,15 +27,15 @@
"json-front-matter": "~0.1.3",
"legal-eagle": "~0.4.0",
"minidump": "~0.7",
"read-package-json": "1.1.8",
"normalize-package-data": "0.2.12",
"npm": "~1.4.5",
"rcedit": "~0.1.2",
"read-package-json": "1.1.8",
"request": "~2.27.0",
"rimraf": "~2.2.2",
"runas": "0.5.x",
"runas": "~1.0.1",
"underscore-plus": "1.x",
"unzip": "~0.1.9",
"vm-compatibility-layer": "~0.1.0",
"npm": "~1.4.5"
"vm-compatibility-layer": "~0.1.0"
}
}
+69 -18
Ver Arquivo
@@ -14,9 +14,9 @@ module.exports = (grunt) ->
mkdir path.dirname(buildDir)
if process.platform is 'darwin'
cp 'atom-shell/Atom.app', shellAppDir
cp 'atom-shell/Atom.app', shellAppDir, filter: /default_app/
else
cp 'atom-shell', shellAppDir
cp 'atom-shell', shellAppDir, filter: /default_app/
mkdir appDir
@@ -45,29 +45,45 @@ module.exports = (grunt) ->
path.join('git-utils', 'deps')
path.join('oniguruma', 'deps')
path.join('less', 'dist')
path.join('less', 'test')
path.join('bootstrap', 'docs')
path.join('bootstrap', 'examples')
path.join('bootstrap', '_config.yml')
path.join('bootstrap', '_includes')
path.join('bootstrap', '_layouts')
path.join('npm', 'doc')
path.join('npm', 'html')
path.join('npm', 'man')
path.join('npm', 'node_modules', '.bin', 'beep')
path.join('npm', 'node_modules', '.bin', 'clear')
path.join('npm', 'node_modules', '.bin', 'starwars')
path.join('pegjs', 'examples')
path.join('plist', 'tests')
path.join('xmldom', 'test')
path.join('combined-stream', 'test')
path.join('delayed-stream', 'test')
path.join('domhandler', 'test')
path.join('fstream-ignore', 'test')
path.join('harmony-collections', 'test')
path.join('lru-cache', 'test')
path.join('minimatch', 'test')
path.join('normalize-package-data', 'test')
path.join('npm', 'test')
path.join('jasmine-reporters', 'ext')
path.join('jasmine-node', 'node_modules', 'gaze')
path.join('jasmine-node', 'spec')
path.join('node_modules', 'nan')
path.join('build', 'binding.Makefile')
path.join('build', 'config.gypi')
path.join('build', 'gyp-mac-tool')
path.join('build', 'Makefile')
path.join('build', 'Release', 'obj.target')
path.join('build', 'Release', 'obj')
path.join('build', 'Release', '.deps')
path.join('vendor', 'apm')
path.join('resources', 'mac')
path.join('resources', 'win')
# These are only require in dev mode when the grammar isn't precompiled
path.join('atom-keymap', 'node_modules', 'loophole')
path.join('atom-keymap', 'node_modules', 'pegjs')
path.join('atom-keymap', 'node_modules', '.bin', 'pegjs')
path.join('snippets', 'node_modules', 'loophole')
path.join('snippets', 'node_modules', 'pegjs')
path.join('snippets', 'node_modules', '.bin', 'pegjs')
'.DS_Store'
'.jshintrc'
'.npmignore'
'.pairs'
'.travis.yml'
]
ignoredPaths = ignoredPaths.map (ignoredPath) -> _.escapeRegExp(ignoredPath)
@@ -75,21 +91,56 @@ module.exports = (grunt) ->
ignoredPaths.push "#{_.escapeRegExp(path.join('spellchecker', 'vendor', 'hunspell') + path.sep)}.*"
ignoredPaths.push "#{_.escapeRegExp(path.join('build', 'Release') + path.sep)}.*\\.pdb"
# Ignore *.cc and *.h files from native modules
ignoredPaths.push "#{_.escapeRegExp(path.join('ctags', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('git-utils', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('keytar', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('nslog', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('oniguruma', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('pathwatcher', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('runas', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('scrollbar-style', 'src') + path.sep)}.*\\.(cc|h)*"
ignoredPaths.push "#{_.escapeRegExp(path.join('spellchecker', 'src') + path.sep)}.*\\.(cc|h)*"
# Ignore build files
ignoredPaths.push "#{_.escapeRegExp(path.sep)}binding\\.gyp$"
ignoredPaths.push "#{_.escapeRegExp(path.sep)}.+\\.target.mk$"
ignoredPaths.push "#{_.escapeRegExp(path.sep)}linker\\.lock$"
ignoredPaths.push "#{_.escapeRegExp(path.join('build', 'Release') + path.sep)}.+\\.node\\.dSYM"
# 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})"
testFolderPattern = new RegExp("#{_.escapeRegExp(path.sep)}te?sts?#{_.escapeRegExp(path.sep)}")
exampleFolderPattern = new RegExp("#{_.escapeRegExp(path.sep)}examples?#{_.escapeRegExp(path.sep)}")
benchmarkFolderPattern = new RegExp("#{_.escapeRegExp(path.sep)}benchmarks?#{_.escapeRegExp(path.sep)}")
nodeModulesFilter = new RegExp(ignoredPaths.join('|'))
filterNodeModule = (pathToCopy) ->
return true if benchmarkFolderPattern.test(pathToCopy)
pathToCopy = path.resolve(pathToCopy)
nodeModulesFilter.test(pathToCopy) or testFolderPattern.test(pathToCopy) or exampleFolderPattern.test(pathToCopy)
packageFilter = new RegExp("(#{ignoredPaths.join('|')})|(.+\\.(cson|coffee)$)")
filterPackage = (pathToCopy) ->
return true if benchmarkFolderPattern.test(pathToCopy)
pathToCopy = path.resolve(pathToCopy)
packageFilter.test(pathToCopy) or testFolderPattern.test(pathToCopy) or exampleFolderPattern.test(pathToCopy)
for directory in nonPackageDirectories
cp directory, path.join(appDir, directory), filter: nodeModulesFilter
cp directory, path.join(appDir, directory), filter: filterNodeModule
for directory in packageDirectories
cp directory, path.join(appDir, directory), filter: packageFilter
cp directory, path.join(appDir, directory), filter: filterPackage
cp 'spec', path.join(appDir, 'spec')
cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/
cp 'static', path.join(appDir, 'static')
cp 'apm', path.join(appDir, 'apm'), filter: nodeModulesFilter
cp 'apm', path.join(appDir, 'apm'), filter: filterNodeModule
if process.platform is 'darwin'
grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) ->
+10 -11
Ver Arquivo
@@ -4,17 +4,13 @@ _ = require 'underscore-plus'
fs = require 'fs-plus'
runas = null
fillTemplate = (filePath, data) ->
template = _.template(String(fs.readFileSync(filePath + '.in')))
filled = template(data)
fs.writeFileSync(filePath, filled)
module.exports = (grunt) ->
{cp, mkdir, rm} = require('./task-helpers')(grunt)
grunt.registerTask 'install', 'Install the built application', ->
installDir = grunt.config.get('atom.installDir')
shellAppDir = grunt.config.get('atom.shellAppDir')
if process.platform is 'win32'
runas ?= require 'runas'
copyFolder = path.resolve 'script', 'copy-folder.cmd'
@@ -32,7 +28,6 @@ module.exports = (grunt) ->
shareDir = path.join(installDir, 'share', 'atom')
iconName = path.join(shareDir,'resources','app','resources','atom.png')
desktopFile = path.join('resources', 'linux', 'Atom.desktop')
mkdir binDir
cp 'atom.sh', path.join(binDir, 'atom')
@@ -42,13 +37,17 @@ module.exports = (grunt) ->
# Create Atom.desktop if installation not in temporary folder
tmpDir = if process.env.TMPDIR? then process.env.TMPDIR else '/tmp'
desktopInstallFile = path.join(installDir,'share','applications','Atom.desktop')
if installDir.indexOf(tmpDir) isnt 0
mkdir path.dirname(desktopInstallFile)
desktopFile = path.join('resources', 'linux', 'Atom.desktop.in')
desktopInstallFile = path.join(installDir, 'share', 'applications', 'Atom.desktop')
{description} = grunt.file.readJSON('package.json')
installDir = path.join(installDir,'.') # To prevent "Exec=/usr/local//share/atom/atom"
fillTemplate(desktopFile, {description, installDir, iconName})
cp desktopFile, desktopInstallFile
iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png')
installDir = path.join(installDir, '.') # To prevent "Exec=/usr/local//share/atom/atom"
template = _.template(String(fs.readFileSync(desktopFile)))
filled = template({description, installDir, iconName})
grunt.file.write(desktopInstallFile, filled)
# Create relative symbol link for apm.
process.chdir(binDir)
+11 -10
Ver Arquivo
@@ -2,14 +2,17 @@ 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)
fillTemplate = (filePath, data) ->
template = _.template(String(fs.readFileSync("#{filePath}.in")))
filled = template(data)
outputPath = path.join(grunt.config.get('atom.buildDir'), path.basename(filePath))
grunt.file.write(outputPath, filled)
outputPath
grunt.registerTask 'mkdeb', 'Create debian package', ->
done = @async()
@@ -27,13 +30,11 @@ module.exports = (grunt) ->
iconName = 'atom'
data = {name, version, description, section, arch, maintainer, installDir, iconName}
control = path.join('resources', 'linux', 'debian', 'control')
fillTemplate(control, data)
desktop = path.join('resources', 'linux', 'Atom.desktop')
fillTemplate(desktop, data)
controlFilePath = fillTemplate(path.join('resources', 'linux', 'debian', 'control'), data)
desktopFilePath = fillTemplate(path.join('resources', 'linux', 'Atom.desktop'), data)
icon = path.join('resources', 'atom.png')
buildDir = grunt.config.get('atom.buildDir')
cmd = path.join('script', 'mkdeb')
args = [version, arch, control, desktop, icon, buildDir]
args = [version, arch, controlFilePath, desktopFilePath, icon, buildDir]
spawn({cmd, args}, done)
+21
Ver Arquivo
@@ -0,0 +1,21 @@
path = require 'path'
module.exports = (grunt) ->
grunt.registerTask 'output-build-filetypes', 'Log counts for each filetype in the built application', ->
shellAppDir = grunt.config.get('atom.shellAppDir')
types = {}
grunt.file.recurse shellAppDir, (absolutePath, rootPath, relativePath, fileName) ->
extension = path.extname(fileName) or fileName
types[extension] ?= 0
types[extension]++
extensions = Object.keys(types).sort (extension1, extension2) ->
diff = types[extension2] - types[extension1]
if diff is 0
extension1.toLowerCase().localeCompare(extension2.toLowerCase())
else
diff
extensions.forEach (extension) ->
grunt.log.error "#{extension}: #{types[extension]}"
+2
Ver Arquivo
@@ -9,10 +9,12 @@ module.exports = (grunt) ->
['atom-dark-ui', 'atom-light-syntax']
['atom-dark-ui', 'solarized-dark-syntax']
['atom-dark-ui', 'base16-tomorrow-dark-theme']
['atom-dark-ui', 'base16-tomorrow-light-theme']
['atom-light-ui', 'atom-light-syntax']
['atom-light-ui', 'atom-dark-syntax']
['atom-light-ui', 'solarized-dark-syntax']
['atom-light-ui', 'base16-tomorrow-dark-theme']
['atom-light-ui', 'base16-tomorrow-light-theme']
]
directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache')
+1 -1
Ver Arquivo
@@ -7,7 +7,7 @@ module.exports = (grunt) ->
grunt.fatal("Cannot copy non-existent #{source.cyan} to #{destination.cyan}")
copyFile = (sourcePath, destinationPath) ->
return if filter?.test(sourcePath)
return if filter?(sourcePath) or filter?.test?(sourcePath)
stats = fs.lstatSync(sourcePath)
if stats.isSymbolicLink()
+112
Ver Arquivo
@@ -0,0 +1,112 @@
# API Guidelines
__Note__: These are not all in practice yet. We are still sorting this out, and plan to move the entire API this way.
## General Guidelines
We should strive to have only one way to do something, and make it clear what that way is.
__Bad__
* Several ways to get the `Editor` model from the view.
* `EditorView.editor`
* `EditorView.getModel()`
* `EditorView.getEditor()`
* Delegated methods on the views when there is a model counterpart
* `Editor.toggleSoftTabs()`
* `EditorView.toggleSoftTabs()`
__Good__
* One way to get the `Editor` model from the view
* `EditorView.getModel()`
* Use the method on the model
* `Editor.toggleSoftTabs()`
* One clear way to subscribe to events
* `subscription = @subscribe thing, 'event', -> ...`
* One clear way to unsubscribe to events
* `subscription.off()` only; not `thing.off 'event', -> ...`
## Essential vs Extended
There are two groups of classes / methods. We break them up to facilitate a gentle introduction into the API and help authors build a knowledge foundation more quickly.
### Essential
These are classes, methods, and concepts nearly every package author will need to know about. Need to create commands? Subscribe to atom events? Get a reference to all the editors? Highlight a line in the editor? Patterns and methods for these things will be explained in the essential API.
We want to keep the essential API minimal and focused.
### Extended
The extended API contains The Power. Need to move one cursor independent of the others? Want to do some processing on the markers? You can do it with the extended API.
## View / Model
Operations on Views should be limited to DOM manipulation only. A package author should only need access to, say, the `EditorView` when it needs to directly modify the `EditorView`'s DOM.
## Properties
No public properties. Use methods instead.
## Methods
### Naming
We strive to fit the [Objective C][naming] naming conventions for the sake of readability.
* Be descriptive, always write out the whole word. `selection` not `sel`, `cursor` not `cur`.
* Describe the arguments names in the method name eg. `decorationsForMarker(marker)`, `objectAtIndex(index)`
* Use `get` prefix only when there are no arguments `getCursors()`, `getLastCursor()`, `cursorForMarker(marker)`
* Prefix bool methods with `is` eg. `isDefault()`
Array accessor methods would be written as follows
```coffee
getObjects()
addObject(object)
removeObject(object)
removeObjectAtIndex(index)
objectAtIndex(index)
objectsForThing(thing)
objectForThing(thing)
```
## Events
There will be no `off()` method on objects. `on()` will return a subscription object which contains the `off()` method.
* Events should be emitted with one event object as an argument, rather than a bunch of arguments.
* If an event is cancelable, it will provide a `cancel` function in the event object.
### Naming
Past tense. ???
## Documentation
Comment doc strings on methods, events, etc
* how to doc sections?
* events?
* props?
* callback args?
* option hashes?
### Method organization
* All methods in classes should be grouped into sections by usage pattern.
* Methods within a section should be ordered with the most commonly used methods at the top. `Essential` methods always go above `Extended` methods.
* Sections should be ordered in the class with the most commonly used sections at the top.
A section:
```coffee
###
Section: Reading Text
###
# Essential: Returns a {String} representing the entire contents of the editor.
getText: -> @buffer.getText()
```
[naming]:https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html
+13
Ver Arquivo
@@ -27,6 +27,10 @@ All requests that take parameters require `application/json`.
#### GET /api/packages
Parameters:
- **page** (optional)
Returns a list of all packages in the following format:
```json
[
@@ -44,6 +48,15 @@ Returns a list of all packages in the following format:
]
```
Results are paginated 30 at a time, and links to the next and last pages are
provided in the `Link` header:
```
Link: <https://www.atom.io/api/packages?page=1>; rel="self",
<https://www.atom.io/api/packages?page=41>; rel="last",
<https://www.atom.io/api/packages?page=2>; rel="next"
```
### Showing package details
#### GET /api/packages/:package_name
+38 -24
Ver Arquivo
@@ -6,38 +6,52 @@ Ubuntu LTS 12.04 64-bit is the recommended platform.
* OS with 64-bit or 32-bit architecture
* C++ toolchain
* on Ubuntu/Debian: `sudo apt-get install build-essential`
* on Fedora: `sudo yum --assumeyes install make gcc gcc-c++ glibc-devel`
* git
* [node.js](http://nodejs.org/download/) v0.10.x
* [Ubuntu/Debian/Mint instructions](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os)
* [Fedora instructions](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#fedora)
* [npm](http://www.npmjs.org/) v1.4.x
* `npm` comes with node.js so no explicit installation is needed here.
* You can check `npm` 1.4 or above is installed by running `npm -v`.
* [npm](http://www.npmjs.org/) v1.4.x (bundled with node.js)
* `npm -v` to check the version.
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses python2.
* You might need to run this command as `sudo`, depending on how you have set up [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os).
* libgnome-keyring-dev
* on Ubuntu/Debian: `sudo apt-get install libgnome-keyring-dev`
* on Fedora: `sudo yum --assumeyes install libgnome-keyring-devel`
* on other distributions refer to the manual on how to install packages
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses Python 2
* This command may require `sudo` depending on how you have
[configured npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os).
* Git
* on Ubuntu/Debian: `sudo apt-get install git`
* on Fedora: `sudo yum install git-core`
### Ubuntu / Debian
* `sudo apt-get install build-essential git libgnome-keyring-dev`
* Instructions for [node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os).
### Fedora
* `sudo yum --assumeyes install make gcc gcc-c++ glibc-devel git-core libgnome-keyring-devel`
* Instructions for [node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#fedora).
### Arch
* `sudo pacman -S base-devel git nodejs libgnome-keyring`
* `export PYTHON=/usr/bin/python2` before building Atom.
## Instructions
```sh
git clone https://github.com/atom/atom
cd atom
script/build # Creates application at $TMPDIR/atom-build/Atom
sudo script/grunt install # Installs command to /usr/local/bin/atom
script/grunt mkdeb # Generates a .deb package at $TMPDIR/atom-build
```
If you have problems with permissions don't forget to prefix with `sudo`
Create the atom application at `$TMPDIR/atom-build/Atom`:
```sh
script/build
```
Install the `atom` and `apm` commands to `/usr/local/bin`:
```sh
sudo script/grunt install
```
Generate a `.deb` package at `$TMPDIR/atom-build`: (*optional*)
```sh
script/grunt mkdeb
```
Use the newly installed atom by restarting any running atom instances.
## Troubleshooting
### Exception: "TypeError: Unable to watch path"
If you get following error with a big traceback right after Atom starts:
+15 -5
Ver Arquivo
@@ -35,10 +35,14 @@
## Why do I have to use GitHub for Windows?
You don't, You can use your existing Git! GitHub for Windows's Git Shell is just
easier to set up. You need to have Posix tools in your `%PATH%` (i.e. `grep`,
`sed`, et al.), which isn't the default configuration when you install Git. To
fix this, you probably need to fiddle with your system PATH.
You don't. You can use your existing Git! GitHub for Windows's Git Shell is just
easier to set up.
If you _prefer_ using your existing Git installation, make sure git's cmd directory is in your PATH env variable (e.g. `C:\Program Files (x86)\Git\cmd`) before you open your powershell or command window.
Note that you may have to open your command window as administrator. For powershell that doesn't seem to always be the case, though.
If none of this works, do install Github for Windows and use its Git shell. Makes life easier.
## Troubleshooting
@@ -62,5 +66,11 @@ fix this, you probably need to fiddle with your system PATH.
* https://github.com/TooTallNate/node-gyp/issues/297
* https://code.google.com/p/gyp/issues/detail?id=393
* Other `node-gyp` errors on first build attempt, even though the right node and python versions are installed.
* Do try the build command one more time, as experience shows it often works on second try in many of these cases.
### Windows build error reports in atom/atom
* Use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Awindows&type=Issues) to get a list of reports about build errors on Windows.
* If all fails, use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Awindows&type=Issues) to get a list of reports about build errors on Windows, and see if yours has already been reported.
* If it hasn't, please open a new issue with your Windows version 32/64bit and a print/screenshot of your build output, incl. the node and python versions.
+3 -2
Ver Arquivo
@@ -227,15 +227,16 @@ or one of its parents has the `tree-view` class applied to it.
You can also add separators and submenus to your context menus. To add a
submenu, pass in another object instead of a command. To add a separator, use
`-` for the name and command of the item.
`-` for the command of the item.
```coffeescript
'context-menu':
'.workspace':
'Inspect Element': 'core:inspect'
'-': '-'
'Separator': '-'
'Text':
'Select All': 'core:select-all'
'Another Separator': '-'
'Deleted Selected Text': 'core:delete'
```
+6 -1
Ver Arquivo
@@ -15,10 +15,15 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
module.exports.$ = $
module.exports.$$ = $$
module.exports.$$$ = $$$
module.exports.EditorView = require '../src/editor-view'
if atom.config.get('core.useReactMiniEditors')
module.exports.EditorView = require '../src/react-editor-view'
else
module.exports.EditorView = require '../src/editor-view'
module.exports.ScrollView = require '../src/scroll-view'
module.exports.SelectListView = require '../src/select-list-view'
module.exports.Task = require '../src/task'
module.exports.View = View
module.exports.WorkspaceView = require '../src/workspace-view'
module.exports.Workspace = require '../src/workspace'
module.exports.React = require 'react-atom-fork'
module.exports.Reactionary = require 'reactionary-atom-fork'
+2
Ver Arquivo
@@ -26,6 +26,7 @@
'ctrl-w': 'core:close'
'ctrl-z': 'core:undo'
'ctrl-y': 'core:redo'
'ctrl-shift-z': 'core:redo'
'ctrl-x': 'core:cut'
'ctrl-c': 'core:copy'
'ctrl-v': 'core:paste'
@@ -95,6 +96,7 @@
'ctrl-alt-shift-p': 'editor:log-cursor-scope'
'ctrl-k ctrl-u': 'editor:upper-case'
'ctrl-k ctrl-l': 'editor:lower-case'
'ctrl-l': 'editor:select-line'
'.workspace .editor:not(.mini)':
# Atom specific
+5
Ver Arquivo
@@ -18,6 +18,7 @@
'F11': 'window:toggle-full-screen'
# Sublime Parity
'ctrl-,': 'application:show-settings'
'ctrl-N': 'application:new-window'
'ctrl-W': 'window:close'
'ctrl-o': 'application:open-file'
@@ -28,6 +29,7 @@
'ctrl-w': 'core:close'
'ctrl-f4': 'core:close'
'ctrl-z': 'core:undo'
'ctrl-shift-z': 'core:redo'
'ctrl-y': 'core:redo'
'ctrl-x': 'core:cut'
'ctrl-c': 'core:copy'
@@ -83,12 +85,15 @@
'ctrl-delete': 'editor:delete-to-end-of-word'
'ctrl-home': 'core:move-to-top'
'ctrl-end': 'core:move-to-bottom'
'ctrl-shift-home': 'core:select-to-top'
'ctrl-shift-end': 'core:select-to-bottom'
# Sublime Parity
'ctrl-a': 'core:select-all'
'ctrl-alt-shift-p': 'editor:log-cursor-scope'
'ctrl-k ctrl-u': 'editor:upper-case'
'ctrl-k ctrl-l': 'editor:lower-case'
'ctrl-l': 'editor:select-line'
'.workspace .editor:not(.mini)':
# Atom specific
+1 -1
Ver Arquivo
@@ -37,7 +37,7 @@
{ label: 'Save As...', command: 'core:save-as' }
{ label: 'Save All', command: 'window:save-all' }
{ type: 'separator' }
{ label: 'Close Buffer', command: 'core:close' }
{ label: 'Close Tab', command: 'core:close' }
{ label: 'Close Pane', command: 'pane:close' }
{ label: 'Close Window', command: 'window:close' }
]
+2 -2
Ver Arquivo
@@ -14,8 +14,8 @@
{ 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: '&Close Tab', command: 'core:close' }
{ label: 'Close &Pane', command: 'pane:close' }
{ label: 'Clos&e Window', command: 'window:close' }
{ type: 'separator' }
{ label: 'Quit', command: 'application:quit' }
+7 -2
Ver Arquivo
@@ -9,13 +9,18 @@
{ label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' }
{ type: 'separator' }
{ label: 'Se&ttings', command: 'application:show-settings' }
{ label: 'Open Your Config', command: 'application:open-your-config' }
{ label: 'Open Your Init Script', command: 'application:open-your-init-script' }
{ label: 'Open Your Keymap', command: 'application:open-your-keymap' }
{ label: 'Open Your Snippets', command: 'application:open-your-snippets' }
{ label: 'Open Your Stylesheet', command: 'application:open-your-stylesheet' }
{ 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: '&Close Tab', command: 'core:close' }
{ label: 'Close &Pane', command: 'pane:close' }
{ label: 'Clos&e Window', command: 'window:close' }
{ type: 'separator' }
{ label: 'E&xit', command: 'application:quit' }
+53 -51
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.115.0",
"version": "0.121.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -17,126 +17,128 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.13.3",
"atomShellVersion": "0.15.0",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^0.27.0",
"atom-keymap": "^1.0.0",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
"delegato": "^1",
"emissary": "^1.2.1",
"first-mate": "^1.7.1",
"fs-plus": "^2.2.3",
"first-mate": "^2.0.1",
"fs-plus": "^2.2.6",
"fstream": "0.1.24",
"fuzzaldrin": "^1.1",
"git-utils": "^1.3",
"git-utils": "^2.1.3",
"grim": "0.11.0",
"guid": "0.0.10",
"jasmine-tagged": "^1.1.2",
"less-cache": "0.12.0",
"less-cache": "0.13.0",
"mixto": "^1",
"mkdirp": "0.3.5",
"nslog": "0.5.0",
"oniguruma": "^1.0.6",
"nslog": "^1.0.1",
"oniguruma": "^3.0.3",
"optimist": "0.4.0",
"pathwatcher": "^1.3.2",
"pathwatcher": "^2.0.6",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"react-atom-fork": "^0.10.0",
"reactionary-atom-fork": "^0.9.0",
"runas": "0.5.4",
"scandal": "0.16.0",
"react-atom-fork": "^0.11.1",
"reactionary-atom-fork": "^1.0.0",
"runas": "1.0.1",
"scandal": "1.0.0",
"scoped-property-store": "^0.9.0",
"scrollbar-style": "^0.4.0",
"scrollbar-style": "^1.0.1",
"season": "^1.0.2",
"semver": "1.1.4",
"serializable": "^1",
"space-pen": "3.2.0",
"temp": "0.7.0",
"text-buffer": "^2.4.2",
"text-buffer": "^3.0.0",
"theorist": "^1",
"underscore-plus": "^1.5.0",
"underscore-plus": "^1.5.1",
"vm-compatibility-layer": "0.1.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.19.0",
"atom-dark-ui": "0.32.0",
"atom-dark-ui": "0.33.0",
"atom-light-syntax": "0.20.0",
"atom-light-ui": "0.28.0",
"base16-tomorrow-dark-theme": "0.19.0",
"solarized-dark-syntax": "0.20.0",
"solarized-light-syntax": "0.11.0",
"archive-view": "0.33.0",
"autocomplete": "0.28.0",
"atom-light-ui": "0.29.0",
"base16-tomorrow-dark-theme": "0.20.0",
"base16-tomorrow-light-theme": "0.4.0",
"solarized-dark-syntax": "0.22.0",
"solarized-light-syntax": "0.12.0",
"archive-view": "0.35.0",
"autocomplete": "0.29.0",
"autoflow": "0.17.0",
"autosave": "0.14.0",
"background-tips": "0.15.0",
"bookmarks": "0.27.0",
"bracket-matcher": "0.48.0",
"bracket-matcher": "0.51.0",
"command-palette": "0.24.0",
"deprecation-cop": "0.7.0",
"dev-live-reload": "0.31.0",
"exception-reporting": "0.18.0",
"dev-live-reload": "0.33.0",
"exception-reporting": "0.19.0",
"feedback": "0.33.0",
"find-and-replace": "0.126.0",
"find-and-replace": "0.127.0",
"fuzzy-finder": "0.57.0",
"git-diff": "0.36.0",
"git-diff": "0.37.0",
"go-to-line": "0.23.0",
"grammar-selector": "0.27.0",
"image-view": "0.36.0",
"incompatible-packages": "0.3.0",
"keybinding-resolver": "0.18.0",
"link": "0.24.0",
"markdown-preview": "0.93.0",
"link": "0.25.0",
"markdown-preview": "0.94.0",
"metrics": "0.33.0",
"open-on-github": "0.29.0",
"package-generator": "0.31.0",
"release-notes": "0.35.0",
"settings-view": "0.133.0",
"snippets": "0.47.0",
"spell-check": "0.38.0",
"release-notes": "0.36.0",
"settings-view": "0.137.0",
"snippets": "0.50.0",
"spell-check": "0.40.0",
"status-bar": "0.41.0",
"styleguide": "0.29.0",
"symbols-view": "0.59.0",
"tabs": "0.44.0",
"timecop": "0.21.0",
"tree-view": "0.109.0",
"symbols-view": "0.63.0",
"tabs": "0.48.0",
"timecop": "0.22.0",
"tree-view": "0.112.0",
"update-package-dependencies": "0.6.0",
"welcome": "0.17.0",
"whitespace": "0.24.0",
"whitespace": "0.25.0",
"wrap-guide": "0.21.0",
"language-c": "0.21.0",
"language-coffee-script": "0.25.0",
"language-c": "0.26.0",
"language-coffee-script": "0.28.0",
"language-css": "0.17.0",
"language-gfm": "0.42.0",
"language-gfm": "0.44.0",
"language-git": "0.9.0",
"language-go": "0.13.0",
"language-go": "0.16.0",
"language-html": "0.22.0",
"language-hyperlink": "0.10.0",
"language-java": "0.11.0",
"language-javascript": "0.35.0",
"language-javascript": "0.39.0",
"language-json": "0.8.0",
"language-less": "0.12.0",
"language-less": "0.13.0",
"language-make": "0.10.0",
"language-objective-c": "0.11.0",
"language-perl": "0.9.0",
"language-php": "0.15.0",
"language-property-list": "0.7.0",
"language-python": "0.18.0",
"language-ruby": "0.32.0",
"language-ruby": "0.33.0",
"language-ruby-on-rails": "0.15.0",
"language-sass": "0.13.0",
"language-sass": "0.14.0",
"language-shellscript": "0.8.0",
"language-source": "0.7.0",
"language-source": "0.8.0",
"language-sql": "0.9.0",
"language-text": "0.6.0",
"language-todo": "0.10.0",
"language-toml": "0.12.0",
"language-xml": "0.15.0",
"language-yaml": "0.11.0"
"language-xml": "0.17.0",
"language-yaml": "0.13.0"
},
"private": true,
"scripts": {
+1 -1
Ver Arquivo
@@ -77,7 +77,7 @@ function bootstrap() {
moduleInstallCommand,
dedupeApmCommand + ' ' + packagesToDedupe.join(' '),
{
command: dedupeNpmCommand + ' request',
command: dedupeNpmCommand + ' request semver',
options: {
cwd: path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager')
}
+1
Ver Arquivo
@@ -24,6 +24,7 @@ var commands = [
[home, '.atom', 'storage'],
[home, '.atom', '.npm'],
[home, '.atom', 'compile-cache'],
[home, '.atom', 'atom-shell'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
];
+1 -1
Ver Arquivo
@@ -531,7 +531,7 @@ describe "the `atom` global", ->
describe ".isReleasedVersion()", ->
it "returns false if the version is a SHA and true otherwise", ->
version = '0.1.0'
spyOn(atom.constructor, 'getVersion').andCallFake -> version
spyOn(atom, 'getVersion').andCallFake -> version
expect(atom.isReleasedVersion()).toBe true
version = '36b5518'
expect(atom.isReleasedVersion()).toBe false
+10
Ver Arquivo
@@ -30,6 +30,16 @@ describe "ContextMenuManager", ->
expect(contextMenu.definitions['.selector'][0].command).toEqual 'command'
expect(contextMenu.definitions['.selector'].length).toBe 1
it 'allows multiple separators', ->
contextMenu.add 'file-path',
'.selector':
'separator1': '-'
'separator2': '-'
expect(contextMenu.definitions['.selector'].length).toBe 2
expect(contextMenu.definitions['.selector'][0].type).toEqual 'separator'
expect(contextMenu.definitions['.selector'][1].type).toEqual 'separator'
it 'allows duplicate commands with different labels', ->
contextMenu.add 'file-path',
'.selector':
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+29 -1
Ver Arquivo
@@ -2081,6 +2081,20 @@ describe "Editor", ->
editor.indent()
expect(buffer.lineForRow(0)).toMatch(tabRegex)
it "respects the tab stops when cursor is in the middle of a tab", ->
editor.setTabLength(4)
buffer.insert([12, 2], "\n ")
editor.setCursorBufferPosition [13, 1]
editor.indent()
expect(buffer.lineForRow(13)).toMatch /^\s+$/
expect(buffer.lineForRow(13).length).toBe 4
expect(editor.getCursorBufferPosition()).toEqual [13, 4]
buffer.insert([13, 0], " ")
editor.setCursorBufferPosition [13, 6]
editor.indent()
expect(buffer.lineForRow(13).length).toBe 8
describe "if 'softTabs' is false", ->
it "insert a \t into the buffer", ->
editor.setSoftTabs(false)
@@ -2099,6 +2113,20 @@ describe "Editor", ->
expect(buffer.lineForRow(5).length).toBe 6
expect(editor.getCursorBufferPosition()).toEqual [5, 6]
it "respects the tab stops when cursor is in the middle of a tab", ->
editor.setTabLength(4)
buffer.insert([12, 2], "\n ")
editor.setCursorBufferPosition [13, 1]
editor.indent(autoIndent: true)
expect(buffer.lineForRow(13)).toMatch /^\s+$/
expect(buffer.lineForRow(13).length).toBe 4
expect(editor.getCursorBufferPosition()).toEqual [13, 4]
buffer.insert([13, 0], " ")
editor.setCursorBufferPosition [13, 6]
editor.indent(autoIndent: true)
expect(buffer.lineForRow(13).length).toBe 8
describe "when 'softTabs' is false", ->
it "moves the cursor to the end of the leading whitespace and inserts enough tabs to bring the line to the suggested level of indentaion", ->
convertToHardTabs(buffer)
@@ -2829,7 +2857,7 @@ describe "Editor", ->
atom.config.set("editor.autoIndent", false)
editor.indent()
expect(editor.lineForBufferRow(2)).toBe " "
expect(editor.lineForBufferRow(2)).toBe " "
describe "when editor.autoIndent is true", ->
beforeEach ->
-1
Ver Arquivo
@@ -2652,7 +2652,6 @@ describe "EditorView", ->
expect(editor.getCursorBufferPosition()).toEqual [0, 0]
expect(buffer.lineForRow(0)).toBe 'var quicksort = function () {'
expect(buffer.lineForRow(13)).toBe 'var a = function() {'
editor.logScreenLines()
expect(editor.isFoldedAtBufferRow(0)).toBe true
expect(editor.isFoldedAtBufferRow(13)).toBe true
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 392 B

-1
Ver Arquivo
@@ -1 +0,0 @@
this tests files with no extensions
@@ -0,0 +1 @@
throw new Error("this simulates a native module's failure to load")
@@ -0,0 +1,4 @@
{
"name": "native-module",
"main": "./main.js"
}
@@ -0,0 +1,5 @@
{
"name": "package-with-incompatible-native-module",
"version": "1.0",
"main": "./main.js"
}
@@ -1,18 +0,0 @@
'fileTypes': ['package-with-infinite-loop-grammar']
'name': 'package-with-infinite-loop-grammar'
'scopeName': 'source.package-with-infinite-loop-grammar'
# This grammar should loop forever if the line contains an `a`
'patterns': [
{
'name': 'start'
'begin': '^'
'end': '$'
'patterns': [
{
name: 'negative-look-ahead'
match: "(?!a)"
}
]
}
]
@@ -1 +0,0 @@
This is a hidden file. Don't even try to load it as a snippet
@@ -1 +0,0 @@
This file isn't CSON, but shouldn't be a big deal
@@ -1,4 +0,0 @@
".test":
"Test Snippet":
prefix: "test"
body: "testing 123"
@@ -0,0 +1,4 @@
{
"theme": "ui",
"stylesheets": ["editor.less"]
}
@@ -0,0 +1,10 @@
@import "ui-variables";
.editor {
padding-top: @component-padding;
padding-right: @component-padding;
padding-bottom: @component-padding;
color: @input-background-color;
background-color: @background-color-info; // From the fallback variables, not overridden
}
@@ -0,0 +1,3 @@
// This does not contain all of the ui-variables available.
@app-background-color: #00f; // Changed
@input-background-color: #f00; // Changed
@@ -1,3 +0,0 @@
@import "stylesheets/first";
@import "stylesheets/second";
@import "stylesheets/last";
@@ -1,3 +0,0 @@
{
"theme": "ui"
}
@@ -1,7 +0,0 @@
.editor {
padding-top: 101px;
padding-right: 101px;
padding-bottom: 101px;
color: red;
}
@@ -1,5 +0,0 @@
.editor {
/* padding-top: 103px;
padding-right: 103px;*/
padding-bottom: 103px;
}
@@ -1,9 +0,0 @@
@import "ui-variables";
@number: 102px;
.editor {
/* padding-top: 102px;*/
padding-right: @number;
padding-bottom: @number;
}
@@ -1,75 +0,0 @@
// Variables different from the original are marked 'Changed'
@text-color: #333;
@text-color-subtle: #777;
@text-color-highlight: #111;
@text-color-selected: @text-color-highlight;
@text-color-info: #5293d8;
@text-color-success: #1fe977;
@text-color-warning: #f78a46;
@text-color-error: #c00;
@background-color-info: #0098ff;
@background-color-success: #17ca65;
@background-color-warning: #ff4800;
@background-color-error: #c00;
@background-color-highlight: rgba(255, 255, 255, 0.10);
@background-color-selected: @background-color-highlight;
@app-background-color: #00f; // Changed
@base-background-color: #fff;
@base-border-color: #eee;
@pane-item-background-color: @base-background-color;
@pane-item-border-color: @base-border-color;
@input-background-color: #f00; // Changed
@input-border-color: @base-border-color;
@tool-panel-background-color: #f4f4f4;
@tool-panel-border-color: @base-border-color;
@inset-panel-background-color: #eee;
@inset-panel-border-color: @base-border-color;
@panel-heading-background-color: #ddd;
@panel-heading-border-color: transparent;
@overlay-background-color: #f4f4f4;
@overlay-border-color: @base-border-color;
@button-background-color: #ccc;
@button-background-color-hover: lighten(@button-background-color, 5%);
@button-background-color-selected: @button-background-color-hover;
@button-border-color: #aaa;
@tab-bar-background-color: #fff;
@tab-bar-border-color: darken(@tab-background-color-active, 10%);
@tab-background-color: #f4f4f4;
@tab-background-color-active: #fff;
@tab-border-color: @base-border-color;
@tree-view-background-color: @tool-panel-background-color;
@tree-view-border-color: @tool-panel-border-color;
@ui-site-color-1: @background-color-success; // green
@ui-site-color-2: @background-color-info; // blue
@ui-site-color-3: @background-color-warning; // orange
@ui-site-color-4: #db2ff4; // purple
@ui-site-color-5: #f5e11d; // yellow
@font-size: 12px;
@disclosure-arrow-size: 12px;
@component-padding: 150px;
@component-icon-padding: 5px;
@component-icon-size: 16px;
@component-line-height: 25px;
@component-border-radius: 2px;
@tab-height: 30px;
@font-family: Arial;
-1
Ver Arquivo
@@ -1 +0,0 @@
Hello World!
-1
Ver Arquivo
@@ -1 +0,0 @@
Goodbye World!
-1
Ver Arquivo
@@ -1 +0,0 @@
Hello World!
-1
Ver Arquivo
@@ -1 +0,0 @@
Goodbye World!
-1
Ver Arquivo
@@ -1 +0,0 @@
#header {
-71
Ver Arquivo
@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>txt</string>
</array>
<key>keyEquivalent</key>
<string>^~P</string>
<key>name</key>
<string>Plain Text</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.item.text</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(•).*$\n?</string>
<key>name</key>
<string>meta.bullet-point.strong.text</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.item.text</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(·).*$\n?</string>
<key>name</key>
<string>meta.bullet-point.light.text</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.item.text</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(\*).*$\n?</string>
<key>name</key>
<string>meta.bullet-point.star.text</string>
</dict>
<dict>
<key>begin</key>
<string>^([ \t]*)(?=\S)</string>
<key>contentName</key>
<string>meta.paragraph.text</string>
<key>end</key>
<string>^(?!\1(?=\S))</string>
</dict>
</array>
<key>scopeName</key>
<string>text.plain</string>
<key>uuid</key>
<string>3130E4FA-B10E-11D9-9F75-000D93589AF6</string>
</dict>
</plist>
-1
Ver Arquivo
@@ -1 +0,0 @@
dir
-1
Ver Arquivo
@@ -1 +0,0 @@
sample.js
-1
Ver Arquivo
@@ -1 +0,0 @@
a
+2 -1
Ver Arquivo
@@ -1,7 +1,8 @@
fs = require 'fs'
module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) ->
{$, $$} = require 'atom'
{$, $$} = require '../src/space-pen-extensions'
window[key] = value for key, value of require '../vendor/jasmine'
{TerminalReporter} = require 'jasmine-tagged'
+28
Ver Arquivo
@@ -1,8 +1,36 @@
{$} = require 'atom'
path = require 'path'
Package = require '../src/package'
ThemePackage = require '../src/theme-package'
describe "Package", ->
describe "when the package contains incompatible native modules", ->
it "does not activate it", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
pack = new Package(packagePath)
expect(pack.isCompatible()).toBe false
expect(pack.incompatibleModules[0].name).toBe 'native-module'
expect(pack.incompatibleModules[0].path).toBe path.join(packagePath, 'node_modules', 'native-module')
it "caches the incompatible native modules in local storage", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
cacheKey = null
cacheItem = null
spyOn(global.localStorage, 'setItem').andCallFake (key, item) ->
cacheKey = key
cacheItem = item
spyOn(global.localStorage, 'getItem').andCallFake (key) ->
return cacheItem if cacheKey is key
expect(new Package(packagePath).isCompatible()).toBe false
expect(global.localStorage.getItem.callCount).toBe 1
expect(global.localStorage.setItem.callCount).toBe 1
expect(new Package(packagePath).isCompatible()).toBe false
expect(global.localStorage.getItem.callCount).toBe 2
expect(global.localStorage.setItem.callCount).toBe 1
describe "theme", ->
theme = null
+9 -3
Ver Arquivo
@@ -130,6 +130,8 @@ afterEach ->
atom.project?.destroy()
atom.project = null
atom.themes.removeStylesheet('global-editor-styles')
delete atom.state.packageStates
$('#jasmine-content').empty() unless window.debugContent
@@ -318,9 +320,13 @@ window.setEditorWidthInChars = (editorView, widthInChars, charWidth=editorView.c
editorView.width(charWidth * widthInChars + editorView.gutter.outerWidth())
$(window).trigger 'resize' # update width of editor view's on-screen lines
window.setEditorHeightInLines = (editorView, heightInChars, charHeight=editorView.lineHeight) ->
editorView.height(charHeight * heightInChars + editorView.renderedLines.position().top)
$(window).trigger 'resize' # update editor view's on-screen lines
window.setEditorHeightInLines = (editorView, heightInLines, lineHeight=editorView.lineHeight) ->
if editorView.hasClass('react')
editorView.height(editorView.getEditor().getLineHeightInPixels() * heightInLines)
editorView.component?.measureHeightAndWidth()
else
editorView.height(lineHeight * heightInLines + editorView.renderedLines.position().top)
$(window).trigger 'resize' # update editor view's on-screen lines
$.fn.resultOfTrigger = (type) ->
event = $.Event(type)
-1
Ver Arquivo
@@ -1,6 +1,5 @@
_ = require 'underscore-plus'
fs = require 'fs-plus'
{Git} = require 'atom'
path = require 'path'
require './spec-helper'
+15
Ver Arquivo
@@ -232,6 +232,21 @@ describe "ThemeManager", ->
expect($(".editor").css("padding-right")).toBe "150px"
expect($(".editor").css("padding-bottom")).toBe "150px"
describe "when there is a theme with incomplete variables", ->
it "loads the correct values from the fallback ui-variables", ->
themeManager.on 'reloaded', reloadHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-incomplete-ui-variables'])
waitsFor ->
reloadHandler.callCount > 0
runs ->
# an override loaded in the base css
expect(atom.workspaceView.css("background-color")).toBe "rgb(0, 0, 255)"
# from within the theme itself
expect($(".editor").css("background-color")).toBe "rgb(0, 152, 255)"
describe "when the user stylesheet changes", ->
it "reloads it", ->
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
+28 -1
Ver Arquivo
@@ -20,7 +20,6 @@ describe "WorkspaceView", ->
waitsForPromise ->
atom.workspace.open(pathToOpen)
describe "@deserialize()", ->
viewState = null
@@ -294,3 +293,31 @@ describe "WorkspaceView", ->
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-always'
scrollbarStyle.emitValue 'overlay'
expect(atom.workspaceView).toHaveClass 'scrollbars-visible-when-scrolling'
describe "editor font styling", ->
[editorNode, editor] = []
beforeEach ->
atom.workspaceView.attachToDom()
editorNode = atom.workspaceView.find('.editor')[0]
editor = atom.workspaceView.find('.editor').view().getEditor()
it "updates the font-size based on the 'editor.fontSize' config value", ->
initialCharWidth = editor.getDefaultCharWidth()
expect(getComputedStyle(editorNode).fontSize).toBe atom.config.get('editor.fontSize') + 'px'
atom.config.set('editor.fontSize', atom.config.get('editor.fontSize') + 5)
expect(getComputedStyle(editorNode).fontSize).toBe atom.config.get('editor.fontSize') + 'px'
expect(editor.getDefaultCharWidth()).toBeGreaterThan initialCharWidth
it "updates the font-family based on the 'editor.fontFamily' config value", ->
initialCharWidth = editor.getDefaultCharWidth()
expect(getComputedStyle(editorNode).fontFamily).toBe atom.config.get('editor.fontFamily')
atom.config.set('editor.fontFamily', 'sans-serif')
expect(getComputedStyle(editorNode).fontFamily).toBe atom.config.get('editor.fontFamily')
expect(editor.getDefaultCharWidth()).not.toBe initialCharWidth
it "updates the line-height based on the 'editor.lineHeight' config value", ->
initialLineHeight = editor.getLineHeightInPixels()
atom.config.set('editor.lineHeight', '30px')
expect(getComputedStyle(editorNode).lineHeight).toBe atom.config.get('editor.lineHeight')
expect(editor.getLineHeightInPixels()).not.toBe initialLineHeight
+4 -12
Ver Arquivo
@@ -110,14 +110,6 @@ class Atom extends Model
@getCurrentWindow: ->
remote.getCurrentWindow()
# Get the version of the Atom application.
@getVersion: ->
@appVersion ?= @getLoadSettings().appVersion
# Determine whether the current version is an official release.
@isReleasedVersion: ->
not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix
workspaceViewParentSelector: 'body'
# Call .loadOrCreate instead
@@ -158,7 +150,7 @@ class Atom extends Model
process.env.NODE_PATH = exportsPath
# Make react.js faster
process.env.NODE_ENV ?= 'production'
process.env.NODE_ENV ?= 'production' unless devMode
@config = new Config({configDirPath, resourcePath})
@keymaps = new KeymapManager({configDirPath, resourcePath})
@@ -446,7 +438,7 @@ class Atom extends Model
# width - The {Number} of pixels.
# height - The {Number} of pixels.
setSize: (width, height) ->
ipc.send('call-window-method', 'setSize', width, height)
@getCurrentWindow().setSize(width, height)
# Public: Set the position of current window.
#
@@ -503,11 +495,11 @@ class Atom extends Model
#
# Returns the version text {String}.
getVersion: ->
@constructor.getVersion()
@appVersion ?= @getLoadSettings().appVersion
# Public: Determine whether the current version is an official release.
isReleasedVersion: ->
@constructor.isReleasedVersion()
not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix
# Public: Get the directory path to Atom's configuration area.
#
+1 -1
Ver Arquivo
@@ -105,7 +105,7 @@ class AtomWindow
type: 'warning'
buttons: ['Close Window', 'Reload', 'Keep It Open']
message: 'The editor has crashed'
detail: 'Please report this issue to atom@github.com'
detail: 'Please report this issue to https://github.com/atom/atom'
switch chosen
when 0 then @browserWindow.destroy()
when 1 then @browserWindow.restart()
-4
Ver Arquivo
@@ -27,10 +27,6 @@ start = ->
event.preventDefault()
args.urlsToOpen.push(urlToOpen)
app.on 'open-url', (event, urlToOpen) ->
event.preventDefault()
args.urlsToOpen.push(urlToOpen)
app.on 'open-file', addPathToOpen
app.on 'open-url', addUrlToOpen
+7 -1
Ver Arquivo
@@ -46,7 +46,13 @@ class BufferedProcess
if process.platform is "win32"
# Quote all arguments and escapes inner quotes
if args?
cmdArgs = args.map (arg) -> "\"#{arg.replace(/"/g, '\\"')}\""
cmdArgs = args.map (arg) ->
if command in ['explorer.exe', 'explorer'] and /^\/[a-zA-Z]+,.*$/.test(arg)
# Don't wrap /root,C:\folder style arguments to explorer calls in
# quotes since they will not be interpreted correctly if they are
arg
else
"\"#{arg.replace(/"/g, '\\"')}\""
else
cmdArgs = []
cmdArgs.unshift("\"#{command}\"")
+6 -1
Ver Arquivo
@@ -18,11 +18,16 @@ getCachedJavaScript = (cachePath) ->
try
fs.readFileSync(cachePath, 'utf8')
convertFilePath = (filePath) ->
if process.platform is 'win32'
filePath = "/#{path.resolve(filePath).replace(/\\/g, '/')}"
encodeURI(filePath)
compileCoffeeScript = (coffee, filePath, cachePath) ->
{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}"
js = "#{js}\n//# sourceMappingURL=data:application/json;base64,#{btoa unescape encodeURIComponent v3SourceMap}\n//# sourceURL=#{convertFilePath(filePath)}"
try
fs.writeFileSync(cachePath, js)
js
+2 -2
Ver Arquivo
@@ -44,7 +44,7 @@ class ContextMenuManager
@addBySelector(selector, menuItem, {devMode})
buildMenuItem: (label, command) ->
if label is command is '-'
if command is '-'
{type: 'separator'}
else
{label, command}
@@ -60,7 +60,7 @@ class ContextMenuManager
# editor is in dev mode.
addBySelector: (selector, definition, {devMode}={}) ->
definitions = if devMode then @devModeDefinitions else @definitions
unless _.findWhere(definitions[selector], definition)
if not _.findWhere(definitions[selector], definition) or _.isEqual(definition, {type: 'separator'})
(definitions[selector] ?= []).push(definition)
# Returns definitions which match the element and devMode.
+3 -14
Ver Arquivo
@@ -8,22 +8,11 @@ CursorComponent = React.createClass
render: ->
{pixelRect, defaultCharWidth} = @props
{height, width} = pixelRect
{top, left, height, width} = pixelRect
width = defaultCharWidth if width is 0
WebkitTransform = @getTransform()
WebkitTransform = "translate(#{left}px, #{top}px)"
div className: 'cursor', style: {height, width, WebkitTransform}
getTransform: ->
{pixelRect, scrollTop, scrollLeft, useHardwareAcceleration} = @props
{top, left} = pixelRect
top -= scrollTop
left -= scrollLeft
if useHardwareAcceleration
"translate3d(#{left}px, #{top}px, 0px)"
else
"translate(#{left}px, #{top}px)"
shouldComponentUpdate: (newProps) ->
not isEqualForProperties(newProps, @props, 'pixelRect', 'scrollTop', 'scrollLeft', 'defaultCharWidth')
not isEqualForProperties(newProps, @props, 'pixelRect', 'defaultCharWidth')
+3 -3
Ver Arquivo
@@ -12,16 +12,16 @@ CursorsComponent = React.createClass
cursorBlinkIntervalHandle: null
render: ->
{cursorPixelRects, scrollTop, scrollLeft, defaultCharWidth, useHardwareAcceleration} = @props
{performedInitialMeasurement, cursorPixelRects, defaultCharWidth} = @props
{blinkOff} = @state
className = 'cursors'
className += ' blink-off' if blinkOff
div {className},
if @isMounted()
if performedInitialMeasurement
for key, pixelRect of cursorPixelRects
CursorComponent({key, pixelRect, scrollTop, scrollLeft, defaultCharWidth, useHardwareAcceleration})
CursorComponent({key, pixelRect, defaultCharWidth})
getInitialState: ->
blinkOff: false
+2 -2
Ver Arquivo
@@ -55,13 +55,13 @@ class Decoration
# Public: Destroy this marker.
#
# If you own the marker, you should use {Marker:destroy} which will destroy
# If you own the marker, you should use {Marker::destroy} which will destroy
# this decoration.
destroy: ->
return if @isDestroyed
@isDestroyed = true
@displayBuffer.removeDecoration(this)
@emit 'destoryed'
@emit 'destroyed'
# Public: Update the marker with new params. Allows you to change the decoration's class.
#
+3 -1
Ver Arquivo
@@ -356,8 +356,10 @@ class DisplayBuffer extends Model
if editorWidthInChars isnt previousWidthInChars and @softWrap
@updateWrappedScreenLines()
# Returns the editor width in characters for soft wrap.
getEditorWidthInChars: ->
width = @getWidth()
width = @width ? @getScrollWidth()
width -= @getVerticalScrollbarWidth()
if width? and @defaultCharWidth > 0
Math.floor(width / @defaultCharWidth)
else
+188 -135
Ver Arquivo
@@ -6,14 +6,11 @@ scrollbarStyle = require 'scrollbar-style'
GutterComponent = require './gutter-component'
InputComponent = require './input-component'
CursorsComponent = require './cursors-component'
LinesComponent = require './lines-component'
ScrollbarComponent = require './scrollbar-component'
ScrollbarCornerComponent = require './scrollbar-corner-component'
SubscriberMixin = require './subscriber-mixin'
DummyHighlightDecoration = {id: 'dummy', startPixelPosition: {top: 0, left: 0}, endPixelPosition: {top: 0, left: 0}, decorations: [{class: 'dummy'}]}
module.exports =
EditorComponent = React.createClass
displayName: 'EditorComponent'
@@ -22,6 +19,10 @@ EditorComponent = React.createClass
statics:
performSyncUpdates: false
visible: false
autoHeight: false
backgroundColor: null
gutterBackgroundColor: null
pendingScrollTop: null
pendingScrollLeft: null
selectOnMouseMove: false
@@ -32,30 +33,29 @@ EditorComponent = React.createClass
selectionChanged: false
selectionAdded: false
scrollingVertically: false
gutterWidth: 0
refreshingScrollbars: false
measuringScrollbars: true
pendingVerticalScrollDelta: 0
pendingHorizontalScrollDelta: 0
mouseWheelScreenRow: null
mouseWheelScreenRowClearDelay: 150
scrollSensitivity: 0.4
scrollViewMeasurementRequested: false
heightAndWidthMeasurementRequested: false
measureLineHeightAndDefaultCharWidthWhenShown: false
remeasureCharacterWidthsIfVisibleAfterNextUpdate: false
remeasureCharacterWidthsWhenShown: false
inputEnabled: true
scrollViewMeasurementInterval: 100
scopedCharacterWidthsChangeCount: null
scrollViewMeasurementPaused: false
domPollingInterval: 100
domPollingIntervalId: null
domPollingPaused: false
render: ->
{focused, fontSize, lineHeight, fontFamily, showIndentGuide, showInvisibles, showLineNumbers, visible} = @state
{editor, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
{focused, showIndentGuide, showInvisibles, showLineNumbers, visible} = @state
{editor, mini, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
maxLineNumberDigits = editor.getLineCount().toString().length
invisibles = if showInvisibles then @state.invisibles else {}
invisibles = if showInvisibles and not mini then @state.invisibles else {}
hasSelection = editor.getSelection()? and !editor.getSelection().isEmpty()
style = {}
if @isMounted()
if @performedInitialMeasurement
renderedRowRange = @getRenderedRowRange()
[renderedStartRow, renderedEndRow] = renderedRowRange
cursorPixelRects = @getCursorPixelRects(renderedRowRange)
@@ -63,6 +63,7 @@ EditorComponent = React.createClass
decorations = editor.decorationsForScreenRowRange(renderedStartRow, renderedEndRow)
highlightDecorations = @getHighlightDecorations(decorations)
lineDecorations = @getLineDecorations(decorations)
placeholderText = @props.placeholderText if @props.placeholderText? and editor.isEmpty()
scrollHeight = editor.getScrollHeight()
scrollWidth = editor.getScrollWidth()
@@ -81,16 +82,19 @@ EditorComponent = React.createClass
if @mouseWheelScreenRow? and not (renderedStartRow <= @mouseWheelScreenRow < renderedEndRow)
mouseWheelScreenRow = @mouseWheelScreenRow
className = 'editor-contents editor-colors'
style.height = scrollViewHeight if @autoHeight
className = 'editor-contents'
className += ' is-focused' if focused
className += ' has-selection' if hasSelection
div className: className, style: {fontSize, lineHeight, fontFamily}, tabIndex: -1,
if showLineNumbers
div {className, style, tabIndex: -1},
if @shouldRenderGutter()
GutterComponent {
ref: 'gutter', onMouseDown: @onGutterMouseDown, onWidthChanged: @onGutterWidthChanged,
lineDecorations, defaultCharWidth, editor, renderedRowRange, maxLineNumberDigits, scrollViewHeight,
scrollTop, scrollHeight, lineHeightInPixels, @pendingChanges, mouseWheelScreenRow, @useHardwareAcceleration
ref: 'gutter', onMouseDown: @onGutterMouseDown, lineDecorations,
defaultCharWidth, editor, renderedRowRange, maxLineNumberDigits, scrollViewHeight,
scrollTop, scrollHeight, lineHeightInPixels, @pendingChanges, mouseWheelScreenRow,
@useHardwareAcceleration, @performedInitialMeasurement, @backgroundColor, @gutterBackgroundColor
}
div ref: 'scrollView', className: 'scroll-view', onMouseDown: @onMouseDown,
@@ -101,18 +105,28 @@ EditorComponent = React.createClass
onFocus: @onInputFocused
onBlur: @onInputBlurred
CursorsComponent {
scrollTop, scrollLeft, cursorPixelRects, cursorBlinkPeriod, cursorBlinkResumeDelay,
lineHeightInPixels, defaultCharWidth, @scopedCharacterWidthsChangeCount, @useHardwareAcceleration
}
LinesComponent {
ref: 'lines',
editor, lineHeightInPixels, defaultCharWidth, lineDecorations, highlightDecorations,
showIndentGuide, renderedRowRange, @pendingChanges, scrollTop, scrollLeft,
@scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow, invisibles,
visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration
@visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration,
placeholderText, @performedInitialMeasurement, @backgroundColor, cursorPixelRects,
cursorBlinkPeriod, cursorBlinkResumeDelay
}
ScrollbarComponent
ref: 'horizontalScrollbar'
className: 'horizontal-scrollbar'
orientation: 'horizontal'
onScroll: @onHorizontalScroll
scrollLeft: scrollLeft
scrollWidth: scrollWidth
visible: horizontallyScrollable and not @refreshingScrollbars and not @measuringScrollbars
scrollableInOppositeDirection: verticallyScrollable
verticalScrollbarWidth: verticalScrollbarWidth
horizontalScrollbarHeight: horizontalScrollbarHeight
ScrollbarComponent
ref: 'verticalScrollbar'
className: 'vertical-scrollbar'
@@ -125,18 +139,6 @@ EditorComponent = React.createClass
verticalScrollbarWidth: verticalScrollbarWidth
horizontalScrollbarHeight: horizontalScrollbarHeight
ScrollbarComponent
ref: 'horizontalScrollbar'
className: 'horizontal-scrollbar'
orientation: 'horizontal'
onScroll: @onHorizontalScroll
scrollLeft: scrollLeft
scrollWidth: scrollWidth + @gutterWidth
visible: horizontallyScrollable and not @refreshingScrollbars and not @measuringScrollbars
scrollableInOppositeDirection: verticallyScrollable
verticalScrollbarWidth: verticalScrollbarWidth
horizontalScrollbarHeight: horizontalScrollbarHeight
# Also used to measure the height/width of scrollbars after the initial render
ScrollbarCornerComponent
ref: 'scrollbarCorner'
@@ -149,13 +151,15 @@ EditorComponent = React.createClass
{editor} = @props
Math.max(1, Math.ceil(editor.getHeight() / editor.getLineHeightInPixels()))
getInitialState: ->
visible: true
shouldRenderGutter: ->
not @props.mini and @state.showLineNumbers
getInitialState: -> {}
getDefaultProps: ->
cursorBlinkPeriod: 800
cursorBlinkResumeDelay: 100
lineOverdrawMargin: 8
lineOverdrawMargin: 15
componentWillMount: ->
@pendingChanges = []
@@ -166,26 +170,29 @@ EditorComponent = React.createClass
componentDidMount: ->
{editor} = @props
@scrollViewMeasurementIntervalId = setInterval(@measureScrollView, @scrollViewMeasurementInterval)
@domPollingIntervalId = setInterval(@pollDOM, @domPollingInterval)
@observeEditor()
@listenForDOMEvents()
@listenForCommands()
@subscribe atom.themes, 'stylesheet-added stylsheet-removed', @onStylesheetsChanged
@subscribe atom.themes, 'stylesheet-added stylesheet-removed stylesheet-updated', @onStylesheetsChanged
@subscribe scrollbarStyle.changes, @refreshScrollbars
editor.setVisible(true)
@measureLineHeightAndDefaultCharWidth()
@measureScrollView()
@measureScrollbars()
if @visible = @isVisible()
@performInitialMeasurement()
@forceUpdate()
componentWillUnmount: ->
@props.parentView.trigger 'editor:will-be-removed', [@props.parentView]
@unsubscribe()
clearInterval(@scrollViewMeasurementIntervalId)
@scrollViewMeasurementIntervalId = null
clearInterval(@domPollingIntervalId)
@domPollingIntervalId = null
componentWillUpdate: ->
wasVisible = @visible
@visible = @isVisible()
@performInitialMeasurement() if @visible and not wasVisible
componentDidUpdate: (prevProps, prevState) ->
cursorsMoved = @cursorsMoved
@@ -197,15 +204,29 @@ EditorComponent = React.createClass
if @props.editor.isAlive()
@updateParentViewFocusedClassIfNeeded(prevState)
@updateParentViewMiniClassIfNeeded(prevState)
@props.parentView.trigger 'cursor:moved' if cursorsMoved
@props.parentView.trigger 'selection:changed' if selectionChanged
@props.parentView.trigger 'editor:display-updated'
@measureScrollbars() if @measuringScrollbars
@measureLineHeightAndCharWidthsIfNeeded(prevState)
@remeasureCharacterWidthsIfNeeded(prevState)
if @performedInitialMeasurement
@measureScrollbars() if @measuringScrollbars
performInitialMeasurement: ->
@updatesPaused = true
@measureHeightAndWidth()
@sampleFontStyling()
@sampleBackgroundColors()
@measureScrollbars()
@measureLineHeightAndDefaultCharWidth() if @measureLineHeightAndDefaultCharWidthWhenShown
@remeasureCharacterWidths() if @remeasureCharacterWidthsWhenShown
@props.editor.setVisible(true)
@updatesPaused = false
@performedInitialMeasurement = true
requestUpdate: ->
return unless @isMounted()
if @updatesPaused
@updateRequestedWhilePaused = true
return
@@ -214,13 +235,13 @@ EditorComponent = React.createClass
@forceUpdate()
else unless @updateRequested
@updateRequested = true
setImmediate =>
requestAnimationFrame =>
@updateRequested = false
@forceUpdate() if @isMounted()
requestAnimationFrame: (fn) ->
@updatesPaused = true
@pauseScrollViewMeasurement()
@pauseDOMPolling()
requestAnimationFrame =>
fn()
@updatesPaused = false
@@ -228,6 +249,9 @@ EditorComponent = React.createClass
@updateRequestedWhilePaused = false
@forceUpdate()
getTopmostDOMNode: ->
@props.parentView.element
getRenderedRowRange: ->
{editor, lineOverdrawMargin} = @props
[visibleStartRow, visibleEndRow] = editor.getVisibleRowRange()
@@ -273,7 +297,9 @@ EditorComponent = React.createClass
cursorPixelRects
getLineDecorations: (decorationsByMarkerId) ->
{editor} = @props
{editor, mini} = @props
return {} if mini
decorationsByScreenRow = {}
for markerId, decorations of decorationsByMarkerId
marker = editor.getMarker(markerId)
@@ -317,11 +343,6 @@ EditorComponent = React.createClass
decorations: []
filteredDecorations[markerId].decorations.push decorationParams
# At least in Chromium 31, removing the last highlight causes a rendering
# artifact where chunks of the lines disappear, so we always leave this
# dummy highlight in place to prevent that.
filteredDecorations['dummy'] = DummyHighlightDecoration
filteredDecorations
observeEditor: ->
@@ -350,7 +371,7 @@ EditorComponent = React.createClass
scrollViewNode = @refs.scrollView.getDOMNode()
scrollViewNode.addEventListener 'scroll', @onScrollViewScroll
window.addEventListener 'resize', @requestScrollViewMeasurement
window.addEventListener 'resize', @requestHeightAndWidthMeasurement
@listenForIMEEvents()
@@ -492,9 +513,6 @@ EditorComponent = React.createClass
parentView.command command, listener
observeConfig: ->
@subscribe atom.config.observe 'editor.fontFamily', @setFontFamily
@subscribe atom.config.observe 'editor.fontSize', @setFontSize
@subscribe atom.config.observe 'editor.lineHeight', @setLineHeight
@subscribe atom.config.observe 'editor.showIndentGuide', @setShowIndentGuide
@subscribe atom.config.observe 'editor.invisibles', @setInvisibles
@subscribe atom.config.observe 'editor.showInvisibles', @setShowInvisibles
@@ -557,28 +575,23 @@ EditorComponent = React.createClass
@pendingScrollLeft = null
onMouseWheel: (event) ->
event.preventDefault()
animationFramePending = @pendingHorizontalScrollDelta isnt 0 or @pendingVerticalScrollDelta isnt 0
{editor} = @props
# Only scroll in one direction at a time
{wheelDeltaX, wheelDeltaY} = event
if Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)
# Scrolling horizontally
@pendingHorizontalScrollDelta -= Math.round(wheelDeltaX * @scrollSensitivity)
previousScrollLeft = editor.getScrollLeft()
editor.setScrollLeft(previousScrollLeft - Math.round(wheelDeltaX * @scrollSensitivity))
event.preventDefault() unless previousScrollLeft is editor.getScrollLeft()
else
# Scrolling vertically
@pendingVerticalScrollDelta -= Math.round(wheelDeltaY * @scrollSensitivity)
@mouseWheelScreenRow = @screenRowForNode(event.target)
@clearMouseWheelScreenRowAfterDelay ?= debounce(@clearMouseWheelScreenRow, @mouseWheelScreenRowClearDelay)
@clearMouseWheelScreenRowAfterDelay()
unless animationFramePending
@requestAnimationFrame =>
{editor} = @props
editor.setScrollTop(editor.getScrollTop() + @pendingVerticalScrollDelta)
editor.setScrollLeft(editor.getScrollLeft() + @pendingHorizontalScrollDelta)
@pendingVerticalScrollDelta = 0
@pendingHorizontalScrollDelta = 0
previousScrollTop = editor.getScrollTop()
editor.setScrollTop(previousScrollTop - Math.round(wheelDeltaY * @scrollSensitivity))
event.preventDefault() unless previousScrollTop is editor.getScrollTop()
onScrollViewScroll: ->
if @isMounted()
@@ -654,9 +667,12 @@ EditorComponent = React.createClass
editor.setSelectedScreenRange([tailPosition, [dragRow + 1, 0]])
onStylesheetsChanged: (stylesheet) ->
return unless @performedInitialMeasurement
@refreshScrollbars() if @containsScrollbarSelector(stylesheet)
@remeasureCharacterWidthsIfVisibleAfterNextUpdate = true
@requestUpdate() if @state.visible
@sampleFontStyling()
@sampleBackgroundColors()
@remeasureCharacterWidths()
onScreenLinesChanged: (change) ->
{editor} = @props
@@ -733,78 +749,114 @@ EditorComponent = React.createClass
window.addEventListener('mousemove', onMouseMove)
window.addEventListener('mouseup', onMouseUp)
pauseScrollViewMeasurement: ->
@scrollViewMeasurementPaused = true
@resumeScrollViewMeasurementAfterDelay ?= debounce(@resumeScrollViewMeasurement, 100)
@resumeScrollViewMeasurementAfterDelay()
isVisible: ->
node = @getDOMNode()
node.offsetHeight > 0 or node.offsetWidth > 0
resumeScrollViewMeasurement: ->
@scrollViewMeasurementPaused = false
pauseDOMPolling: ->
@domPollingPaused = true
@resumeDOMPollingAfterDelay ?= debounce(@resumeDOMPolling, 100)
@resumeDOMPollingAfterDelay()
resumeScrollViewMeasurementAfterDelay: null # created lazily
resumeDOMPolling: ->
@domPollingPaused = false
requestScrollViewMeasurement: ->
return if @scrollViewMeasurementRequested
resumeDOMPollingAfterDelay: null # created lazily
@scrollViewMeasurementRequested = true
pollDOM: ->
return if @domPollingPaused or @updateRequested or not @isMounted()
wasVisible = @visible
if @visible = @isVisible()
if wasVisible
@measureHeightAndWidth()
@sampleFontStyling()
@sampleBackgroundColors()
else
@performInitialMeasurement()
@forceUpdate()
requestHeightAndWidthMeasurement: ->
return if @heightAndWidthMeasurementRequested
@heightAndWidthMeasurementRequested = true
requestAnimationFrame =>
@scrollViewMeasurementRequested = false
@measureScrollView()
@heightAndWidthMeasurementRequested = false
@measureHeightAndWidth()
# Measure explicitly-styled height and width and relay them to the model. If
# these values aren't explicitly styled, we assume the editor is unconstrained
# and use the scrollHeight / scrollWidth as its height and width in
# calculations.
measureScrollView: ->
return if @scrollViewMeasurementPaused
measureHeightAndWidth: ->
return unless @isMounted()
{editor} = @props
editorNode = @getDOMNode()
{editor, parentView} = @props
parentNode = parentView.element
scrollViewNode = @refs.scrollView.getDOMNode()
{position} = getComputedStyle(editorNode)
{width, height} = editorNode.style
{position} = getComputedStyle(parentNode)
{height} = parentNode.style
if position is 'absolute' or height
if @autoHeight
@autoHeight = false
@forceUpdate()
clientHeight = scrollViewNode.clientHeight
editor.setHeight(clientHeight) if clientHeight > 0
else
editor.setHeight(null)
@autoHeight = true
if position is 'absolute' or width
clientWidth = scrollViewNode.clientWidth
paddingLeft = parseInt(getComputedStyle(scrollViewNode).paddingLeft)
clientWidth -= paddingLeft
editor.setWidth(clientWidth) if clientWidth > 0
clientWidth = scrollViewNode.clientWidth
paddingLeft = parseInt(getComputedStyle(scrollViewNode).paddingLeft)
clientWidth -= paddingLeft
editor.setWidth(clientWidth) if clientWidth > 0
measureLineHeightAndCharWidthsIfNeeded: (prevState) ->
if not isEqualForProperties(prevState, @state, 'lineHeight', 'fontSize', 'fontFamily')
if @state.visible
@measureLineHeightAndDefaultCharWidth()
else
@measureLineHeightAndDefaultCharWidthWhenShown = true
else if @measureLineHeightAndDefaultCharWidthWhenShown and @state.visible and not prevState.visible
sampleFontStyling: ->
oldFontSize = @fontSize
oldFontFamily = @fontFamily
oldLineHeight = @lineHeight
{@fontSize, @fontFamily, @lineHeight} = getComputedStyle(@getTopmostDOMNode())
if @fontSize isnt oldFontSize or @fontFamily isnt oldFontFamily or @lineHeight isnt oldLineHeight
@measureLineHeightAndDefaultCharWidth()
measureLineHeightAndDefaultCharWidth: ->
@measureLineHeightAndDefaultCharWidthWhenShown = false
@refs.lines.measureLineHeightAndDefaultCharWidth()
remeasureCharacterWidthsIfNeeded: (prevState) ->
if not isEqualForProperties(prevState, @state, 'fontSize', 'fontFamily')
if @state.visible
@remeasureCharacterWidths()
else
@remeasureCharacterWidthsIfVisibleAfterNextUpdate = true
else if @remeasureCharacterWidthsIfVisibleAfterNextUpdate and @state.visible
@remeasureCharacterWidthsIfVisibleAfterNextUpdate = false
if (@fontSize isnt oldFontSize or @fontFamily isnt oldFontFamily) and @performedInitialMeasurement
@remeasureCharacterWidths()
remeasureCharacterWidths: ->
@refs.lines.remeasureCharacterWidths()
sampleBackgroundColors: (suppressUpdate) ->
{parentView} = @props
{showLineNumbers} = @state
{backgroundColor} = getComputedStyle(parentView.element)
onGutterWidthChanged: (@gutterWidth) ->
@requestUpdate()
if backgroundColor isnt @backgroundColor
@backgroundColor = backgroundColor
@requestUpdate() unless suppressUpdate
if @shouldRenderGutter()
gutterBackgroundColor = getComputedStyle(@refs.gutter.getDOMNode()).backgroundColor
if gutterBackgroundColor isnt @gutterBackgroundColor
@gutterBackgroundColor = gutterBackgroundColor
@requestUpdate() unless suppressUpdate
measureLineHeightAndDefaultCharWidth: ->
if @visible
@measureLineHeightAndDefaultCharWidthWhenShown = false
@refs.lines.measureLineHeightAndDefaultCharWidth()
else
@measureLineHeightAndDefaultCharWidthWhenShown = true
remeasureCharacterWidths: ->
if @visible
@remeasureCharacterWidthsWhenShown = false
@refs.lines.remeasureCharacterWidths()
else
@remeasureCharacterWidthsWhenShown = true
measureScrollbars: ->
return unless @visible
@measuringScrollbars = false
{editor} = @props
@@ -861,26 +913,23 @@ EditorComponent = React.createClass
node = node.parentNode
null
hide: ->
@setState(visible: false)
show: ->
@setState(visible: true)
getFontSize: ->
@state.fontSize
parseInt(getComputedStyle(@getTopmostDOMNode()).fontSize)
setFontSize: (fontSize) ->
@setState({fontSize})
@getTopmostDOMNode().style.fontSize = fontSize + 'px'
@sampleFontStyling()
getFontFamily: ->
@state.fontFamily
getComputedStyle(@getTopmostDOMNode()).fontFamily
setFontFamily: (fontFamily) ->
@setState({fontFamily})
@getTopmostDOMNode().style.fontFamily = fontFamily
@sampleFontStyling()
setLineHeight: (lineHeight) ->
@setState({lineHeight})
@getTopmostDOMNode().style.lineHeight = lineHeight
@sampleFontStyling()
setShowIndentGuide: (showIndentGuide) ->
@setState({showIndentGuide})
@@ -940,6 +989,10 @@ EditorComponent = React.createClass
if prevState.focused isnt @state.focused
@props.parentView.toggleClass('is-focused', @props.focused)
updateParentViewMiniClassIfNeeded: (prevProps) ->
if prevProps.mini isnt @props.mini
@props.parentView.toggleClass('mini', @props.mini)
runScrollBenchmark: ->
unless process.env.NODE_ENV is 'production'
ReactPerf = require 'react-atom-fork/lib/ReactDefaultPerf'
+10 -5
Ver Arquivo
@@ -416,9 +416,10 @@ class Editor extends Model
@displayBuffer.indentLevelForLine(line)
# Constructs the string used for tabs.
buildIndentString: (number) ->
buildIndentString: (number, column=0) ->
if @getSoftTabs()
_.multiplyString(" ", Math.floor(number * @getTabLength()))
tabStopViolation = column % @getTabLength()
_.multiplyString(" ", Math.floor(number * @getTabLength()) - tabStopViolation)
else
_.multiplyString("\t", Math.floor(number))
@@ -517,6 +518,8 @@ class Editor extends Model
# {Delegates to: TextBuffer.isModified}
isModified: -> @buffer.isModified()
isEmpty: -> @buffer.isEmpty()
# Public: Determine whether the user should be prompted to save before closing
# this editor.
shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors()
@@ -1064,9 +1067,11 @@ class Editor extends Model
# All the changes made inside the given {Function} can be reverted with a
# single call to {::undo}.
#
# fn - A {Function} that will be called with each {Selection}.
# fn - A {Function} that will be called once for each {Selection}. The first
# argument will be a {Selection} and the second argument will be the
# {Number} index of that selection.
mutateSelectedText: (fn) ->
@transact => fn(selection,index) for selection,index in @getSelections()
@transact => fn(selection, index) for selection, index in @getSelections()
replaceSelectedText: (options={}, fn) ->
{selectWordIfEmpty} = options
@@ -1757,7 +1762,7 @@ class Editor extends Model
{row} = start
while ++row < end.row
@addSelectionForBufferRange([[row, 0], [row, Infinity]])
@addSelectionForBufferRange([[end.row, 0], [end.row, end.column]])
@addSelectionForBufferRange([[end.row, 0], [end.row, end.column]]) unless end.column is 0
# Public: For each selection, transpose the selected text.
#
+12 -15
Ver Arquivo
@@ -16,14 +16,16 @@ GutterComponent = React.createClass
measuredWidth: null
render: ->
{scrollHeight, scrollViewHeight, onMouseDown} = @props
{scrollHeight, scrollViewHeight, onMouseDown, backgroundColor, gutterBackgroundColor} = @props
if gutterBackgroundColor isnt 'rbga(0, 0, 0, 0)'
backgroundColor = gutterBackgroundColor
div className: 'gutter', onClick: @onClick, onMouseDown: onMouseDown,
# The line-numbers div must have the 'editor-colors' class so it has an
# opaque background to avoid sub-pixel anti-aliasing problems on the GPU
div className: 'gutter line-numbers editor-colors', ref: 'lineNumbers', style:
div className: 'line-numbers', ref: 'lineNumbers', style:
height: Math.max(scrollHeight, scrollViewHeight)
WebkitTransform: @getTransform()
backgroundColor: backgroundColor
getTransform: ->
{scrollTop, useHardwareAcceleration} = @props
@@ -41,7 +43,7 @@ GutterComponent = React.createClass
componentDidMount: ->
@appendDummyLineNumber()
@updateLineNumbers() if @props.renderedRowRange?
@updateLineNumbers() if @props.performedInitialMeasurement
# Only update the gutter if the visible row range has changed or if a
# non-zero-delta change to the screen lines has occurred within the current
@@ -49,23 +51,24 @@ GutterComponent = React.createClass
shouldComponentUpdate: (newProps) ->
return true unless isEqualForProperties(newProps, @props,
'renderedRowRange', 'scrollTop', 'lineHeightInPixels', 'mouseWheelScreenRow', 'lineDecorations',
'scrollViewHeight', 'useHardwareAcceleration'
'scrollViewHeight', 'useHardwareAcceleration', 'backgroundColor', 'gutterBackgroundColor'
)
{renderedRowRange, pendingChanges, lineDecorations} = newProps
return false unless renderedRowRange?
for change in pendingChanges when Math.abs(change.screenDelta) > 0 or Math.abs(change.bufferDelta) > 0
return true unless change.end <= renderedRowRange.start or renderedRowRange.end <= change.start
false
componentDidUpdate: (oldProps) ->
return unless @props.performedInitialMeasurement
unless isEqualForProperties(oldProps, @props, 'maxLineNumberDigits')
@updateDummyLineNumber()
@removeLineNumberNodes()
unless isEqualForProperties(oldProps, @props, 'maxLineNumberDigits', 'defaultCharWidth')
@measureWidth()
@clearScreenRowCaches() unless oldProps.lineHeightInPixels is @props.lineHeightInPixels
@updateLineNumbers()
@@ -223,9 +226,3 @@ GutterComponent = React.createClass
editor.unfoldBufferRow(bufferRow)
else
editor.foldBufferRow(bufferRow)
measureWidth: ->
width = @getDOMNode().offsetWidth
unless width is @measuredWidth
@measuredWidth = width
@props.onWidthChanged?(width)
+1 -1
Ver Arquivo
@@ -9,7 +9,7 @@ HighlightsComponent = React.createClass
render: ->
div className: 'highlights',
@renderHighlights() if @isMounted()
@renderHighlights() if @props.performedInitialMeasurement
renderHighlights: ->
{editor, highlightDecorations, lineHeightInPixels} = @props
+10 -10
Ver Arquivo
@@ -43,12 +43,12 @@ class LanguageMode
commentStartRegex = new OnigRegExp("^(\\s*)(#{commentStartRegexString})")
if commentEndString
shouldUncomment = commentStartRegex.test(buffer.lineForRow(start))
shouldUncomment = commentStartRegex.testSync(buffer.lineForRow(start))
if shouldUncomment
commentEndRegexString = _.escapeRegExp(commentEndString).replace(/^(\s+)/, '(?:$1)?')
commentEndRegex = new OnigRegExp("(#{commentEndRegexString})(\\s*)$")
startMatch = commentStartRegex.search(buffer.lineForRow(start))
endMatch = commentEndRegex.search(buffer.lineForRow(end))
startMatch = commentStartRegex.searchSync(buffer.lineForRow(start))
endMatch = commentEndRegex.searchSync(buffer.lineForRow(end))
if startMatch and endMatch
buffer.transact ->
columnStart = startMatch[1].length
@@ -72,13 +72,13 @@ class LanguageMode
blank = line?.match(/^\s*$/)
allBlank = false unless blank
allBlankOrCommented = false unless blank or commentStartRegex.test(line)
allBlankOrCommented = false unless blank or commentStartRegex.testSync(line)
shouldUncomment = allBlankOrCommented and not allBlank
if shouldUncomment
for row in [start..end]
if match = commentStartRegex.search(buffer.lineForRow(row))
if match = commentStartRegex.searchSync(buffer.lineForRow(row))
columnStart = match[1].length
columnEnd = columnStart + match[2].length
buffer.setTextInRange([[row, columnStart], [row, columnEnd]], "")
@@ -168,7 +168,7 @@ class LanguageMode
continue if @editor.isBufferRowBlank(row)
indentation = @editor.indentationForBufferRow(row)
if indentation <= startIndentLevel
includeRowInFold = indentation == startIndentLevel and @foldEndRegexForScopes(scopes)?.search(@editor.lineForBufferRow(row))
includeRowInFold = indentation == startIndentLevel and @foldEndRegexForScopes(scopes)?.searchSync(@editor.lineForBufferRow(row))
foldEndRow = row if includeRowInFold
break
@@ -250,10 +250,10 @@ class LanguageMode
precedingLine = @buffer.lineForRow(precedingRow)
desiredIndentLevel = @editor.indentationForBufferRow(precedingRow)
desiredIndentLevel += 1 if increaseIndentRegex.test(precedingLine) and not @editor.isBufferRowCommented(precedingRow)
desiredIndentLevel += 1 if increaseIndentRegex.testSync(precedingLine) and not @editor.isBufferRowCommented(precedingRow)
return desiredIndentLevel unless decreaseIndentRegex = @decreaseIndentRegexForScopes(scopes)
desiredIndentLevel -= 1 if decreaseIndentRegex.test(currentLine)
desiredIndentLevel -= 1 if decreaseIndentRegex.testSync(currentLine)
Math.max(desiredIndentLevel, 0)
@@ -293,7 +293,7 @@ class LanguageMode
return unless increaseIndentRegex and decreaseIndentRegex
line = @buffer.lineForRow(bufferRow)
return unless decreaseIndentRegex.test(line)
return unless decreaseIndentRegex.testSync(line)
currentIndentLevel = @editor.indentationForBufferRow(bufferRow)
return if currentIndentLevel is 0
@@ -302,7 +302,7 @@ class LanguageMode
precedingLine = @buffer.lineForRow(precedingRow)
desiredIndentLevel = @editor.indentationForBufferRow(precedingRow)
desiredIndentLevel -= 1 unless increaseIndentRegex.test(precedingLine)
desiredIndentLevel -= 1 unless increaseIndentRegex.testSync(precedingLine)
if desiredIndentLevel >= 0 and desiredIndentLevel < currentIndentLevel
@editor.setIndentationForBufferRow(bufferRow, desiredIndentLevel)
+5 -1
Ver Arquivo
@@ -30,6 +30,10 @@ class LessCompileCache
setImportPaths: (importPaths=[]) ->
@cache.setImportPaths(importPaths.concat(@lessSearchPaths))
read: (stylesheetPath) -> @cache.readFileSync(stylesheetPath)
read: (stylesheetPath) ->
@cache.readFileSync(stylesheetPath)
cssForFile: (stylesheetPath, lessContent) ->
@cache.cssForFile(stylesheetPath, lessContent)
destroy: -> @unsubscribe()
+32 -13
Ver Arquivo
@@ -5,6 +5,7 @@ React = require 'react-atom-fork'
{$$} = require 'space-pen'
Decoration = require './decoration'
CursorsComponent = require './cursors-component'
HighlightsComponent = require './highlights-component'
DummyLineNode = $$(-> @div className: 'line', style: 'position: absolute; visibility: hidden;', => @span 'x')[0]
@@ -16,18 +17,30 @@ LinesComponent = React.createClass
displayName: 'LinesComponent'
render: ->
if @isMounted()
{editor, highlightDecorations, scrollHeight, scrollWidth} = @props
{performedInitialMeasurement, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
if performedInitialMeasurement
{editor, highlightDecorations, scrollHeight, scrollWidth, placeholderText, backgroundColor} = @props
{lineHeightInPixels, defaultCharWidth, scrollViewHeight, scopedCharacterWidthsChangeCount} = @props
{scrollTop, scrollLeft, cursorPixelRects} = @props
style =
height: Math.max(scrollHeight, scrollViewHeight)
width: scrollWidth
WebkitTransform: @getTransform()
backgroundColor: backgroundColor
# The lines div must have the 'editor-colors' class so it has an opaque
# background to avoid sub-pixel anti-aliasing problems on the GPU
div {className: 'lines editor-colors', style},
HighlightsComponent({editor, highlightDecorations, lineHeightInPixels, defaultCharWidth, scopedCharacterWidthsChangeCount})
div {className: 'lines', style},
div className: 'placeholder-text', placeholderText if placeholderText?
CursorsComponent {
cursorPixelRects, cursorBlinkPeriod, cursorBlinkResumeDelay, lineHeightInPixels,
defaultCharWidth, scopedCharacterWidthsChangeCount, performedInitialMeasurement
}
HighlightsComponent {
editor, highlightDecorations, lineHeightInPixels, defaultCharWidth,
scopedCharacterWidthsChangeCount, performedInitialMeasurement
}
getTransform: ->
{scrollTop, scrollLeft, useHardwareAcceleration} = @props
@@ -48,10 +61,13 @@ LinesComponent = React.createClass
return true unless isEqualForProperties(newProps, @props,
'renderedRowRange', 'lineDecorations', 'highlightDecorations', 'lineHeightInPixels', 'defaultCharWidth',
'scrollTop', 'scrollLeft', 'showIndentGuide', 'scrollingVertically', 'invisibles', 'visible',
'scrollViewHeight', 'mouseWheelScreenRow', 'scopedCharacterWidthsChangeCount', 'lineWidth', 'useHardwareAcceleration'
'scrollViewHeight', 'mouseWheelScreenRow', 'scopedCharacterWidthsChangeCount', 'lineWidth', 'useHardwareAcceleration',
'placeholderText', 'performedInitialMeasurement', 'backgroundColor', 'cursorPixelRects'
)
{renderedRowRange, pendingChanges} = newProps
return false unless renderedRowRange?
[renderedStartRow, renderedEndRow] = renderedRowRange
for change in pendingChanges
if change.screenDelta is 0
@@ -62,7 +78,8 @@ LinesComponent = React.createClass
false
componentDidUpdate: (prevProps) ->
{visible, scrollingVertically} = @props
{visible, scrollingVertically, performedInitialMeasurement} = @props
return unless performedInitialMeasurement
@clearScreenRowCaches() unless prevProps.lineHeightInPixels is @props.lineHeightInPixels
@removeLineNodes() unless isEqualForProperties(prevProps, @props, 'showIndentGuide', 'invisibles')
@@ -177,7 +194,7 @@ LinesComponent = React.createClass
lineHTML
else
@buildEndOfLineHTML(line, @props.invisibles)
@buildEndOfLineHTML(line, @props.invisibles) or '&nbsp;'
buildLineInnerHTML: (line) ->
{invisibles, mini, showIndentGuide, invisibles} = @props
@@ -189,7 +206,7 @@ LinesComponent = React.createClass
lineIsWhitespaceOnly = firstTrailingWhitespacePosition is 0
for token in tokens
innerHTML += @updateScopeStack(scopeStack, token.scopes)
hasIndentGuide = not mini and showIndentGuide and token.hasLeadingWhitespace or (token.hasTrailingWhitespace and lineIsWhitespaceOnly)
hasIndentGuide = not mini and showIndentGuide and (token.hasLeadingWhitespace or (token.hasTrailingWhitespace and lineIsWhitespaceOnly))
innerHTML += token.getValueAsHtml({invisibles, hasIndentGuide})
innerHTML += @popScope(scopeStack) while scopeStack.length > 0
@@ -200,9 +217,11 @@ LinesComponent = React.createClass
return '' if @props.mini or line.isSoftWrapped()
html = ''
if invisibles.cr? and line.lineEnding is '\r\n'
# Note the lack of '?' in the character checks. A user can set the chars
# to an empty string which we will interpret as not-set
if invisibles.cr and line.lineEnding is '\r\n'
html += "<span class='invisible-character'>#{invisibles.cr}</span>"
if invisibles.eol?
if invisibles.eol
html += "<span class='invisible-character'>#{invisibles.eol}</span>"
html
@@ -212,7 +231,7 @@ LinesComponent = React.createClass
# Find a common prefix
for scope, i in desiredScopes
break unless scopeStack[i]?.scope is desiredScopes[i]
break unless scopeStack[i] is desiredScopes[i]
# Pop scopes until we're at the common prefx
until scopeStack.length is i
+70 -1
Ver Arquivo
@@ -158,7 +158,7 @@ class Package
loadStylesheets: ->
@stylesheets = @getStylesheetPaths().map (stylesheetPath) ->
[stylesheetPath, atom.themes.loadStylesheet(stylesheetPath)]
[stylesheetPath, atom.themes.loadStylesheet(stylesheetPath, true)]
getStylesheetsPath: ->
path.join(@path, @constructor.stylesheetsDir)
@@ -269,6 +269,7 @@ class Package
requireMainModule: ->
return @mainModule if @mainModule?
return unless @isCompatible()
mainModulePath = @getMainModulePath()
@mainModule = require(mainModulePath) if fs.isFileSync(mainModulePath)
@@ -340,3 +341,71 @@ class Package
for eventHandler in eventHandlers
eventHandler.handler = eventHandler.disabledHandler
delete eventHandler.disabledHandler
# Does the given module path contain native code?
isNativeModule: (modulePath) ->
try
fs.listSync(path.join(modulePath, 'build', 'Release'), ['.node']).length > 0
catch error
false
# Get an array of all the native modules that this package depends on.
# This will recurse through all dependencies.
getNativeModuleDependencyPaths: ->
nativeModulePaths = []
traversePath = (nodeModulesPath) =>
try
for modulePath in fs.listSync(nodeModulesPath)
nativeModulePaths.push(modulePath) if @isNativeModule(modulePath)
traversePath(path.join(modulePath, 'node_modules'))
traversePath(path.join(@path, 'node_modules'))
nativeModulePaths
# Get the incompatible native modules that this package depends on.
# This recurses through all dependencies and requires all modules that
# contain a `.node` file.
#
# This information is cached in local storage on a per package/version basis
# to minimize the impact on startup time.
getIncompatibleNativeModules: ->
localStorageKey = "installed-packages:#{@name}:#{@metadata.version}"
try
{incompatibleNativeModules} = JSON.parse(global.localStorage.getItem(localStorageKey)) ? {}
return incompatibleNativeModules if incompatibleNativeModules?
incompatibleNativeModules = []
for nativeModulePath in @getNativeModuleDependencyPaths()
try
require(nativeModulePath)
catch error
try
version = require("#{nativeModulePath}/package.json").version
incompatibleNativeModules.push
path: nativeModulePath
name: path.basename(nativeModulePath)
version: version
error: error.message
global.localStorage.setItem(localStorageKey, JSON.stringify({incompatibleNativeModules}))
incompatibleNativeModules
# Public: Is this package compatible with this version of Atom?
#
# Incompatible packages cannot be activated. This will include packages
# installed to ~/.atom/packages that were built against node 0.11.10 but
# now need to be upgrade to node 0.11.13.
#
# Returns a {Boolean}, true if compatible, false if incompatible.
isCompatible: ->
return @compatible if @compatible?
if @path.indexOf(path.join(atom.packages.resourcePath, 'node_modules') + path.sep) is 0
# Bundled packages are always considered compatible
@compatible = true
else if packageMain = @getMainModulePath()
@incompatibleModules = @getIncompatibleNativeModules()
@compatible = @incompatibleModules.length is 0
else
@compatible = true
+58 -24
Ver Arquivo
@@ -1,34 +1,36 @@
{View, $} = require 'space-pen'
React = require 'react-atom-fork'
EditorComponent = require './editor-component'
{defaults} = require 'underscore-plus'
TextBuffer = require 'text-buffer'
Editor = require './editor'
EditorComponent = require './editor-component'
module.exports =
class ReactEditorView extends View
@content: -> @div class: 'editor react'
@content: (params) ->
attributes = params.attributes ? {}
attributes.class = 'editor react editor-colors'
@div attributes
focusOnAttach: false
constructor: (@editor, @props) ->
constructor: (editorOrParams, props) ->
super
getEditor: -> @editor
if editorOrParams instanceof Editor
@editor = editorOrParams
else
{@editor, mini, placeholderText} = editorOrParams
props ?= {}
props.mini = mini
props.placeholderText = placeholderText
@editor ?= new Editor
buffer: new TextBuffer
softWrap: false
tabLength: 2
softTabs: true
getModel: -> @editor
Object.defineProperty @::, 'lineHeight', get: -> @editor.getLineHeightInPixels()
Object.defineProperty @::, 'charWidth', get: -> @editor.getDefaultCharWidth()
Object.defineProperty @::, 'firstRenderedScreenRow', get: -> @component.getRenderedRowRange()[0]
Object.defineProperty @::, 'lastRenderedScreenRow', get: -> @component.getRenderedRowRange()[1]
Object.defineProperty @::, 'active', get: -> @is(@getPane().activeView)
Object.defineProperty @::, 'isFocused', get: -> @component?.state.focused
afterAttach: (onDom) ->
return unless onDom
return if @attached
@attached = true
props = defaults({@editor, parentView: this}, @props)
props = defaults({@editor, parentView: this}, props)
@component = React.renderComponent(EditorComponent(props), @element)
node = @component.getDOMNode()
@@ -53,8 +55,24 @@ class ReactEditorView extends View
lines.addClass(klass)
lines.length > 0
@focus() if @focusOnAttach
getEditor: -> @editor
getModel: -> @editor
Object.defineProperty @::, 'lineHeight', get: -> @editor.getLineHeightInPixels()
Object.defineProperty @::, 'charWidth', get: -> @editor.getDefaultCharWidth()
Object.defineProperty @::, 'firstRenderedScreenRow', get: -> @component.getRenderedRowRange()[0]
Object.defineProperty @::, 'lastRenderedScreenRow', get: -> @component.getRenderedRowRange()[1]
Object.defineProperty @::, 'active', get: -> @is(@getPane()?.activeView)
Object.defineProperty @::, 'isFocused', get: -> @component?.state.focused
afterAttach: (onDom) ->
return unless onDom
return if @attached
@attached = true
@component.pollDOM()
@focus() if @focusOnAttach
@trigger 'editor:attached', [this]
scrollTop: (scrollTop) ->
@@ -97,7 +115,7 @@ class ReactEditorView extends View
@find('.lines').prepend(view)
beforeRemove: ->
React.unmountComponentAtNode(@element)
React.unmountComponentAtNode(@element) if @component.isMounted()
@attached = false
@trigger 'editor:detached', this
@@ -122,7 +140,7 @@ class ReactEditorView extends View
pane?.splitDown(pane?.copyActiveItem()).activeView
getPane: ->
@closest('.pane').view()
@parent('.item-views').parents('.pane').view()
focus: ->
if @component?
@@ -132,11 +150,18 @@ class ReactEditorView extends View
hide: ->
super
@component?.hide()
@pollComponentDOM()
show: ->
super
@component?.show()
@pollComponentDOM()
pollComponentDOM: ->
return unless @component?
valueToRestore = @component.performSyncUpdates
@component.performSyncUpdates = true
@component.pollDOM()
@component.performSyncUpdates = valueToRestore
pageDown: ->
@editor.pageDown()
@@ -208,3 +233,12 @@ class ReactEditorView extends View
resetDisplay: -> # No-op shim for package specs
redraw: -> # No-op shim
setPlaceholderText: (placeholderText) ->
if @component?
@component.setProps({placeholderText})
else
@props.placeholderText = placeholderText
lineElementForScreenRow: (screenRow) ->
$(@component.lineNodeForScreenRow(screenRow))
+2 -1
Ver Arquivo
@@ -17,8 +17,9 @@ ScrollbarComponent = React.createClass
style.width = verticalScrollbarWidth
style.bottom = horizontalScrollbarHeight if scrollableInOppositeDirection
when 'horizontal'
style.height = horizontalScrollbarHeight
style.left = 0
style.right = verticalScrollbarWidth if scrollableInOppositeDirection
style.height = horizontalScrollbarHeight
div {className, style, @onScroll},
switch orientation
+4 -1
Ver Arquivo
@@ -1,5 +1,8 @@
{$, View} = require './space-pen-extensions'
EditorView = require './editor-view'
if atom.config.get('core.useReactMiniEditors')
EditorView = require './react-editor-view'
else
EditorView = require './editor-view'
fuzzyFilter = require('fuzzaldrin').filter
# Public: Provides a view that renders a list of items with an editor that
+1 -1
Ver Arquivo
@@ -392,7 +392,7 @@ class Selection extends Model
if autoIndent and delta > 0
@insertText(@editor.buildIndentString(delta))
else
@insertText(@editor.getTabText())
@insertText(@editor.buildIndentString(1, @cursor.getBufferColumn()))
else
@indentSelectedRows()
+13 -5
Ver Arquivo
@@ -128,7 +128,7 @@ class ThemeManager
@userStylesheetFile = new File(userStylesheetPath)
@userStylesheetFile.on 'contents-changed moved removed', =>
@loadUserStylesheet()
userStylesheetContents = @loadStylesheet(userStylesheetPath)
userStylesheetContents = @loadStylesheet(userStylesheetPath, true)
@applyStylesheet(userStylesheetPath, userStylesheetContents, 'userTheme')
loadBaseStylesheets: ->
@@ -167,19 +167,27 @@ class ThemeManager
fullPath
loadStylesheet: (stylesheetPath) ->
loadStylesheet: (stylesheetPath, importFallbackVariables) ->
if path.extname(stylesheetPath) is '.less'
@loadLessStylesheet(stylesheetPath)
@loadLessStylesheet(stylesheetPath, importFallbackVariables)
else
fs.readFileSync(stylesheetPath, 'utf8')
loadLessStylesheet: (lessStylesheetPath) ->
loadLessStylesheet: (lessStylesheetPath, importFallbackVariables=false) ->
unless @lessCache?
LessCompileCache = require './less-compile-cache'
@lessCache = new LessCompileCache({@resourcePath, importPaths: @getImportPaths()})
try
@lessCache.read(lessStylesheetPath)
if importFallbackVariables
baseVarImports = """
@import "variables/ui-variables";
@import "variables/syntax-variables";
"""
less = fs.readFileSync(lessStylesheetPath, 'utf8')
@lessCache.cssForFile(lessStylesheetPath, [baseVarImports, less].join('\n'))
else
@lessCache.read(lessStylesheetPath)
catch e
console.error """
Error compiling less stylesheet: #{lessStylesheetPath}
+26 -1
Ver Arquivo
@@ -71,7 +71,7 @@ class WorkspaceView extends View
projectHome: path.join(fs.getHomeDirectory(), 'github')
audioBeep: true
destroyEmptyPanes: true
useReactEditor: false
useReactEditor: true
@content: ->
@div class: 'workspace', tabindex: -1, =>
@@ -96,6 +96,11 @@ class WorkspaceView extends View
when 'overlay'
@addClass("scrollbars-visible-when-scrolling")
@subscribe atom.config.observe 'editor.fontSize', @setEditorFontSize
@subscribe atom.config.observe 'editor.fontFamily', @setEditorFontFamily
@subscribe atom.config.observe 'editor.lineHeight', @setEditorLineHeight
@updateTitle()
@on 'focus', (e) => @handleFocus(e)
@@ -340,6 +345,26 @@ class WorkspaceView extends View
beforeRemove: ->
@model.destroy()
setEditorFontSize: (fontSize) =>
@setEditorStyle('font-size', fontSize + 'px')
setEditorFontFamily: (fontFamily) =>
@setEditorStyle('font-family', fontFamily)
setEditorLineHeight: (lineHeight) =>
@setEditorStyle('line-height', lineHeight)
setEditorStyle: (property, value) ->
unless styleNode = atom.themes.stylesheetElementForId('global-editor-styles')[0]
atom.themes.applyStylesheet('global-editor-styles', '.editor {}')
styleNode = atom.themes.stylesheetElementForId('global-editor-styles')[0]
{sheet} = styleNode
editorRule = sheet.cssRules[0]
editorRule.style[property] = value
atom.themes.emit 'stylesheet-updated', sheet
atom.themes.emit 'stylesheets-changed'
# Deprecated
eachPane: (callback) ->
deprecate("Use WorkspaceView::eachPaneView instead")
+2
Ver Arquivo
@@ -1,7 +1,9 @@
// Import from the syntax theme's variables with a fallback to ./variables/syntax-variables.less
@import "./variables/syntax-variables";
@import "syntax-variables";
// Import from the ui theme's variables with a fallback to ./variables/ui-variables.less
@import "./variables/ui-variables";
@import "ui-variables";
@import "octicon-utf-codes";
+22 -8
Ver Arquivo
@@ -3,6 +3,10 @@
@import "octicon-mixins";
.editor.react {
.editor-contents {
width: 100%;
}
.underlayer {
position: absolute;
top: 0;
@@ -81,15 +85,29 @@
}
}
.editor.mini {
font-size: @input-font-size;
line-height: @component-line-height;
max-height: @component-line-height + 2; // +2 for borders
.placeholder-text {
position: absolute;
color: @text-color-subtle;
}
}
.editor {
z-index: 0;
font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
line-height: 1.3;
}
.editor, .editor-contents {
overflow: hidden;
cursor: text;
display: -webkit-flex;
-webkit-user-select: none;
position: relative;
z-index: 0;
font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
line-height: 1.3;
}
.editor .gutter .line-number.cursor-line {
@@ -272,7 +290,7 @@
z-index: -1;
}
.editor.mini {
.editor.mini:not(.react) {
height: auto;
line-height: 25px;
@@ -289,8 +307,4 @@
.scroll-view {
overflow: hidden;
}
.placeholder-text {
color: @text-color-subtle;
}
}
+1
Ver Arquivo
@@ -67,6 +67,7 @@
// Sizes
@font-size: 13px;
@input-font-size: 14px;
@disclosure-arrow-size: 12px;