Comparar commits

...

1256 Commits

Autor SHA1 Mensagem Data
Cheng Zhao fae28d8c21 Upgrade apm for proxy support. 2014-02-03 14:51:15 +08:00
Kevin Sawicki f7e11a1fb5 Upgrade to language-javascript@0.5.0 2014-01-31 15:49:42 -08:00
Kevin Sawicki aab5deaae6 Upgrade to language-ruby@0.8.0 refs #1470 2014-01-31 15:40:53 -08:00
Kevin Sawicki 50f68c38ec Merge pull request #1499 from atom/ks-remove-select-list-shim
Remove SelectList shim
2014-01-31 15:31:26 -08:00
Kevin Sawicki d778e13ffb 💄 Sort exports 2014-01-31 15:22:48 -08:00
Kevin Sawicki 9918a0b73f Remove SelectList shim 2014-01-31 15:22:16 -08:00
Kevin Sawicki 374fe99aaf Upgrade to symbols-view@0.30.0 2014-01-31 15:21:48 -08:00
Kevin Sawicki ea052fc667 Upgrade to styleguide@0.22.0 2014-01-31 15:20:11 -08:00
Kevin Sawicki d11037f6d2 Upgrade to spell-check@0.21.0 2014-01-31 15:19:42 -08:00
Kevin Sawicki 777c4a5e43 Upgrade to grammar-selector@0.18.0 2014-01-31 15:10:42 -08:00
Kevin Sawicki a897a320a9 Upgrade to fuzzy-finder@0.32.0 2014-01-31 15:09:32 -08:00
Kevin Sawicki a94e9df641 Upgrade to command-palette@0.15.0 2014-01-31 15:07:56 -08:00
Kevin Sawicki 45d8df37fa Upgrade to bookmarks@0.18.0 2014-01-31 15:07:30 -08:00
Kevin Sawicki 83639c4cfa Upgrade to autocomplete@0.21.0 2014-01-31 15:07:12 -08:00
Kevin Sawicki 6c960183fd Merge pull request #1498 from atom/ks-rename-select-list
Rename SelectList to SelectListView
2014-01-31 15:00:08 -08:00
Kevin Sawicki 0730c7902d Update export docs for SelectListView 2014-01-31 14:51:06 -08:00
Kevin Sawicki 012c38cf11 Shim export to old name 2014-01-31 14:50:33 -08:00
Kevin Sawicki 0785fb3a48 Add export shim 2014-01-31 14:50:16 -08:00
Kevin Sawicki 563065aeb1 Rename SelectList to SelectListView 2014-01-31 14:49:36 -08:00
Kevin Sawicki 2b1f9531e5 Upgrade to exception-reporting@0.13.0 2014-01-31 14:38:47 -08:00
Kevin Sawicki 665d1b9581 Merge pull request #1497 from atom/ks-coffee-script-1-7
More CoffeeScript 1.7
2014-01-31 14:20:40 -08:00
Kevin Sawicki d79d819048 Dedupe fs-plus and season 2014-01-31 14:09:19 -08:00
Kevin Sawicki 6ae2d9737d Upgrade to settings-view@0.63.0 2014-01-31 14:02:16 -08:00
Kevin Sawicki 54b67ea6b9 Upgrade apm for version bumps 2014-01-31 13:47:37 -08:00
Kevin Sawicki 41dc113088 Upgrade to coffeestack@0.7.0 2014-01-31 13:45:45 -08:00
Kevin Sawicki 3216d767da Upgrade to jasmine-tagged 1.x 2014-01-31 13:45:14 -08:00
Kevin Sawicki 94987c6769 Upgrade to season 1.x 2014-01-31 13:43:44 -08:00
Kevin Sawicki f423b54d5b Add underscore-plus 1.x 2014-01-31 13:43:31 -08:00
Kevin Sawicki 86dc499a99 Upgrade to first-mate 1.x 2014-01-31 13:42:59 -08:00
Kevin Sawicki ec6184322c Upgrade to grunt-cson@0.6.0 2014-01-31 11:21:47 -08:00
Kevin Sawicki bde4b88f9f Upgrade to grunt-contrib-coffee@0.9.0 2014-01-31 11:18:53 -08:00
Kevin Sawicki e0f41f8cc5 Upgrade to package-generator@0.25.0 2014-01-31 11:11:07 -08:00
Kevin Sawicki c49c48381a Return functions return value from measure 2014-01-31 10:41:31 -08:00
Kevin Sawicki 73d36e464d Upgrade to settings-view@0.62.0 2014-01-31 10:29:01 -08:00
Kevin Sawicki 2e8fd21193 Upgrade to snippets@0.24.0 2014-01-31 10:24:31 -08:00
Kevin Sawicki 39d525590b Upgrade to first-mate 1.1 2014-01-31 08:48:46 -08:00
Kevin Sawicki 4f6adc51b4 Merge pull request #1493 from atom/ks-rename-user-stylesheet
Rename ~/.atom/user.css to ~/.atom/styles.css
2014-01-31 08:38:53 -08:00
Kevin Sawicki 73c714b62d 📝 Update user stylesheet docs to use styles.css 2014-01-30 17:07:19 -08:00
Kevin Sawicki caa16f2718 Update user stylesheet path in spec 2014-01-30 16:58:35 -08:00
Kevin Sawicki 1b17441bfe Update default stylesheet name to styles.less 2014-01-30 16:58:20 -08:00
Kevin Sawicki 9a97bac05d Add cursor selector example 2014-01-30 16:57:27 -08:00
Kevin Sawicki 9252cd2a1b 📝 Doc reloading of ~/.atom/styles.css 2014-01-30 16:55:51 -08:00
Kevin Sawicki 1c790a3c55 Rename ~/.atom/user.css to ~/.atom/styles.css 2014-01-30 16:53:25 -08:00
Kevin Sawicki 11f61c88d8 Upgrade to settings-view@0.61.0 2014-01-30 16:42:57 -08:00
Kevin Sawicki 64d9eb24d2 Upgrade to find-and-replace@0.81.0 2014-01-30 16:39:27 -08:00
Kevin Sawicki 73b3b9870f Use 512x522 icon 2014-01-30 16:17:18 -08:00
Kevin Sawicki 1c8781268e Try out green app icon 2014-01-30 16:15:28 -08:00
Kevin Sawicki 662c130caf Upgrade to settings-view@0.60.0 2014-01-30 15:54:32 -08:00
Kevin Sawicki 40d9d6110c Upgrade to settings-view@0.59.0 2014-01-30 15:01:38 -08:00
Kevin Sawicki a6f42d6989 Upgrade to fuzzaldrin 1.x 2014-01-30 15:01:15 -08:00
Kevin Sawicki e9b4fb828e Merge pull request #1491 from atom/ks-prevent-space-scrolling
Prevent scrolling when a space is pressed in editor
2014-01-30 14:57:25 -08:00
Kevin Sawicki 84c5a25ef3 📝 Shorten comment 2014-01-30 12:44:01 -08:00
Kevin Sawicki 4a54565f59 Prevent scrolling when a space is pressed in editor
Closes atom/settings-view#25
2014-01-30 12:44:01 -08:00
Kevin Sawicki 1b396b5ce7 Upgrade to settings-view@0.58.0 2014-01-30 11:53:43 -08:00
Kevin Sawicki fe748dbcc8 Update octicons 2014-01-29 18:00:00 -08:00
Kevin Sawicki 1e759ee646 Add missing package icon 2014-01-29 17:58:35 -08:00
Kevin Sawicki 09952d18c0 Only attempt to require bootstrap/js/tooltip once 2014-01-29 15:28:55 -08:00
Corey Johnson 337390df47 Merge pull request #1489 from atom/cj-update-coffee-script
Update coffee script v1.7.0
2014-01-29 09:09:36 -08:00
Kevin Sawicki d29a0114ef Upgrade to go-to-line@0.16.0 2014-01-28 18:12:54 -08:00
Nathan Sobo b97db1914f Merge pull request #1455 from atom/ns-workspace-specs-cleanup
Cleanup workspace and its specs
2014-01-28 17:38:58 -08:00
Nathan Sobo 29f480661c Merge branch 'master' into ns-workspace-specs-cleanup 2014-01-28 18:25:13 -07:00
probablycorey d7638b4420 Use require('coffee-script').register() 2014-01-28 16:35:05 -08:00
Corey Johnson ce881c87b9 Merge pull request #1486 from atom/cj-first-package-doc
Simplify first package docs
2014-01-28 13:51:16 -08:00
probablycorey d9b00f16f7 Upgrade to coffee-script 1.7.0
http://coffeescript.org/#changelog
2014-01-28 11:39:01 -08:00
probablycorey 2590bad75f Use json to render code block 2014-01-28 11:33:07 -08:00
probablycorey 6ff553e41c Fix reload window text 2014-01-28 11:32:31 -08:00
probablycorey ec3ca7e429 Add an and 2014-01-28 11:27:06 -08:00
probablycorey 386767868e Remove activation events comment
I think we all agree that it would be better if we didn't have to 
deal with activationEvents. But for now I'm leaving this in because it
is required.
2014-01-28 11:24:53 -08:00
probablycorey e2bb4747fa 💄 2014-01-28 11:23:50 -08:00
probablycorey 885a4e2b2a Document the update-package-dependencies:update command. 2014-01-28 11:22:17 -08:00
probablycorey e31fab7fe4 Link to npm 2014-01-28 11:21:58 -08:00
probablycorey 0a2b173270 Inline links 2014-01-28 11:11:11 -08:00
Kevin Sawicki c1a9c3b5fb Update octicons 2014-01-28 10:06:54 -08:00
Kevin Sawicki 1550511e54 Write octicon codes to variables folder 2014-01-28 10:06:40 -08:00
Kevin Sawicki 44999b0b37 Upgrade to snippets@0.22.0 2014-01-27 18:58:26 -08:00
Kevin Sawicki 0f2931d0a2 Add open-your-snippets command 2014-01-27 18:58:07 -08:00
probablycorey 064a384318 Insert 'Hello, World!' text instead of uppercasing selection. 2014-01-27 17:40:19 -08:00
probablycorey 5708140f10 Use string interpolation 2014-01-27 17:30:14 -08:00
probablycorey aceeb10a0d Upgrade to update-package-dependencies@0.2.0 2014-01-27 17:27:42 -08:00
probablycorey 0940668263 Add update-package-dependencies package 2014-01-27 17:27:42 -08:00
Kevin Sawicki bcac3cc000 Merge pull request #1487 from atom/ks-dot-atom-snippets-file
~/.atom/snippets.cson support
2014-01-27 17:19:22 -08:00
Kevin Sawicki 5b39fc2e11 Upgrade to language-coffee-script@0.6.0 2014-01-27 13:06:27 -08:00
Kevin Sawicki cb0e0751d8 Upgrade to snippets@0.21.0 2014-01-27 12:58:46 -08:00
Kevin Sawicki a67d6362c2 Assert snippet.cson is copied over 2014-01-27 12:50:57 -08:00
Kevin Sawicki 5eb8875ad2 Add Open Your Snippets menu item 2014-01-27 11:17:20 -08:00
Kevin Sawicki e6e7106ac5 Add sample snippets.cson to dot-atom template 2014-01-27 11:16:24 -08:00
Kevin Sawicki 257d0d3a25 Remove template snippets folder 2014-01-27 11:02:52 -08:00
Nathan Sobo 632ba0217a 💄 2014-01-27 11:49:09 -07:00
Nathan Sobo bf1a2a532e A little wordsmithing. Feel free to push back on whatever. 2014-01-27 11:00:32 -07:00
probablycorey 72bb83ccd0 Link to ascii art 2014-01-27 08:55:35 -08:00
probablycorey def2001eb6 Use json instead of coffeescript in code block 2014-01-27 08:54:47 -08:00
probablycorey 5bda9b8a8e Remove trailing dot 2014-01-27 08:53:47 -08:00
probablycorey 0b0ad42610 💄 2014-01-27 08:46:27 -08:00
Cheng Zhao 7c4b453e64 Do not show unresponsive dialog when running specs. 2014-01-27 18:56:54 +08:00
Cheng Zhao 740e0731fe Merge pull request #1485 from atom/atom-shell-v0.8.7
Update atom-shell to v0.8.7
2014-01-27 02:53:41 -08:00
Cheng Zhao b6cf097abd Update atom-shell to v0.8.7. 2014-01-27 18:47:58 +08:00
Cheng Zhao aa8d03b092 Merge pull request #1473 from atom/cz-windows-start
Fix grunt install on Windows
2014-01-26 20:05:15 -08:00
Nathan Sobo aec9e75ecb Send more info on errors converting buffer positions to screen positions
We've gotten one rogue error but I have no idea how to reproduce it.
This will tell us if soft wrap is enabled and if any folds are present
so hopefully we can start narrowing these down.
2014-01-26 15:00:58 -07:00
Nathan Sobo b05e20245f Upgrade find and replace to 0.80.0 to fix invalid regex exceptions
And also to remove live project search
2014-01-26 14:26:14 -07:00
Nathan Sobo 17d30cc526 Revise in-depth keymap overview 2014-01-25 17:49:40 -07:00
Nathan Sobo f631660b32 Start on overview of atom's global variables 2014-01-25 17:49:39 -07:00
probablycorey 2b34b2b9ba Revert "Remove sparkle keys from plist."
This reverts commit f92f130606.
2014-01-24 18:25:36 -08:00
probablycorey 5be6cfa678 Update first package documentation 2014-01-24 18:07:37 -08:00
Kevin Sawicki b5449dec6c Upgrade to fuzzaldrin@0.7.0 2014-01-24 17:56:01 -08:00
Kevin Sawicki be0e36b663 Rename Gutter to GutterView
Refs #1468
2014-01-24 17:30:29 -08:00
probablycorey f92f130606 Remove sparkle keys from plist. 2014-01-24 15:10:51 -08:00
Cheng Zhao d931299b9f Create shortcut on Desktop. 2014-01-24 21:55:49 +08:00
Cheng Zhao b1778aa7df Use administrator power to install Atom on Windows. 2014-01-24 21:07:32 +08:00
Cheng Zhao c5d7614d80 Use named pipe instead of socket file on Windows. 2014-01-24 19:22:13 +08:00
probablycorey 0d34df2238 Update metrics package to 0.24.0 2014-01-23 15:51:42 -08:00
probablycorey ee24b373c0 Update metrics package 2014-01-23 15:32:44 -08:00
Kevin Sawicki 8e6aa1ee9a Doc available classes from 2014-01-23 15:13:12 -08:00
Kevin Sawicki 9e381db265 Upgrade to to-the-hubs@0.18.0 2014-01-23 15:05:52 -08:00
Corey Johnson 6d4f532a32 Merge pull request #1464 from atom/cj-cli-install
Make CLI installation easier.
2014-01-23 12:40:57 -08:00
Cheng Zhao 998aedf367 Merge pull request #1467 from atom/atom-shell-v0.8.6
Upgrade to atom-shell@v0.8.6
2014-01-23 05:33:21 -08:00
Cheng Zhao 5f0a3061ac Remove the workaround for net.connect delay. 2014-01-23 21:03:17 +08:00
Cheng Zhao c424a39538 Upgrade to atom-shell@v0.8.6. 2014-01-23 21:02:41 +08:00
Cheng Zhao 150815edfd Merge pull request #1443 from atom/fix-windows
Fix Windows build
2014-01-22 23:18:03 -08:00
Kevin Sawicki 00ba7d92d0 Upgrade to language-coffee-script@0.5.0 for regex fix 2014-01-22 17:47:32 -08:00
Kevin Sawicki 3dc51365b3 Prepare 0.49.0 release 2014-01-22 17:25:33 -08:00
Kevin Sawicki d18a45f37c Bump remove timeout to 30 seconds 2014-01-22 16:38:47 -08:00
Kevin Sawicki d8c1587534 📝 Mark getters a public 2014-01-22 16:31:10 -08:00
Kevin Sawicki a4754b2bd5 📝 Mark ThemeManager class public 2014-01-22 16:25:55 -08:00
Kevin Sawicki f3f6ec424f 📝 Mark Pasteboard class as public 2014-01-22 16:11:58 -08:00
probablycorey 020326ffad Only display one dialog on successful installation. 2014-01-22 16:01:52 -08:00
Kevin Sawicki ac2985af36 Call getSelectedText() on Editor 2014-01-22 15:57:15 -08:00
probablycorey ca8609c925 Fix 🐛 2014-01-22 15:56:18 -08:00
probablycorey d2e4c61e0b Make cli installation work with install-cli script 2014-01-22 15:56:05 -08:00
probablycorey 399c4f9f95 Fix spelling error 2014-01-22 15:54:49 -08:00
probablycorey 3da7fe7300 Update error message 2014-01-22 15:42:08 -08:00
probablycorey 40048da314 Add 'Install Shell Commands' menu item. 2014-01-22 15:33:32 -08:00
probablycorey 04c8549c38 Use a single command to install apm and atom 2014-01-22 15:33:16 -08:00
probablycorey 4ef6eae02f Add install cli commands for apm and atom 2014-01-22 15:17:23 -08:00
Nathan Sobo 52dcf6a721 Guard against null line number elements when updating fold indicators
Fixes #1461 but doesn't really address the root cause.
2014-01-22 16:06:46 -07:00
probablycorey 9169e9e227 Verify platform inside command installer 2014-01-22 14:54:01 -08:00
probablycorey 19e0854036 Log warning if commands fail to install 2014-01-22 14:53:38 -08:00
Kevin Sawicki cd41637df0 Upgrade to git-utils@0.34.0 for symlink fix 2014-01-22 14:15:19 -08:00
probablycorey 8973a6d777 Display dialog error when commands can't be installed 2014-01-22 13:51:51 -08:00
probablycorey e6b9c67aad Merge remote-tracking branch 'origin/master' into cj-cli-install 2014-01-22 13:35:25 -08:00
probablycorey eb28c15f69 Simplify installation callbacks 2014-01-22 13:35:07 -08:00
probablycorey a42a4dd352 Escape from a tool panel does not emit core:close 2014-01-22 10:46:18 -08:00
Kevin Sawicki cc53b6fbef 📝 Doc Syntax class 2014-01-22 10:30:25 -08:00
Kevin Sawicki b31089cbb9 📝 Mention atom.project global in project docs 2014-01-22 10:21:37 -08:00
Kevin Sawicki 4d4ff84047 📝 Doc how to require WorkspaceView in package specs 2014-01-22 10:19:54 -08:00
Kevin Sawicki 0875e00f9c Upgrade to atom/biscotto@12188bfbe5 2014-01-22 10:17:04 -08:00
Kevin Sawicki b9d45680c3 📝 Wrap types in curlies 2014-01-22 10:09:08 -08:00
Kevin Sawicki 1fa2099eba Don't mark text-utils methods as public 2014-01-22 10:05:53 -08:00
Cheng Zhao 4d74a69277 Use nslog on Windows. 2014-01-22 23:10:45 +08:00
Cheng Zhao 3aa67bff8b Update to nslog@0.4.0 2014-01-22 23:10:44 +08:00
Cheng Zhao 325482353e Update grunt-download-atom-shell to v0.6.0. 2014-01-22 23:10:44 +08:00
Cheng Zhao cf4e08cdc0 Fix executing grunt under Windows. 2014-01-22 23:10:44 +08:00
Cheng Zhao ced02faf0f Updater to terminal@0.27.0 2014-01-22 23:10:43 +08:00
Cheng Zhao 8afca3ac86 Merge pull request #1459 from atom/source-map
Add source map support in dev mode
2014-01-21 23:00:43 -08:00
Cheng Zhao d13d2d3112 Generate source map in coffee-cache. 2014-01-22 14:36:50 +08:00
Nathan Sobo c3d5f713ca Rename internals directory to advanced 2014-01-21 21:04:33 -07:00
Nathan Sobo 042684212e Use atom.config instead of config 2014-01-21 21:04:33 -07:00
Nathan Sobo 81987efed7 Fix typo 2014-01-21 21:04:33 -07:00
Nathan Sobo f2e123e295 Merge pull request #1457 from shama/typo
docs: occured -> occurred.
2014-01-21 19:58:03 -08:00
Nathan Sobo 8d193d542b Update configuration docs 2014-01-21 20:56:30 -07:00
Nathan Sobo 8ca8ac5efc Make ConfigObserver a proper mixin and export it 2014-01-21 20:56:23 -07:00
Kyle Robinson Young f6c7dd0b2f docs: occured -> occurred. 2014-01-21 19:41:53 -08:00
Nathan Sobo b380551e5e Nuke private beta docs 2014-01-21 20:34:57 -07:00
Nathan Sobo 7dcb340643 Streamline the getting started docs 2014-01-21 20:33:53 -07:00
Kevin Sawicki f0339936ee Remove docs/output/api before building 2014-01-21 18:56:15 -08:00
Kevin Sawicki 1ae10e59ae Upgrade to atom/biscotto@4a0c9cb9d7 2014-01-21 18:43:07 -08:00
Kevin Sawicki e4bcb52573 📝 Add requiring in packages example to exported classes 2014-01-21 18:43:07 -08:00
Kevin Sawicki 292ff0de52 📝 Use singular package 2014-01-21 18:43:07 -08:00
probablycorey 5a70276201 Fix specs 2014-01-21 18:09:53 -08:00
probablycorey 1bd4d51879 Install atom and apm cli commands to /usr/local/bin 2014-01-21 18:00:59 -08:00
Corey Johnson a95a510770 Merge pull request #1456 from atom/cj-os-keybindings
Use file suffix to load specific platform keybindings.
2014-01-21 17:59:55 -08:00
probablycorey 7d1be155fa 💄 2014-01-21 17:55:05 -08:00
Kevin Sawicki 41de6bdb70 Just hackable for now 2014-01-21 17:51:54 -08:00
Kevin Sawicki 1d9bca12e0 📝 Mention that atom.project.getRepo() might be unavailable 2014-01-21 17:45:32 -08:00
Kevin Sawicki e9c296968d Upgrade to atom/biscotto@408b1862da 2014-01-21 17:43:36 -08:00
Kevin Sawicki 352eab47df 📝 Merge example with return doc 2014-01-21 17:21:42 -08:00
Kevin Sawicki 002c4dcb80 Upgrade to atom/biscotto@7ba14a419 2014-01-21 17:17:06 -08:00
Kevin Sawicki 03250f79c6 📝 Add period to first line of loadOrCreate doc 2014-01-21 17:05:55 -08:00
probablycorey 1142da1848 Use body instead of workspace so keymaps work inside spec window 2014-01-21 16:48:56 -08:00
probablycorey e53ed10169 Only allow one platform specific keybinding file. 2014-01-21 16:34:52 -08:00
probablycorey 3fb54b657d Update apm with new keybinding docs 2014-01-21 16:27:25 -08:00
Kevin Sawicki 4b3b0145a7 📝 Mark DisplayBuffer delegates as public 2014-01-21 16:17:47 -08:00
probablycorey ec558f9a9b Update keymap files 2014-01-21 16:13:45 -08:00
Kevin Sawicki 051f1b4777 📝 Mark setEditorWidthInChars as public 2014-01-21 16:12:06 -08:00
probablycorey 2e4e178091 Don't load keymap files with other platforms in the suffix
Example: On osx `keymap.cson` and `keymap-darwin.cson` would load. But
`keymap-win32.cson` would not load.
2014-01-21 16:03:34 -08:00
Kevin Sawicki 1fa04cb161 Use biscotto fork 2014-01-21 15:54:28 -08:00
Nathan Sobo 69df046cb0 Move font size increase/decrease to the Workspace model 2014-01-21 16:44:06 -07:00
Nathan Sobo d491007da8 Remove tests for simple delegators 2014-01-21 16:44:06 -07:00
Nathan Sobo 71c65e65eb Move specs for Workspace::reopenItemSync to model layer 2014-01-21 16:44:06 -07:00
Nathan Sobo 3fad9c616f Move specs for Workspace::open to model layer 2014-01-21 16:44:06 -07:00
Nathan Sobo 45875188a4 Rename Workspace::openSingletonSync changeFocus option to activatePane 2014-01-21 16:44:06 -07:00
Nathan Sobo 933787f1a4 Remove 'split' option from Workspace::openSync 2014-01-21 16:44:06 -07:00
Nathan Sobo 726b546004 Handle the 'split' option directly in Workspace::openSingletonSync 2014-01-21 16:44:06 -07:00
Nathan Sobo 5e83dee493 Move specs for Workspace::openSingletonSync to model layer 2014-01-21 16:44:06 -07:00
Nathan Sobo 11ab6fd2ef 💄 2014-01-21 16:44:06 -07:00
Nathan Sobo 0758bd0231 Move specs for Workspace::openSync to model layer 2014-01-21 16:44:05 -07:00
Nathan Sobo 7f63460a8c Rename Workspace::openSync's changeFocus option to activatePane
The old option is still supported as a deprecated shim.
2014-01-21 16:44:05 -07:00
Kevin Sawicki 627e43dccf Hide tooltips when window is resized
Refs atom/feedback#12
2014-01-21 12:33:23 -08:00
Kevin Sawicki cb8b38b7f7 💄 Use @ instead of this 2014-01-21 11:42:21 -08:00
Kevin Sawicki 04b2eefec3 Upgrade to styleguide@0.21.0 2014-01-21 11:39:50 -08:00
Kevin Sawicki 0694180715 Upgrade to tree-view@0.65.0 2014-01-21 11:20:46 -08:00
Kevin Sawicki f51b116c14 Upgrade to release-notes@0.17.0 2014-01-21 09:46:52 -08:00
Kevin Sawicki f001e05262 Include grammmar-registry from first-mate 2014-01-21 09:36:34 -08:00
Kevin Sawicki 77e97a7552 Link to node docs 2014-01-21 09:26:38 -08:00
Kevin Sawicki 80a1249d59 Merge pull request #1451 from atom/ks-remove-doc-warnings
Cleanup docs
2014-01-20 16:05:10 -08:00
Kevin Sawicki a03ba290f9 Use consistent coffeescript fence name 2014-01-20 16:00:02 -08:00
Kevin Sawicki c9e498f36f 📝 Use correct folder name 2014-01-20 16:00:02 -08:00
Kevin Sawicki e6a98125af Link to creating a package doc 2014-01-20 16:00:02 -08:00
Kevin Sawicki 025d2be606 📝 Triggered instead of trigged 2014-01-20 16:00:02 -08:00
Kevin Sawicki 26e21e98db 📝 Mention atom.project global 2014-01-20 16:00:02 -08:00
Kevin Sawicki e3f32ab30b Wrap Array in curlies 2014-01-20 16:00:02 -08:00
Kevin Sawicki 5d8ac56018 Remove unused temp directory 2014-01-20 16:00:02 -08:00
Kevin Sawicki 1603fab984 Download includes when building docs
This makes it so you no longer have to have the included cloned repos
locally when building.
2014-01-20 16:00:02 -08:00
Kevin Sawicki 07c7f1ea46 Add theorist to generated docs 2014-01-20 16:00:02 -08:00
Kevin Sawicki 31b68c0937 Include space-pen docs 2014-01-20 16:00:02 -08:00
Kevin Sawicki 3a02f4de0c 📝 Remove delegate warnings 2014-01-20 16:00:02 -08:00
Kevin Sawicki 45fe04f630 📝 Add require example 2014-01-20 16:00:02 -08:00
Kevin Sawicki b4a9409ec8 Add custom README.md for generated docs 2014-01-20 16:00:02 -08:00
Kevin Sawicki 7432d39301 Upgrade to text-buffer@0.16.0 2014-01-20 16:00:01 -08:00
Kevin Sawicki c5349f53b2 Wrap code example in backticks 2014-01-20 16:00:01 -08:00
Kevin Sawicki 8b4b4a6ea9 📝 Indent comment correctly 2014-01-20 16:00:01 -08:00
Kevin Sawicki 19177123a7 Upgrade to link@0.15.0 2014-01-20 15:53:05 -08:00
Kevin Sawicki dd032b739f Upgrade to language-gfm@0.12.0 2014-01-20 15:52:41 -08:00
Nathan Sobo f0ebe71c4e Merge pull request #1449 from BinaryMuse/activate_item_to_left_after_close
Closing a tab activates the wrong tab
2014-01-20 14:46:51 -08:00
Brandon Tilley 8bba4d8add Intelligently activate new items when the active item is closed
If the active item was the pane's first item, the second item (which is
the new first item) is activated. Otherwise, the item to the left of the
closed item is activated.
2014-01-20 14:34:02 -08:00
Nathan Sobo 7be0f6dd3b Upgrade apm for base.less fix 2014-01-20 15:10:39 -07:00
Nathan Sobo 571947ae93 Upgrade syntax themes to remove backward-compatible selectors 2014-01-20 15:05:52 -07:00
Nathan Sobo 338168e145 Merge pull request #1441 from atom/ns-fold-indicators
Allow folds to be toggled by clicking icons in the gutter
2014-01-20 13:53:30 -08:00
Nathan Sobo 4190f2f1ca Merge remote-tracking branch 'origin/master' into ns-fold-indicators 2014-01-20 14:40:14 -07:00
Nathan Sobo e74f026750 Upgrade bookmarks to 0.17.0 to use new markup for gutter icons 2014-01-20 14:39:02 -07:00
Nathan Sobo 525b5c9978 Don't make commented lines foldable based on the next line's indentation
Only the first line of a set of commented lines should be foldable, even
if some of the lines in the block are indented.
2014-01-20 14:29:08 -07:00
Nathan Sobo 86106cbf4d Remove redundant specs 2014-01-20 14:27:45 -07:00
Nathan Sobo 519ebb1ca6 Leave folded marker on end of lines in its natural position
Previously, we were nudging it upward. Something must have changed at
some point because it looked too high.
2014-01-20 14:22:26 -07:00
Nathan Sobo da56c1def5 💄 comments 2014-01-20 14:09:25 -07:00
Kevin Sawicki a6f9b6d2de Merge pull request #1439 from atom/ks-open-dot-atom-menu-items
Add commands to open ~/.atom files
2014-01-20 10:45:34 -08:00
Nathan Sobo d965e9f56c Ensure change doesn't precede rendered range when updating foldability 2014-01-20 11:39:30 -07:00
Kevin Sawicki 8f0e0ae4a6 Move open commands to Atom menu 2014-01-20 10:37:14 -08:00
Kevin Sawicki 57a71b3cb3 Forward open commands to browser process 2014-01-20 10:37:14 -08:00
Kevin Sawicki 71c48ec07f Open .atom files from browser process
This allows a new window to be created if there is no currently
focused window.
2014-01-20 10:37:14 -08:00
Kevin Sawicki 4ac3be7ab5 Group open commands with a separator 2014-01-20 10:37:13 -08:00
Kevin Sawicki 5dd83b12c0 Add Open Your Config item to View menu 2014-01-20 10:37:13 -08:00
Kevin Sawicki 905f628b79 Add command to open user config in an editor 2014-01-20 10:37:13 -08:00
Kevin Sawicki ddad42432b Add Open Your Keymap item to View menu 2014-01-20 10:37:13 -08:00
Kevin Sawicki 52e999fc11 Add command to open user keymap in an editor 2014-01-20 10:37:13 -08:00
Kevin Sawicki 3114efbf9c 📝 Update path in comment 2014-01-20 10:37:13 -08:00
Kevin Sawicki 8436e8f62e Reload user keymap when it is moved/removed 2014-01-20 10:37:13 -08:00
Kevin Sawicki ba1303a895 Add menu to opening user stylesheet 2014-01-20 10:37:13 -08:00
Kevin Sawicki 59c4c15afd Add command to open ~/.atom/user.less in an editor 2014-01-20 10:37:13 -08:00
Nathan Sobo 2831b43042 Update foldability indicators on changes that don't insert/remove lines
On changes that insert/remove lines, we redraw the entire gutter, which
ensures the foldability markers are up to date. But other kinds of
changes could change the foldability of lines… if a line becomes
commented or its indentation changes, the foldability of that line and
the lines above and below could be affected. For now, the gutter
understands this fact and updates the foldability for the region
extending from one line before to one line after each change. Someday
I'd like the view logic to not bake in knowledge of the folding rules,
but this works for now.
2014-01-20 11:17:58 -07:00
Kevin Sawicki 3c8cb557ed Upgrade to release-notes@0.16.0 2014-01-20 10:17:42 -08:00
Kevin Sawicki 6b8393dced Upgrade to github-sign-in@0.18.0 2014-01-20 10:16:26 -08:00
Kevin Sawicki 3356b4ac47 Upgrade to github-sign-in@0.17.0 2014-01-20 10:14:41 -08:00
Nathan Sobo 3eb7c9d767 Add LanguageMode::toggleLineCommentForBufferRow for toggling single rows 2014-01-20 11:14:27 -07:00
Nathan Sobo bbb3ebc2b9 Upgrade to tabes 0.18.0 to support dragging tabs to empty panes 2014-01-19 20:05:51 -07:00
Nathan Sobo ed93695d64 Add a foldable indicator for multi-line comments 2014-01-18 12:08:37 -07:00
Nathan Sobo 4db2ad53fd Rename .fold class to .folded on line numbers in gutter
Using an adjective blends in better with '.foldable'
2014-01-18 11:35:22 -07:00
Nathan Sobo 149a6825b4 Show bookmarks instead of fold indicators unless hovering 2014-01-17 17:20:37 -07:00
Kevin Sawicki dd1581aaca Upgrade to find-and-replace@0.79.0 2014-01-17 16:17:33 -08:00
Nathan Sobo 99f025d5d6 Rename .fold-icon to .icon-right in gutter to make it multi-purpose 2014-01-17 16:59:50 -07:00
Kevin Sawicki e0cf20cda9 Don't throw error when saving empty pane
Closes #1440
2014-01-17 15:24:55 -08:00
Kevin Sawicki c305384334 Upgrade to styleguide@0.20.0 2014-01-17 15:16:57 -08:00
Nathan Sobo d879923cdb Fix gutter view rendering specs 2014-01-17 16:03:02 -07:00
Nathan Sobo d16526a1f7 Fix references to renamed method in specs 2014-01-17 15:57:49 -07:00
Nathan Sobo a774c2ff08 🔫 unnecessary return statement 2014-01-17 15:46:49 -07:00
Nathan Sobo 475ff140a7 Make unfolded fold icons darker on hover 2014-01-17 15:22:29 -07:00
Nathan Sobo fa6bce3085 Rename LanguageModel::isBufferRowFoldable to ::isFoldableAtBufferRow
It blends in better with the methods on Editor.
2014-01-17 15:19:07 -07:00
Nathan Sobo b2dff15e51 Toggle folding upon 'mousedown' on a foldable line's fold-icon 2014-01-17 15:17:13 -07:00
Nathan Sobo 1e3dc05b3d Nudge chevron-right left a bit to align better with chevron-down 2014-01-17 14:58:16 -07:00
Nathan Sobo 1a12a17b7a Use actual markup for fold icon so we can determine when it's clicked 2014-01-17 14:55:06 -07:00
Nathan Sobo 8757e1f145 Add downward pointing chevrons next to foldable row numbers in gutter 2014-01-17 14:34:53 -07:00
Nathan Sobo 12ca214d6a 💄 Fix misleading variable name 2014-01-17 14:32:58 -07:00
Nathan Sobo 8e75831318 Rename LanguageMode::doesBufferRowStartFold to ::isBufferRowFoldable 2014-01-17 14:30:40 -07:00
Nathan Sobo 2f049b95a8 Use Delegator mixin to delegate to language mode 2014-01-17 14:07:56 -07:00
Kevin Sawicki 386d4d3eb5 Merge pull request #1437 from atom/ks-watch-user-stylesheet
Reload user stylesheet when changed
2014-01-17 12:48:17 -08:00
Kevin Sawicki 6a14c0df81 Remove unused package require 2014-01-17 12:40:33 -08:00
Kevin Sawicki 083204f737 💄 Sort requires 2014-01-17 12:40:21 -08:00
Kevin Sawicki 4d17f625f8 Null out file when unwatching 2014-01-17 12:28:30 -08:00
Kevin Sawicki 64ebc37204 Reload user stylesheet when changed 2014-01-17 11:33:25 -08:00
Nathan Sobo b4dcec9417 Prepare 0.48.0 release 2014-01-17 11:50:28 -07:00
Kevin Sawicki ede03fd634 Upgrade to exception-reporting@0.12.0 2014-01-17 10:12:05 -08:00
Nathan Sobo 926493f05c Emit 'item-added' before setting the ::activeItem when adding first item
Fixes atom/tabs#11
2014-01-17 11:10:17 -07:00
probablycorey 4f82662263 Fix page up/page down keybindings 2014-01-17 08:28:45 -08:00
Cheng Zhao dfa3d8a1c7 Temporarily workaround for slow net.connect, fixes #1429. 2014-01-17 20:31:03 +08:00
Kevin Sawicki 677ec44b37 Dedupe humanize-plus 2014-01-16 18:54:58 -08:00
Kevin Sawicki 0359e933d1 Upgrade to image-view@0.17.0 2014-01-16 18:43:58 -08:00
Kevin Sawicki ff88c1c41f Merge pull request #1434 from atom/ks-dedupe-modules
Dedupe modules
2014-01-16 18:43:05 -08:00
Kevin Sawicki 0acc632cf5 Upgrade to less-cache@0.11.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki 2c65a30d4a Upgrade to text-buffer@0.15.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki 590b8ec221 Upgrade to space-pen@3.1.1 2014-01-16 18:31:14 -08:00
Kevin Sawicki cff1a012af Upgrade apm for dependency updates 2014-01-16 18:31:14 -08:00
Kevin Sawicki 3ea057a145 Upgrade to text-buffer@0.14.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki b30ea21ab9 Upgrade to snippets@0.20.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki 44d42380b8 Upgrade to tree-view@0.63.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki f906afa8ec Upgrade to archive-view@0.21.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki 815a282146 Upgrade to image-view@0.16.0 2014-01-16 18:31:14 -08:00
Kevin Sawicki 9fe24acbe9 Upgrade to theorist 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki f2f3745022 Upgrade to link@0.14.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki d2ecc8c2b6 Upgrade to link@0.13.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki 9166a563c2 Upgrade to first-mate 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki 7388468b5a Upgrade to oniguruma 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki 21bc658230 Upgrade to terminal@0.26.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki 72f85aeae4 Upgrade to settings-view@0.57.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki 26b3cfc3b2 Upgrade to git-diff@0.23.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki c91eb1fbbe Upgrade to find-and-replace@0.77.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki 75ed3aa03b Upgrade to dev-live-reload@0.23.0 2014-01-16 18:31:13 -08:00
Kevin Sawicki 00d783fb23 Upgrade to emissary 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki b80e7fc137 Upgrade to property-accessors 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki e1d2bbabfb Upgrade to serializable 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki 9de5adf572 Upgrade to delegato 1.x 2014-01-16 18:31:13 -08:00
Kevin Sawicki 2a3eab945d Upgrade to fs-plus@1.0 2014-01-16 18:31:12 -08:00
Kevin Sawicki df8d77cc47 Upgrade to mixto@1.0 2014-01-16 18:31:12 -08:00
Kevin Sawicki 9d11ea8bcd Upgrade to underscore-plus@1.0 2014-01-16 18:31:12 -08:00
Kevin Sawicki f19d2d7369 Call selectLeft on editor 2014-01-16 16:00:20 -08:00
probablycorey 7f790137ed Fix editor method name 2014-01-16 15:55:21 -08:00
probablycorey c56dce0c80 Cache atom version 2014-01-16 14:07:20 -08:00
probablycorey 1f105542a3 Upgrade to keybinding-resolver@0.9.0 2014-01-16 14:05:22 -08:00
probablycorey ec499e2bde Remove version instance variable.
The version was being assigned to 1 causing getVersion to never check
app.getVersion for the actual version.

Fixes #1428
2014-01-16 12:39:20 -08:00
Kevin Sawicki 59202f9a56 Upgrade to command-logger@0.10.0 2014-01-16 11:01:58 -08:00
Nathan Sobo e437673fbc Upgrade ui themes to fix split pane dividers
Fixes #1278
2014-01-16 11:31:29 -07:00
Nathan Sobo ded222551a Merge pull request #1417 from atom/ns-empty-panes
Support empty panes
2014-01-16 10:21:44 -08:00
Nathan Sobo fe2def8321 Merge remote-tracking branch 'origin/master' into ns-empty-panes 2014-01-16 11:16:00 -07:00
Nathan Sobo e19368a291 Upgrade background-tips to 0.5.0 to attach tips to the empty root pane 2014-01-16 11:15:38 -07:00
Nathan Sobo 3980082e3c Upgrade terminal and tree-view for specs compatibility 2014-01-16 11:00:35 -07:00
Kevin Sawicki 9f29e423db 💄 Sort dependencies 2014-01-16 09:56:19 -08:00
probablycorey 23d9f6e41f Use actual indentation length when setting indentation for row.
Closes #1293
2014-01-16 09:27:26 -08:00
Nathan Sobo 649f0ac246 Merge branch 'master' into ns-empty-panes
Conflicts:
	package.json
2014-01-16 10:21:59 -07:00
Cheng Zhao b9dcb569b1 Merge pull request #1347 from atom/chrome31
Update atom-shell to v0.8.x
2014-01-16 08:49:55 -08:00
Cheng Zhao 6538ee47aa Update keytar to v0.15.1. 2014-01-17 00:39:01 +08:00
Cheng Zhao 043a50012e Update git-utils to v0.33.1. 2014-01-17 00:28:27 +08:00
Cheng Zhao 9ed0ded91b Update settings-view to v0.56.1. 2014-01-17 00:20:16 +08:00
Cheng Zhao ad5c0f93ed Update release-notes to v0.15.1. 2014-01-17 00:18:22 +08:00
Cheng Zhao 4265de2232 Update markdown-preview to v0.25.1. 2014-01-17 00:12:48 +08:00
Cheng Zhao b7ae12f86f Merge branch 'master' into chrome31
Conflicts:
	package.json
2014-01-16 23:42:22 +08:00
Cheng Zhao 20e7fea3ab Update scandal to v0.13.0. 2014-01-16 20:21:11 +08:00
Nathan Sobo 910469d373 Upgrade theorist to 0.14.0 to ensure new ids are > than deserialized ids 2014-01-15 20:20:00 -07:00
Nathan Sobo ff9c9adeff Upgrade find-and-replace to 0.76.0 to fix result marker updates 2014-01-15 19:26:22 -07:00
Kevin Sawicki ceac8ba0e1 Prepare 0.47.0 release 2014-01-15 18:17:14 -08:00
Kevin Sawicki 24f386df2d Wait 30 seconds for move events 2014-01-15 17:54:06 -08:00
Kevin Sawicki 1006706cf6 Consistently order less cache import paths 2014-01-15 17:42:17 -08:00
Cheng Zhao 0b0a3ae4c2 Update pathwatcher to v0.14.2. 2014-01-16 09:37:23 +08:00
Cheng Zhao 276de1e5ae Update pathwatcher to v0.14.1. 2014-01-16 09:30:59 +08:00
Cheng Zhao fcffcc83f9 Merge branch 'master' into chrome31
Conflicts:
	package.json
	vendor/apm
2014-01-16 09:11:34 +08:00
Kevin Sawicki 4122b5a43f Dedupe nan module 2014-01-15 16:58:43 -08:00
Kevin Sawicki 2430edbcb8 Upgrade to command-logger@0.9.0 2014-01-15 16:38:52 -08:00
Kevin Sawicki e2269d5d51 Ignore xmldom test folder 2014-01-15 16:36:07 -08:00
Kevin Sawicki 2d04c50184 Dedupe oniguruma 2014-01-15 16:24:30 -08:00
Kevin Sawicki 2dc8c94165 Upgrade to git-utils@0.33.0 2014-01-15 16:17:50 -08:00
Kevin Sawicki c1022d15ba Use bootstrap fork from atom org.
This uses the fork branch which is v3.0.3 with @benogle's tooltip
commit cherry picked on top of it.
2014-01-15 16:09:50 -08:00
probablycorey b620be7780 Fix cut, copy and paste key bindings
Closes #1425
2014-01-15 16:00:09 -08:00
Kevin Sawicki 70c89dfefa Merge pull request #1420 from atom/ks-shrink-the-build
Shrink the build size
2014-01-15 15:55:18 -08:00
Kevin Sawicki ace61c330a Upgrade to bracket-matcher@0.19.0 2014-01-15 15:53:24 -08:00
Kevin Sawicki 0626df5cdd Use ignored paths in package filter 2014-01-15 15:48:19 -08:00
Kevin Sawicki b1679a03d6 Ignore spellchecker/vendor folder 2014-01-15 15:48:19 -08:00
Kevin Sawicki af95abe185 Upgrade to language-ruby-on-rails@0.4.0 2014-01-15 15:48:19 -08:00
Kevin Sawicki a23561f9ce Upgrade to language-ruby@0.7.0 2014-01-15 15:48:19 -08:00
Kevin Sawicki a93048d3ae Upgrade to language-php@0.3.0 2014-01-15 15:48:19 -08:00
Kevin Sawicki 1814b187e9 Don't copy bootstrap docs during build 2014-01-15 15:48:19 -08:00
Kevin Sawicki d7d7bd2db5 Ignore less dist and test folders in build 2014-01-15 15:48:19 -08:00
Kevin Sawicki f86ca9b59a 💄 Add array of packages to dedupe 2014-01-15 15:48:19 -08:00
Kevin Sawicki 58cccd76a4 Dedupe roaster when bootstrapping 2014-01-15 15:48:19 -08:00
Kevin Sawicki fd1477fc92 Only depend on jasmine-tagged
jasmine-tagged now depends on jasmine-focused and everything needed
should be reachable from just a dependency on jasmine-tagged.
2014-01-15 15:48:19 -08:00
Kevin Sawicki eca9ba107c Upgrade to scandal@0.12.0 2014-01-15 15:48:18 -08:00
Kevin Sawicki 94126942eb Upgrade to oniguruma@0.26.0 2014-01-15 15:48:18 -08:00
Nathan Sobo e6697ce3a7 Upgrade light and dark ui theme to when empty panes are focused 2014-01-15 16:42:32 -07:00
Nathan Sobo ccd86d91de Make PaneContainer::activePaneItem behavior distinct until changed
If we switch from one empty active pane to another empty active pane,
there's no reason to emit a value from the activePaneItem behavior.
2014-01-15 16:08:36 -07:00
Nathan Sobo 2f8ec967f6 Update to markdown-preview 0.25.0 for specs compatibility 2014-01-15 16:08:36 -07:00
Nathan Sobo 709ae6a1bc Update to archive-view 0.20.0 for specs compatibility 2014-01-15 16:08:36 -07:00
Nathan Sobo 5e14d44d6a Destroy all pane models when workspace view is removed 2014-01-15 16:07:47 -07:00
Nathan Sobo 41dd4a386a Restore PaneView::getContainer. Turns out it's actually public. 2014-01-15 16:07:47 -07:00
Nathan Sobo 9af4b14716 Never allow PaneContainer::root to be null 2014-01-15 16:07:47 -07:00
Nathan Sobo aed9f18457 Accivate the first added pane item 2014-01-15 16:07:47 -07:00
Nathan Sobo edf2fbe0e5 Make 'core:close' destroy the pane itself if it is empty 2014-01-15 16:07:47 -07:00
Nathan Sobo ca71bf224b Destroy the pane completely on 'pane:close' (not just its items) 2014-01-15 16:07:47 -07:00
Nathan Sobo 012363a785 Null guard item in ::destroyActiveItem 2014-01-15 16:07:47 -07:00
Nathan Sobo 1a48903f96 Only destroy empty panes on deserialization if config option is enabled 2014-01-15 16:07:47 -07:00
Nathan Sobo 44331d0ba6 Fix issues splitting panes with DOM events
* ::copyActiveItem guards against not having an active item
* The Pane constructor removes undefined items from params.items
2014-01-15 16:07:47 -07:00
Nathan Sobo fe7c5b4bc1 Only destroy an empty panes if 'core.destroyEmptyPanes' is true 2014-01-15 16:07:47 -07:00
Nathan Sobo 1825af1309 Merge pull request #1415 from atom/ns-pane-model-specs
Move relevant pane specs from PaneView to Pane model
2014-01-15 15:06:43 -08:00
Nathan Sobo b5947f5a56 Merge branch 'master' into ns-pane-model-specs 2014-01-15 15:54:49 -07:00
Corey Johnson 864d6ce8f2 Merge pull request #1408 from atom/cj-remove-editor-view-delegate-methods
Remove editor view delegate methods
2014-01-15 14:01:10 -08:00
probablycorey ac07cf3d9a Merge remote-tracking branch 'origin/master' into cj-remove-editor-view-delegate-methods
Conflicts:
	package.json
2014-01-15 13:52:42 -08:00
Nathan Sobo 6ba3698547 Merge pull request #1423 from atom/ns-dont-null-out-pane-view-models
Don't null out the model of a pane item view when removing it
2014-01-15 13:28:00 -08:00
Nathan Sobo d57e5f389d Don't null out the model of a pane item view when removing it
Fixes #1422 (I think)
2014-01-15 14:20:30 -07:00
Cheng Zhao 2023aeef97 Use screen module to get screen's available size.
In Chrome31 the window.screen.availHeight and availWidth are sometimes
0, this is a workaround of this bug.
2014-01-15 12:49:22 +08:00
Nathan Sobo 1c6564f7a5 Move non-focus serialization specs from pane-view-spec to pane-spec 2014-01-14 21:39:47 -07:00
Nathan Sobo d9d28b5236 Move ::itemForUri specs from pane-view-spec to pane-spec 2014-01-14 20:39:13 -07:00
Nathan Sobo 8734eab8cb 💄 Give dummy pane items ::getUri and ::getPath methods 2014-01-14 20:38:07 -07:00
Nathan Sobo 1ad5158f19 Streamline active status and focus specs in pane-view-spec
The specs can be simplified now that much of this logic is covered in
the model specs.
2014-01-14 20:27:30 -07:00
Nathan Sobo 453e034a5f Simplify PaneView split specs because it's largely covered at the model 2014-01-14 20:21:24 -07:00
Nathan Sobo 9841a3588f Move specs on PaneView::remove to Pane::destroy in pane-spec 2014-01-14 20:10:01 -07:00
Nathan Sobo dd0ae8a8ea Don't remove PaneViews when their model is destroyed
They will be removed by their parent PaneContainerView or PaneAxisView,
and removing them in the previous way circumvented some of our focus
preservation logic.
2014-01-14 20:09:14 -07:00
Nathan Sobo d8ddd52df8 Move ::activateItemAtIndex specs from pane-view-spec to pane-spec 2014-01-14 19:49:15 -07:00
Nathan Sobo 83696bb9c7 Move ::activateNext/PreviousItem specs from pane-view-spec to pane-spec 2014-01-14 19:46:12 -07:00
Nathan Sobo 243c4efe20 Move ::saveActiveItemAs specs from pane-view-spec to pane-spec 2014-01-14 19:43:09 -07:00
Nathan Sobo 22c65f2407 Move ::saveActiveItem specs from pane-view-spec to pane-spec 2014-01-14 19:41:00 -07:00
Nathan Sobo e553fefc25 Add spec for Pane::destroyInactiveItems to pane-spec 2014-01-14 19:32:39 -07:00
Nathan Sobo cf6fc22c87 Add spec for Pane::destroyItems to pane-spec 2014-01-14 19:31:13 -07:00
Nathan Sobo a6d8f588c3 💄 2014-01-14 19:29:01 -07:00
Nathan Sobo 2ef74de0f8 Move ::moveItemToPane specs from pane-view-spec to pane-spec 2014-01-14 19:26:47 -07:00
Nathan Sobo 2ee6469b17 Move ::moveItem specs from pane-view-spec to pane-spec 2014-01-14 19:15:11 -07:00
Nathan Sobo 9977884a2c Move ::destroyItem specs from pane-view-spec to pane-spec 2014-01-14 19:12:27 -07:00
Nathan Sobo c331723c55 Move ::activateItem specs from pane-view-spec to pane-spec 2014-01-14 19:12:26 -07:00
Nathan Sobo dd3ca1fc2f Merge pull request #1416 from atom/ns-workspace-model
Drop a basic model out from WorkspaceView
2014-01-14 18:11:34 -08:00
Nathan Sobo f7f2da6ad2 Merge remote-tracking branch 'origin/master' into ns-workspace-model 2014-01-14 19:04:53 -07:00
Nathan Sobo eba74d1420 Upgrade text-buffer to 0.13.0 for Range::intersectsRowRange 2014-01-14 18:55:19 -07:00
Kevin Sawicki 91c9f6ffa5 Upgrade to bracket-matcher@0.18.0 2014-01-14 17:49:19 -08:00
Kevin Sawicki db319c9f9c Upgrade apm new commands and template fixes 2014-01-14 17:20:04 -08:00
Kevin Sawicki 134affcd8f Remove of tomorrow! 2014-01-14 17:18:10 -08:00
Kevin Sawicki 9bfa7704e6 Prepare 0.46.0 release 2014-01-14 17:05:19 -08:00
Kevin Sawicki 8acd84c7e2 Pull stdout out of results argument 2014-01-14 16:39:14 -08:00
Kevin Sawicki a53d223b6f Use package.json version in master builds only 2014-01-14 16:25:22 -08:00
Kevin Sawicki 673b78561a Rename set-development-version task to set-version 2014-01-14 16:16:31 -08:00
Kevin Sawicki 57c56fc46e Use package.json version in master janky builds 2014-01-14 16:16:28 -08:00
Kevin Sawicki d81fb8cabf Sign right before publishing 2014-01-14 16:03:58 -08:00
Kevin Sawicki 1dec9d0ad2 Run codesign task after build task 2014-01-14 15:31:49 -08:00
Nathan Sobo bda75c1a8f Merge remote-tracking branch 'origin/master' into ns-workspace-model 2014-01-14 15:35:00 -07:00
Nathan Sobo c0c2d797b1 Add some API documentation 2014-01-14 14:44:27 -07:00
Kevin Sawicki a342a18440 Merge pull request #1413 from atom/ks-no-more-constructicon
Get off constructicon
2014-01-14 13:39:59 -08:00
Kevin Sawicki 047425c564 Rename createRelease to createBuildRelease 2014-01-14 13:29:35 -08:00
Kevin Sawicki 8374911dab Delete existing asset before uploading new one 2014-01-14 13:29:35 -08:00
Kevin Sawicki 6ca3c90abe Use upload urls instead of assets url 2014-01-14 13:29:35 -08:00
Kevin Sawicki 96cb266c27 Release properties are _ separated 2014-01-14 13:29:35 -08:00
Kevin Sawicki 21723b155e Remove unneeded assets prefix 2014-01-14 13:29:34 -08:00
Kevin Sawicki 14c3feee17 Publish master builds to the draft release 2014-01-14 13:29:34 -08:00
Kevin Sawicki 0255f1e223 Remove unused require 2014-01-14 13:29:34 -08:00
Kevin Sawicki 76a5912126 Update expected callback name 2014-01-14 13:29:34 -08:00
Kevin Sawicki 848dc12f28 Add unlock-keychain arg 2014-01-14 13:29:34 -08:00
Kevin Sawicki 7a41fabf60 Unlock keychain before signing 2014-01-14 13:29:34 -08:00
Kevin Sawicki f4b82fe3a4 Load env vars from /var/lib/jenkins/config/xcodekeychain 2014-01-14 13:29:34 -08:00
Kevin Sawicki aec32b65a0 Remove constructicon files 2014-01-14 13:29:34 -08:00
Kevin Sawicki 01e0970406 Sign CI builds 2014-01-14 13:29:34 -08:00
Kevin Sawicki b08978a431 Add back linting of build files 2014-01-14 13:28:30 -08:00
Nathan Sobo e4b934d3fa Remove 'workspace' from serialized state in spec helper
…Instead of 'workspaceView'.
2014-01-14 13:06:42 -07:00
Nathan Sobo c350285044 Move Workspace and PaneContainer serialization to the model layer
The views are now stateless. You just construct them with a model to
deserialize.
2014-01-14 11:38:27 -07:00
Nathan Sobo 4a7b43f609 Write focusNext/PreviousPane in terms of activateNext/PreviousPane
"Activate" is the model level equivalent of focus.
2014-01-14 11:15:14 -07:00
Nathan Sobo 0d66c68fe8 Add delegator to model for PaneContainerView::saveAll 2014-01-14 11:12:08 -07:00
Kevin Sawicki b72028c68d Invoke deploy task using script/grunt 2014-01-14 10:03:05 -08:00
Kevin Sawicki 332b918c01 Ignore build/atom.build 2014-01-14 10:03:05 -08:00
Kevin Sawicki bc94dc63e6 Ignore atom.xcodeproj 2014-01-14 10:03:05 -08:00
Nathan Sobo a1d540d288 Revert WorkspaceView::getActivePane. It needs to return a PaneView. 2014-01-14 11:02:36 -07:00
Nathan Sobo af4034ba39 Move WorkspaceView::destroyActivePaneItem to the model 2014-01-14 10:58:35 -07:00
Nathan Sobo 89cbd6b834 Move PaneContainerView::saveAll to the model 2014-01-14 10:58:35 -07:00
Nathan Sobo fe01ded75b Move WorkspaceView::saveActivePaneItem* to Workspace model 2014-01-14 10:58:35 -07:00
Nathan Sobo aab4f3b761 Remove methods that I'm pretty sure are unused 2014-01-14 10:58:35 -07:00
Nathan Sobo adf5cfc78c Move WorkspaceView::reopenItemSync to the Workspace model 2014-01-14 10:58:34 -07:00
Nathan Sobo 66bb9dab93 Move WorkspaceView::openSingletonSync to the Workspace model 2014-01-14 10:58:34 -07:00
Nathan Sobo c8e4535e8b Move WorkspaceView::openSync to the Workspace model 2014-01-14 10:58:34 -07:00
Nathan Sobo 7199cda549 Derive PaneView::activeView from the model's activeItem
We're getting into some strange order-sensitive cases where we respond
to a change of the active item before the pane has a chance to reassign
the active view. Therefore it makes more sense to always just derive the
active view from the active item.
2014-01-14 10:58:34 -07:00
Nathan Sobo 1eb9c3d0d5 Move WorkspaceView::open to Workspace model 2014-01-14 10:58:34 -07:00
Nathan Sobo 27c03ae3f3 Move management of destroyedItemUris to Workspace model 2014-01-14 10:58:34 -07:00
Nathan Sobo a8ddc530a2 Emit a pane-item-destroyed event from the workspace model
…Instead of calling itemDestroyed on the workspace view via a DOM query
2014-01-14 10:58:34 -07:00
Nathan Sobo 8e78583521 Emit 'item-destroyed' in ::removeItem when destroying flag is true 2014-01-14 10:58:34 -07:00
Nathan Sobo 7317d52896 Move paneForUri to PaneContainer model 2014-01-14 10:58:34 -07:00
Nathan Sobo 54dd5ea28e Destroy the model when PaneContainerView is removed 2014-01-14 10:58:34 -07:00
Nathan Sobo 22fe04fb27 Drop out a basic workspace model 2014-01-14 10:58:33 -07:00
Nathan Sobo adb174ef5f Remove pane-model, which should have been removed during rename
Missed this somehow.
2014-01-14 10:57:50 -07:00
Kevin Sawicki d3a016bf69 Delete build/node_modules before bootstrapping 2014-01-14 09:43:03 -08:00
Cheng Zhao 46c5f09721 Update pathwatcher to v0.14.0. 2014-01-14 22:43:33 +08:00
Cheng Zhao 6401213510 Update apm. 2014-01-14 20:39:16 +08:00
Cheng Zhao 5f92c6df6c Update atom-shell to v0.8.5. 2014-01-14 20:00:47 +08:00
probablycorey 75e3659809 Upgraded to tabs@0.17.0 2014-01-13 17:39:11 -08:00
probablycorey b458b86bbd Upgraded to autocomplete@0.20.0 2014-01-13 17:38:00 -08:00
probablycorey 645f950368 Upgraded to tree-view:0.61.0 2014-01-13 17:36:22 -08:00
probablycorey 8dd183fc78 Upgraded to find-and-replace@0.75.0 2014-01-13 17:16:26 -08:00
Nathan Sobo 6ef6fb77f9 Rename pane-*-model specs 2014-01-13 17:22:02 -07:00
Nathan Sobo 159adcb00c Bump serialization version on WorkspaceView
Since we've replaced views with models, the 'PaneContainer' deserializer
now loads a model instead of a view, which isn't what we want at this
layer.
2014-01-13 16:57:17 -07:00
Kevin Sawicki 06ccb48efe Remove trailing } 2014-01-13 15:40:33 -08:00
probablycorey 95f2d02d18 Merge branch 'master' into cj-remove-editor-view-delegate-methods
Conflicts:
	package.json
	spec/workspace-view-spec.coffee
	src/editor.coffee
	src/gutter.coffee
2014-01-13 15:06:18 -08:00
Kevin Sawicki 63df8dfcdb Merge remote-tracking branch 'origin/master' into chrome31
Conflicts:
	package.json
2014-01-13 15:01:52 -08:00
Kevin Sawicki 12bf0f5381 Delete apm's node_modules folders on clean 2014-01-13 14:51:24 -08:00
probablycorey 637acf63ce Upgraded to settings-view@0.56.0 2014-01-13 14:41:26 -08:00
probablycorey 9ff23e6bed Upgraded to snippets@0.19.0 2014-01-13 14:09:51 -08:00
Kevin Sawicki d96f15e8b5 Upgrade to package-generator@0.24.0 2014-01-13 14:03:49 -08:00
Kevin Sawicki 5bf654f6cc Upgrade to grammar-selector@0.17.0 2014-01-13 13:58:19 -08:00
Kevin Sawicki 16dba3e68e Upgrade to fuzzy-finder@0.31.0 2014-01-13 13:49:26 -08:00
Nathan Sobo 08716fd888 Merge pull request #1410 from atom/ns-rename-pane-views
Add -View suffix to pane views and remove -Model suffix from pane models
2014-01-13 13:39:13 -08:00
Kevin Sawicki 43e30ad466 Upgrade to go-to-line@0.15.0 2014-01-13 13:33:41 -08:00
Kevin Sawicki 16c86047eb Add buffer delegates for getLineCount/getTextInRange 2014-01-13 13:30:32 -08:00
Kevin Sawicki 0d36eec288 Upgrade to git-diff@0.22.0 2014-01-13 13:25:51 -08:00
Kevin Sawicki 2e697f65e8 Upgrade to gists@0.15.0 2014-01-13 13:15:59 -08:00
Kevin Sawicki edab3e5a27 Upgrade to bracket-matcher@0.17.0 2014-01-13 13:15:58 -08:00
Nathan Sobo 97999f1080 Rename PaneContainerModel to PaneContainer 2014-01-13 13:56:31 -07:00
Nathan Sobo a268b3e963 Rename PaneAxisModel to PaneAxis 2014-01-13 13:54:04 -07:00
Nathan Sobo 8931bf8f3a Rename PaneModel to Pane 2014-01-13 13:51:15 -07:00
Nathan Sobo 918c31905f Rename PaneContainer to PaneContainerView 2014-01-13 13:46:28 -07:00
Nathan Sobo c7ff4f9897 Rename PaneAxis to PaneAxisView 2014-01-13 13:46:27 -07:00
Nathan Sobo 4f604ced3c Rename Pane to PaneView 2014-01-13 13:46:22 -07:00
probablycorey 8c3147f975 Update spell-check, status-bar, symbols-view, tree-view and wrap-guide 2014-01-13 12:25:22 -08:00
Nathan Sobo a29c18f8c0 And again 2014-01-13 13:14:41 -07:00
Nathan Sobo 43f517abff Fix botched merge of package.json. Sorry. 2014-01-13 13:13:57 -07:00
Nathan Sobo 8b901f81e0 Merge pull request #1379 from atom/cj-ns-pane-models
Separate models from PaneContainer, PaneAxis, and Pane
2014-01-13 12:08:34 -08:00
Kevin Sawicki 4182ee4f12 Upgrade to bookmarks@0.16.0 2014-01-13 12:08:19 -08:00
Kevin Sawicki 601b314236 Upgrade to autoflow@0.12.0 2014-01-13 12:04:07 -08:00
Kevin Sawicki 7d596355b9 Upgrade to autocomplete@0.20.0 2014-01-13 12:01:00 -08:00
Nathan Sobo fe0cdbf349 Merge remote-tracking branch 'origin/master' into cj-ns-pane-models
Conflicts:
	package.json
2014-01-13 12:55:02 -07:00
Kevin Sawicki c2381ba61c Upgrade to timecop@0.13.0 2014-01-13 11:40:01 -08:00
Cheng Zhao ccc5f8fa66 Merge branch 'master' into chrome31
Conflicts:
	build/package.json
	package.json
2014-01-13 23:28:48 +08:00
Cheng Zhao e29ffbea8c Update to atom-shell v0.8.4. 2014-01-13 23:26:05 +08:00
Cheng Zhao efbd508163 Fix git specs when running under symbolic path. 2014-01-13 17:31:03 +08:00
Nathan Sobo 4179d9d268 Add deprecated Pane::removeItem 2014-01-12 17:55:29 -07:00
Nathan Sobo 3fc3d48def Destroy empty panes after deserializing
Fixes #1399
2014-01-12 17:53:25 -07:00
Nathan Sobo b438b311f3 Rename showItem methods to activateItem
These methods set the *active* item, so the verb activate provides a
clearer correspondence. We could change the noun to "shown" item, but
that's awkward and having both active panes and active items is a nice
correspondence in terminology.
2014-01-12 17:40:57 -07:00
Nathan Sobo 561e31c0c5 Remove ::removeItemAtIndex and make ::removeItem private
Call ::destroyItem or just destroy the item directly (it should emit the
'destroyed' event)
2014-01-12 17:25:51 -07:00
Nathan Sobo 2a8a5268c6 Clean up PaneModel api docs 2014-01-11 22:09:10 -07:00
Nathan Sobo 28b085be1c Rename ::makeActive to ::activate and focus panes when they're activated 2014-01-11 20:48:01 -07:00
Nathan Sobo f5bc71e559 Move $.fn.hasFocus to space-pen 2014-01-11 19:49:25 -07:00
Nathan Sobo 2188dd201d Update wrap-guide to 0.11.0 for specs fix with flexbox panes 2014-01-11 19:28:33 -07:00
Nathan Sobo b21eb6f934 Drop .flexbox-repaint-hack div and use pseudo selector instead
We don't actually need structural markup to ensure that all pane views
are absolutely positioned. We can just use the `> *` selector inside of
.pane-items.

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

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

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

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

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

* Replace ::getLastPosition with ::getEndPosition
2014-01-08 10:53:07 -07:00
Cheng Zhao 831454bd30 Update atom-shell to v0.8.3. 2014-01-08 12:11:35 +08:00
Kevin Sawicki 13abb28486 Upgrade to bracket-matcher@0.16.0 2014-01-07 19:54:39 -08:00
Kevin Sawicki 717704c8ed Upgrade to tree-view@0.58.0 2014-01-07 19:54:12 -08:00
Nathan Sobo eab26fb3a6 Properly exit when render process crashes if exitWhenDone option is true
Previously, we were referring to an undefined `atom` global to exit when
the render process crashed in specs. Now we only exit when exitWhenDone
is true, which will only exit in headless specs. Also, we now call .exit
on an object that's actually defined.
2014-01-07 19:22:42 -07:00
Nathan Sobo 17947d0f99 Enable harmony proxies
I want to use these in the pane-models branch, so it will be helpful
if they are enabled in atom stable since it's an atom-shell level
setting.
2014-01-07 19:22:22 -07:00
Nathan Sobo 626e22e4ae Avoid exceptions when a live editor is compared with a destroyed one 2014-01-07 18:45:18 -07:00
Corey Johnson & Nathan Sobo 5837b7cfda Move methods related to item movement to PaneModel 2014-01-07 18:39:39 -07:00
Cheng Zhao 02a9d11bb5 Update first-mate to v0.13.0. 2014-01-08 09:07:04 +08:00
Cheng Zhao 0d89be26be Merge branch 'master' into chrome31
Conflicts:
	package.json
2014-01-08 08:58:20 +08:00
Corey Johnson & Nathan Sobo 1a487db29f Move item removal events to PaneModel 2014-01-07 17:55:56 -07:00
Cheng Zhao 1144e52fea Update atom-shell to v0.8.2. 2014-01-08 08:55:26 +08:00
Corey Johnson & Nathan Sobo 2938a8e650 Move item-oriented methods to PaneModel 2014-01-07 17:47:42 -07:00
Corey Johnson & Nathan Sobo cd97de76fc 💄 2014-01-07 17:28:53 -07:00
Corey Johnson & Nathan Sobo 25c099f3a2 Serialize the items and activeItem via PaneModel
This necessitates setting the ::activeView based on the model's
::activeItem instead of doing it in ::showItem.
2014-01-07 17:23:29 -07:00
Kevin Sawicki eb39b8505e Upgrade to timecop@0.12.0 2014-01-07 15:49:19 -08:00
Kevin Sawicki 7a90cc46ad Merge pull request #1373 from atom/ks-space-pen-3
Upgrade to space pen 3
2014-01-07 15:09:52 -08:00
Kevin Sawicki c6c1cb233d Upgrade to space-pen@3.0.3 2014-01-07 14:56:07 -08:00
Kevin Sawicki f9e37c9b47 Upgrade to space-pen@3.0.2 2014-01-07 14:56:07 -08:00
Kevin Sawicki dfb6835449 Upgrade to space-pen@3.0.1 2014-01-07 14:56:07 -08:00
Kevin Sawicki bf13b426c5 Upgrade to space-pen@3.0.0 2014-01-07 14:56:07 -08:00
Corey Johnson & Nathan Sobo 14175d80ef Move Pane::activeItem to PaneModel 2014-01-07 15:46:17 -07:00
Corey Johnson & Nathan Sobo c99e211144 Store Pane items in PaneModel 2014-01-07 15:42:23 -07:00
Nathan Sobo 1d04cbf584 Enable harmony proxies
I want to use these in the pane-models branch, so it will be helpful
if they are enabled in atom stable since it's an atom-shell level
setting.
2014-01-07 15:19:51 -07:00
Kevin Sawicki 92650e079f Upgrade to feedback@0.22.0 for 🐎 2014-01-07 13:49:54 -08:00
Kevin Sawicki f29ce127db Default windowState to empty hash JSON string 2014-01-07 11:19:38 -08:00
Nathan Sobo b29f1965f0 Move more methods into text-buffer npm 2014-01-07 10:19:43 -07:00
Nathan Sobo 48a2a1934b Start moving text related methods to text-buffer npm 2014-01-07 09:18:59 -07:00
Cheng Zhao bb65a1a47e Update first-mate to v0.12.0. 2014-01-07 18:48:14 +08:00
Cheng Zhao f6a8b72fd4 Update node-oniguruma to v0.26.0. 2014-01-07 18:48:03 +08:00
Cheng Zhao 196e908961 Default window state should be empty object.
Setting default window state to empty string would cause the "Error
parsing window state" error in Atom.loadDocumentState.
2014-01-07 18:48:03 +08:00
Cheng Zhao 72744494b8 Also use node-vm-compatibility-layer in renderer. 2014-01-07 18:48:03 +08:00
Cheng Zhao c287be1725 Fix bootstrap in renderer. 2014-01-07 18:48:03 +08:00
Cheng Zhao 28ec1f3e2d delegate.browserMainParts.preMainMessageLoopRun is discarded. 2014-01-07 18:48:03 +08:00
Cheng Zhao d0bf769896 Use node-vm-compatibility-layer module. 2014-01-07 18:48:03 +08:00
Kevin Sawicki 8fe60b5838 Merge pull request #1366 from atom/ks-async-directory
Make Directory::getEntries asynchronous
2014-01-06 18:06:29 -08:00
Kevin Sawicki 484a7c95ee Upgrade to tree-view@0.57.0 2014-01-06 17:25:26 -08:00
Kevin Sawicki 44a3365787 Rename getRealPath to getRealPathSync 2014-01-06 17:25:26 -08:00
Kevin Sawicki f3e88b56f3 🐎 Reduce stat calls when building entries
Previously every entry was stated twice to determine if it was a
file/directory and a symbolic link.

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

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

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

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

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

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

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

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

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

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

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

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

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

Closes #1231
2013-12-06 08:26:59 -08:00
Kevin Sawicki & Nathan Sobo 7ae432fad5 Place entire hard tab value inside span
Previously only the first character was included in the span.
2013-12-06 08:26:59 -08:00
Ben Ogle 18057e303b Remove getUserAgent. just use navigator.userAgent 2013-12-05 18:55:20 -08:00
Matt Colyer 71064adae2 Upgrade grunt-download-atom-shell@0.1.3 2013-12-05 16:44:55 -08:00
Matt Colyer 43d964c357 Upgrade grunt-download-atom-shell@0.1.2 2013-12-05 11:39:59 -08:00
Ben Ogle 5f4115cb81 Add more native keybindings 2013-12-05 11:08:14 -08:00
Kevin Sawicki 8cf2cdb2a9 Add script/install-cli to install atom and apm 2013-12-05 11:02:37 -08:00
Kevin Sawicki a460530770 Show warning message opening opening dev window without repo cloned 2013-12-05 10:43:45 -08:00
Kevin Sawicki 162bab506d Mention package repositories 2013-12-05 08:50:58 -08:00
Cheng Zhao 6c5669b53d Add "productName" in package.json.
Atom-Shell would use it as application's name.
2013-12-05 18:15:26 +08:00
Cheng Zhao a7db8229d5 Also change the version field of package.json in set-development-version task. 2013-12-05 18:13:42 +08:00
Cheng Zhao b7848d760f Update to atom-shell v0.7.5. 2013-12-05 17:48:55 +08:00
Ben Ogle e6d8f3b9bf Merge pull request #1218 from shama/doc-typos
A couple typo fixes in the docs.
2013-12-04 21:12:09 -08:00
Kyle Robinson Young 0e270f85ba A couple typo fixes in the docs. 2013-12-04 20:40:27 -08:00
Kevin Sawicki 9e3f4dc033 Prepare 0.42.0 release 2013-12-04 19:04:36 -08:00
Kevin Sawicki c1a744b29c Make ATOM_ACCESS_TOKEN available in all grunt commands 2013-12-04 19:02:39 -08:00
Kevin Sawicki a283161c1e Upgrade to tree-view@0.43.0 refs #1213 2013-12-04 18:24:28 -08:00
177 arquivos alterados com 6111 adições e 6769 exclusões
+2
Ver Arquivo
@@ -9,4 +9,6 @@ debug.log
/tags
/atom-shell/
docs/output
docs/includes
spec/fixtures/evil-files/
/apm
+22 -2
Ver Arquivo
@@ -10,11 +10,26 @@ to propose changes to this document in a pull request.
that behavior such as Emacs, vi, Xcode, etc.
* Check the Console app for stack traces to include if reporting a crash.
* Check the Dev tools (`alt-cmd-i`) for errors and stack traces to include.
### Package Repositories
This is the repository for the core Atom editor only. Atom comes bundled with
many packages and themes that are stored in other repos under the
[atom org](https://github.com/atom) such as [tabs](https://github.com/atom/tabs),
[find-and-replace](https://github.com/atom/find-and-replace),
[language-javascript](https://github.com/atom/language-javascript),
and [atom-light-ui](http://github.com/atom/atom-light-ui).
If you think you know which package is causing the issue you are reporting, feel
free to open up the issue in that specific repository instead. When in doubt
just open the issue here but be aware that it may get closed here and reopened
in the proper package's repository.
## Pull Requests
* Include screenshots and animated GIFs whenever possible.
* Follow the [JavaScript](https://github.com/styleguide/javascript) and
[CSS](https://github.com/styleguide/css) styleguides
* Follow the [CoffeeScript](#coffeescript-styleguide),
[JavaScript](https://github.com/styleguide/javascript),
and [CSS](https://github.com/styleguide/css) styleguides
* Include thoughtfully worded [Jasmine](http://pivotal.github.com/jasmine/)
specs
* Avoid placing files in `vendor`. 3rd-party packages should be added as a
@@ -41,3 +56,8 @@ to propose changes to this document in a pull request.
* :racehorse: when improving performance
* :non-potable_water: when plugging memory leaks
* :memo: when writing docs
## CoffeeScript Styleguide
* Set parameter defaults without spaces around the equal sign
* `clear = (count=1) ->` instead of `clear = (count = 1) ->`
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
# Atom — The hackable, ~~collaborative~~ editor of tomorrow!
# Atom — The hackable editor
![Atom](http://i.imgur.com/OrTvUAD.png)
-14
Ver Arquivo
@@ -1,14 +0,0 @@
{
'targets': [
{
'target_name': 'Atom',
'type': 'none',
'postbuilds': [
{
'postbuild_name': 'Create Atom, basically do everything',
'action': ['script/constructicon/build'],
},
],
},
],
}
+46 -18
Ver Arquivo
@@ -2,12 +2,39 @@ fs = require 'fs'
path = require 'path'
os = require 'os'
# Add support for obselete APIs of vm module so we can make some third-party
# modules work under node v0.11.x.
require 'vm-compatibility-layer'
fm = require 'json-front-matter'
_ = require 'underscore-plus'
packageJson = require './package.json'
packageJson = require '../package.json'
# OAuth token for atom-bot
# TODO Remove once all repositories are public
process.env.ATOM_ACCESS_TOKEN ?= '362295be4c5258d3f7b967bbabae662a455ca2a7'
# Shim harmony collections in case grunt was invoked without harmony
# collections enabled
_.extend(global, require('harmony-collections')) unless global.WeakMap?
module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-lesslint')
grunt.loadNpmTasks('grunt-cson')
grunt.loadNpmTasks('grunt-contrib-csslint')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-download-atom-shell')
grunt.loadNpmTasks('grunt-peg')
grunt.loadTasks('tasks')
# This allows all subsequent paths to the relative to the root of the repo
grunt.file.setBase(path.resolve('..'))
if not grunt.option('verbose')
grunt.log.writeln = (args...) -> grunt.log
grunt.log.write = (args...) -> grunt.log
@@ -19,6 +46,7 @@ module.exports = (grunt) ->
installRoot = process.env.ProgramFiles
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
contentsDir = shellAppDir
appDir = path.join(shellAppDir, 'resources', 'app')
atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells')
else
@@ -79,6 +107,13 @@ module.exports = (grunt) ->
dest: appDir
ext: '.json'
pegConfig =
glob_to_multiple:
expand: true
src: ['src/**/*.pegjs']
dest: appDir
ext: '.js'
for child in fs.readdirSync('node_modules') when child isnt '.bin'
directory = path.join('node_modules', child)
{engines, theme} = grunt.file.readJSON(path.join(directory, 'package.json'))
@@ -87,6 +122,7 @@ module.exports = (grunt) ->
lessConfig.glob_to_multiple.src.push("#{directory}/**/*.less")
prebuildLessConfig.src.push("#{directory}/**/*.less") unless theme
csonConfig.glob_to_multiple.src.push("#{directory}/**/*.cson")
pegConfig.glob_to_multiple.src.push("#{directory}/**/*.pegjs")
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
@@ -101,6 +137,8 @@ module.exports = (grunt) ->
cson: csonConfig
peg: pegConfig
coffeelint:
options:
no_empty_param_list:
@@ -113,8 +151,10 @@ module.exports = (grunt) ->
'dot-atom/**/*.coffee'
'exports/**/*.coffee'
'src/**/*.coffee'
'tasks/**/*.coffee'
'Gruntfile.coffee'
]
build: [
'build/tasks/**/*.coffee'
'build/Gruntfile.coffee'
]
test: [
'spec/*.coffee'
@@ -184,21 +224,9 @@ module.exports = (grunt) ->
stderr: false
failOnError: false
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-lesslint')
grunt.loadNpmTasks('grunt-cson')
grunt.loadNpmTasks('grunt-contrib-csslint')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-download-atom-shell')
grunt.loadNpmTasks('grunt-shell')
grunt.loadTasks('tasks')
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson'])
grunt.registerTask('compile', ['coffee', 'prebuild-less', 'cson', 'peg'])
grunt.registerTask('lint', ['coffeelint', 'csslint', 'lesslint'])
grunt.registerTask('test', ['shell:kill-atom', 'run-specs'])
grunt.registerTask('ci', ['download-atom-shell', 'build', 'set-development-version', 'lint', 'test'])
grunt.registerTask('deploy', ['partial-clean', 'download-atom-shell', 'build', 'codesign'])
grunt.registerTask('ci', ['output-disk-space', 'download-atom-shell', 'build', 'set-version', 'lint', 'test', 'codesign', 'publish-build'])
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
grunt.registerTask('default', ['download-atom-shell', 'build', 'set-development-version', 'install'])
grunt.registerTask('default', ['download-atom-shell', 'build', 'set-version', 'install'])
+10
Ver Arquivo
@@ -0,0 +1,10 @@
# Atom Build
This folder contains the grunt configuration and tasks to build Atom.
It was moved from the root of the repository so that any native modules used
would be compiled against node's v8 headers since anything stored in
`node_modules` at the root of the repo is compiled against atom's v8 headers.
New build dependencies should be added to the `package.json` file located in
this folder.
+39
Ver Arquivo
@@ -0,0 +1,39 @@
{
"name": "atom-build",
"description": "Atom build",
"repository": {
"type": "git",
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"async": "~0.2.9",
"biscotto": "git://github.com/atom/biscotto.git#12188bfbe5f7303fa9f1aa3c4f8662d40ce3c3be",
"first-mate": "1.x",
"formidable": "~1.0.14",
"fs-plus": "1.x",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git://github.com/atom/grunt-coffeelint.git",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.9.0",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.6.0",
"grunt-download-atom-shell": "git+https://atom-bot:362295be4c5258d3f7b967bbabae662a455ca2a7@github.com/atom/grunt-download-atom-shell#v0.6.0",
"grunt-lesslint": "0.13.0",
"grunt-markdown": "~0.4.0",
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"js-yaml": "~2.1.0",
"json-front-matter": "~0.1.3",
"rcedit": "~0.1.2",
"request": "~2.27.0",
"rimraf": "~2.2.2",
"runas": "~0.3.0",
"underscore-plus": "1.x",
"unzip": "~0.1.9",
"vm-compatibility-layer": "~0.1.0",
"walkdir": "0.0.7"
}
}
@@ -21,6 +21,7 @@ module.exports = (grunt) ->
cp 'atom.sh', path.join(appDir, 'atom.sh')
cp 'package.json', path.join(appDir, 'package.json')
cp 'apm', path.join(appDir, 'apm')
packageDirectories = []
nonPackageDirectories = [
@@ -38,19 +39,27 @@ module.exports = (grunt) ->
else
nonPackageDirectories.push(directory)
# Put any paths here that shouldn't end up in the built Atom.app
# so that it doesn't becomes larger than it needs to be.
ignoredPaths = [
path.join('git-utils', 'deps')
path.join('oniguruma', 'deps')
path.join('less', 'dist')
path.join('less', 'test')
path.join('bootstrap', 'docs')
path.join('spellchecker', 'vendor')
path.join('xmldom', 'test')
path.join('vendor', 'apm')
path.join('resources', 'mac')
path.join('resources', 'win')
]
ignoredPaths = ignoredPaths.map (ignoredPath) -> "(#{ignoredPath})"
nodeModulesFilter = new RegExp(ignoredPaths.join('|'))
packageFilter = new RegExp("(#{ignoredPaths.join('|')})|(.+\\.(cson|coffee)$)")
for directory in nonPackageDirectories
cp directory, path.join(appDir, directory), filter: nodeModulesFilter
for directory in packageDirectories
cp directory, path.join(appDir, directory), filter: /.+\.(cson|coffee)$/
cp directory, path.join(appDir, directory), filter: packageFilter
cp 'spec', path.join(appDir, 'spec')
cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/
+25
Ver Arquivo
@@ -0,0 +1,25 @@
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'codesign', 'Codesign the app', ->
done = @async()
if process.env.XCODE_KEYCHAIN
unlockKeychain (error) ->
if error?
done(error)
else
signApp(done)
else
signApp(done)
unlockKeychain = (callback) ->
cmd = 'security'
{XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN} = process.env
args = ['unlock-keychain', '-p', XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN]
spawn {cmd, args}, (error) -> callback(error)
signApp = (callback) ->
cmd = 'codesign'
args = ['-f', '-v', '-s', 'Developer ID Application: GitHub', grunt.config.get('atom.shellAppDir')]
spawn {cmd, args}, (error) -> callback(error)
@@ -1,16 +1,51 @@
path = require 'path'
fs = require 'fs'
async = require 'async'
fs = require 'fs-plus'
request = require 'request'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
cmd = path.join('node_modules', '.bin', 'coffee')
commonArgs = [path.join('node_modules', '.bin', 'biscotto'), '--']
commonArgs = [path.join('build', 'node_modules', '.bin', 'biscotto'), '--']
opts =
stdio: 'inherit'
grunt.registerTask 'build-docs', 'Builds the API docs in src/app', ->
grunt.registerTask 'build-docs', 'Builds the API docs in src', ->
done = @async()
args = [commonArgs..., '--title', 'Atom API Documentation', '-o', 'docs/output/api', 'src/', '../telepath/src/range.coffee', '../telepath/src/point.coffee', '../telepath/src/string-marker.coffee']
grunt.util.spawn({cmd, args, opts}, done)
downloadFileFromRepo = ({repo, file}, callback) ->
uri = "https://raw2.github.com/atom/#{repo}/master/#{file}"
request uri, (error, response, contents) ->
return callback(error) if error?
downloadPath = path.join('docs', 'includes', repo, file)
fs.writeFile downloadPath, contents, (error) ->
callback(error, downloadPath)
includes = [
{repo: 'first-mate', file: 'src/grammar-registry.coffee'}
{repo: 'space-pen', file: 'src/space-pen.coffee'}
{repo: 'text-buffer', file: 'src/marker.coffee'}
{repo: 'text-buffer', file: 'src/point.coffee'}
{repo: 'text-buffer', file: 'src/range.coffee'}
{repo: 'theorist', file: 'src/model.coffee'}
]
async.map includes, downloadFileFromRepo, (error, includePaths) ->
if error?
done(error)
else
rm('docs/output/api')
args = [
commonArgs...
'--title', 'Atom API Documentation'
'-o', 'docs/output/api'
'-r', 'docs/README.md'
'src/'
includePaths...
]
grunt.util.spawn({cmd, args, opts}, done)
grunt.registerTask 'lint-docs', 'Generate stats about the doc coverage', ->
done = @async()
+25
Ver Arquivo
@@ -0,0 +1,25 @@
path = require 'path'
module.exports = (grunt) ->
{cp, mkdir, rm, spawn} = 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'
done = @async()
runas = require 'runas'
copyFolder = path.resolve 'script', 'copy-folder.cmd'
# cmd /c ""script" "source" "destination""
arg = "/c \"\"#{copyFolder}\" \"#{shellAppDir}\" \"#{installDir}\"\""
if runas('cmd', [arg], hide: true) isnt 0
done("Failed to copy #{shellAppDir} to #{installDir}")
createShortcut = path.resolve 'script', 'create-shortcut.cmd'
args = ['/c', createShortcut, path.join(installDir, 'atom.exe'), 'Atom']
spawn {cmd: 'cmd', args}, done
else
rm installDir
mkdir path.dirname(installDir)
cp shellAppDir, installDir
+25
Ver Arquivo
@@ -0,0 +1,25 @@
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'output-disk-space', 'Print diskspace available', ->
return unless process.platform is 'darwin'
done = @async()
cmd = 'df'
args = ['-Hl']
spawn {cmd, args}, (error, result, code) ->
return done(error) if error?
lines = result.stdout.split("\n")
for line in lines[1..]
[filesystem, size, used, avail, capacity, extra] = line.split(/\s+/)
capacity = parseInt(capacity)
if capacity > 90
grunt.log.error("#{filesystem} is at #{capacity}% capacity!")
else if capacity > 80
grunt.log.ok("#{filesystem} is at #{capacity}% capacity.")
done()
+172
Ver Arquivo
@@ -0,0 +1,172 @@
child_process = require 'child_process'
path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
grunt = null
maxReleases = 10
assetName = 'atom-mac.zip'
assetPath = "/tmp/atom-build/#{assetName}"
commitSha = process.env.JANKY_SHA1
token = process.env.ATOM_ACCESS_TOKEN
defaultHeaders =
Authorization: "token #{token}"
'User-Agent': 'Atom'
module.exports = (gruntObject) ->
grunt = gruntObject
grunt.registerTask 'publish-build', 'Publish the built app', ->
return unless process.platform is 'darwin'
return if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH isnt 'master'
done = @async()
createBuildRelease (error, release) ->
return done(error) if error?
zipApp (error) ->
return done(error) if error?
uploadAsset release, (error) ->
return done(error) if error?
publishRelease release, (error) ->
return done(error) if error?
getAtomDraftRelease (error, release) ->
return done(error) if error?
deleteExistingAsset release, (error) ->
return done(error) if error?
uploadAsset(release, done)
logError = (message, error, details) ->
grunt.log.error(message)
grunt.log.error(error.message ? error) if error?
grunt.log.error(details) if details
zipApp = (callback) ->
fs.removeSync(assetPath)
options = {cwd: path.dirname(assetPath), maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{assetName} Atom.app", options, (error, stdout, stderr) ->
if error?
logError('Zipping Atom.app failed', error, stderr)
callback(error)
getRelease = (callback) ->
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'GET'
headers: defaultHeaders
json: true
request options, (error, response, releases=[]) ->
if error? or response.statusCode isnt 200
logError('Fetching releases failed', error, releases)
callback(error ? new Error(response.statusCode))
else
if releases.length > maxReleases
deleteRelease(release) for release in releases[maxReleases..]
for release in releases when release.name is commitSha
callback(null, release)
return
callback()
getAtomDraftRelease = (callback) ->
atomRepo = new GitHub({repo: 'atom/atom', token})
atomRepo.getReleases (error, releases=[]) ->
if error?
logError('Fetching atom/atom releases failed', error, releases)
callback(error)
else
for release in releases when release.draft
callback(null, release)
return
callback(new Error('No draft release in atom/atom repo'))
deleteRelease = (release) ->
options =
uri: release.url
method: 'DELETE'
headers: defaultHeaders
json: true
request options, (error, response, body='') ->
if error? or response.statusCode isnt 204
logError('Deleting release failed', error, body)
deleteExistingAsset = (release, callback) ->
for asset in release.assets when asset.name is assetName
options =
uri: asset.url
method: 'DELETE'
headers: defaultHeaders
request options, (error, response, body='') ->
if error? or response.statusCode isnt 204
logError('Deleting existing release asset failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback()
return
callback()
createBuildRelease = (callback) ->
getRelease (error, release) ->
if error?
callback(error)
return
if release?
deleteExistingAsset release, (error) ->
callback(error, release)
return
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'POST'
headers: defaultHeaders
json:
tag_name: "v#{commitSha}"
target_commitish: 'master'
name: commitSha
body: "Build of [atom@#{commitSha.substring(0, 7)}](https://github.com/atom/atom/commits/#{commitSha})"
draft: true
prerelease: true
request options, (error, response, release={}) ->
if error? or response.statusCode isnt 201
logError('Creating release failed', error, release)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
uploadAsset = (release, callback) ->
options =
uri: release.upload_url.replace(/\{.*$/, "?name=#{assetName}")
method: 'POST'
headers: _.extend({
'Content-Type': 'application/zip'
'Content-Length': fs.getSizeSync(assetPath)
}, defaultHeaders)
assetRequest = request options, (error, response, body='') ->
if error? or response.statusCode >= 400
logError('Upload release asset failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback(null, release)
fs.createReadStream(assetPath).pipe(assetRequest)
publishRelease = (release, callback) ->
options =
uri: release.url
method: 'POST'
headers: defaultHeaders
json:
draft: false
request options, (error, response, body={}) ->
if error? or response.statusCode isnt 200
logError('Creating release failed', error, body)
callback(error ? new Error(response.statusCode))
else
callback()
@@ -6,7 +6,7 @@ module.exports = (grunt) ->
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
iconPath = path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
iconPath = path.resolve('resources', 'win', 'atom.ico')
rcedit = require('rcedit')
rcedit(shellExePath, {'icon': iconPath}, done)
+50
Ver Arquivo
@@ -0,0 +1,50 @@
fs = require 'fs'
path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
getVersion = (callback) ->
if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master'
{version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
callback(null, version)
else
cmd = 'git'
args = ['rev-parse', '--short', 'HEAD']
spawn {cmd, args}, (error, {stdout}={}, code) ->
callback(error, stdout?.trim?())
grunt.registerTask 'set-version', 'Set the version in the plist and package.json', ->
done = @async()
getVersion (error, version) ->
if error?
done(error)
return
appDir = grunt.config.get('atom.appDir')
# Replace version field of package.json.
packageJsonPath = path.join(appDir, 'package.json')
packageJson = require(packageJsonPath)
packageJson.version = version
packageJsonString = JSON.stringify(packageJson, null, 2)
fs.writeFileSync(packageJsonPath, packageJsonString)
if process.platform is 'darwin'
cmd = 'script/set-version'
args = [grunt.config.get('atom.buildDir'), version]
spawn {cmd, args}, (error, result, code) -> done(error)
else if process.platform is 'win32'
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
strings =
CompanyName: 'GitHub, Inc.'
FileDescription: 'The hackable editor'
LegalCopyright: 'Copyright (C) 2013 GitHub, Inc. All rights reserved'
ProductName: 'Atom'
ProductVersion: version
rcedit = require('rcedit')
rcedit(shellExePath, {'version-string': strings}, done)
+112
Ver Arquivo
@@ -0,0 +1,112 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
async = require 'async'
module.exports = (grunt) ->
{isAtomPackage, spawn} = require('./task-helpers')(grunt)
packageSpecQueue = null
runPackageSpecs = (callback) ->
failedPackages = []
rootDir = grunt.config.get('atom.shellAppDir')
contentsDir = grunt.config.get('atom.contentsDir')
resourcePath = process.cwd()
if process.platform is 'darwin'
appPath = path.join(contentsDir, 'MacOS', 'Atom')
else if process.platform is 'win32'
appPath = path.join(contentsDir, 'atom.exe')
packageSpecQueue = async.queue (packagePath, callback) ->
if process.platform is 'darwin'
options =
cmd: appPath
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{path.join(packagePath, 'spec')}"]
opts:
cwd: packagePath
env: _.extend({}, process.env, ATOM_PATH: rootDir)
else if process.platform is 'win32'
options =
cmd: process.env.comspec
args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", "--spec-directory=#{path.join(packagePath, 'spec')}", "--log-file=ci.log"]
opts:
cwd: packagePath
env: _.extend({}, process.env, ATOM_PATH: rootDir)
grunt.verbose.writeln "Launching #{path.basename(packagePath)} specs."
spawn options, (error, results, code) ->
if process.platform is 'win32'
process.stderr.write(fs.readFileSync(path.join(packagePath, 'ci.log')))
fs.unlinkSync(path.join(packagePath, 'ci.log'))
failedPackages.push path.basename(packagePath) if error
callback()
modulesDirectory = path.resolve('node_modules')
for packageDirectory in fs.readdirSync(modulesDirectory)
packagePath = path.join(modulesDirectory, packageDirectory)
continue unless grunt.file.isDir(path.join(packagePath, 'spec'))
continue unless isAtomPackage(packagePath)
packageSpecQueue.push(packagePath)
# TODO: Restore concurrency on Windows
packageSpecQueue.concurrency = 1 unless process.platform is 'win32'
packageSpecQueue.drain = -> callback(null, failedPackages)
runCoreSpecs = (callback) ->
contentsDir = grunt.config.get('atom.contentsDir')
if process.platform is 'darwin'
appPath = path.join(contentsDir, 'MacOS', 'Atom')
else if process.platform is 'win32'
appPath = path.join(contentsDir, 'atom.exe')
resourcePath = process.cwd()
coreSpecsPath = path.resolve('spec')
if process.platform is 'darwin'
options =
cmd: appPath
args: ['--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}"]
else if process.platform is 'win32'
options =
cmd: process.env.comspec
args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", "--spec-directory=#{coreSpecsPath}", "--log-file=ci.log"]
spawn options, (error, results, code) ->
if process.platform is 'win32'
process.stderr.write(fs.readFileSync('ci.log'))
fs.unlinkSync('ci.log')
else
# TODO: Restore concurrency on Windows
packageSpecQueue.concurrency = 2
callback(null, error)
grunt.registerTask 'run-specs', 'Run the specs', ->
done = @async()
startTime = Date.now()
# TODO: This should really be parallel on both platforms, however our
# fixtures step on each others toes currently.
if process.platform is 'darwin'
method = async.parallel
else if process.platform is 'win32'
method = async.series
method [runCoreSpecs, runPackageSpecs], (error, results) ->
[coreSpecFailed, failedPackages] = results
elapsedTime = Math.round((Date.now() - startTime) / 100) / 10
grunt.verbose.writeln("Total spec time: #{elapsedTime}s")
failures = failedPackages
failures.push "atom core" if coreSpecFailed
grunt.log.error("[Error]".red + " #{failures.join(', ')} spec(s) failed") if failures.length > 0
# TODO: Mark the build as green on Windows until specs pass.
if process.platform is 'darwin'
done(!coreSpecFailed and failedPackages.length == 0)
else if process.platform is 'win32'
done(true)
@@ -39,7 +39,7 @@ module.exports = (grunt) ->
proc = childProcess.spawn(options.cmd, options.args, options.opts)
proc.stdout.on 'data', (data) -> stdout.push(data.toString())
proc.stderr.on 'data', (data) -> stderr.push(data.toString())
proc.on 'exit', (exitCode, signal) ->
proc.on 'close', (exitCode, signal) ->
error = new Error(signal) if exitCode != 0
results = {stderr: stderr.join(''), stdout: stdout.join(''), code: exitCode}
grunt.log.error results.stderr if exitCode != 0
+62
Ver Arquivo
@@ -0,0 +1,62 @@
# Welcome to the Atom API Documentation
![Atom](http://i.imgur.com/OrTvUAD.png)
## FAQ
### Where do I start?
Check out [EditorView][EditorView] and [Editor][Editor] classes for a good
overview of the main editor API.
### How do I access these classes?
Check out the [Atom][Atom] class docs to see what globals are available and
what they provide.
You can also require many of these classes in your package via:
```coffee
{EditorView} = require 'atom'
```
The classes available from `require 'atom'` are:
* [BufferedProcess][BufferedProcess]
* [BufferedNodeProcess][BufferedNodeProcess]
* [Directory][Directory]
* [EditorView][EditorView]
* [File][File]
* [Git][Git]
* [Point][Point]
* [Range][Range]
* [ScrollView][ScrollView]
* [SelectListView][SelectListView]
* [View][View]
* [WorkspaceView][WorkspaceView]
### How do I create a package?
You probably want to read the [creating a package][creating-a-package]
doc first and come back here when you are done.
### Where are the node docs?
Atom ships with node 0.11.10 and the comprehensive node API docs are available
[here][node-docs].
[Atom]: ../classes/Atom.html
[BufferedProcess]: ../classes/BufferedProcess.html
[BufferedNodeProcess]: ../classes/BufferedNodeProcess.html
[Directory]: ../classes/Directory.html
[Editor]: ../classes/Editor.html
[EditorView]: ../classes/EditorView.html
[File]: ../classes/File.html
[Git]: ../classes/Git.html
[Point]: ../classes/Point.html
[Range]: ../classes/Range.html
[ScrollView]: ../classes/ScrollView.html
[SelectListView]: ../classes/SelectListView.html
[View]: ../classes/View.html
[WorkspaceView]: ../classes/WorkspaceView.html
[creating-a-package]: https://www.atom.io/docs/latest/creating-a-package
[node-docs]: http://nodejs.org/docs/v0.11.10/api
+76
Ver Arquivo
@@ -0,0 +1,76 @@
## Configuration API
### Reading Config Settings
If you are writing a package that you want to make configurable, you'll need to
read config settings via the `atom.config` global. You can read the current
value of a namespaced config key with `atom.config.get`:
```coffeescript
# read a value with `config.get`
@showInvisibles() if atom.config.get "editor.showInvisibles"
```
Or you can use the `::observeConfig` to track changes from any view object.
```coffeescript
class MyView extends View
initialize: ->
@observeConfig 'editor.fontSize', () =>
@adjustFontSize()
```
The `::observeConfig` method will call the given callback immediately with the
current value for the specified key path, and it will also call it in the future
whenever the value of that key path changes.
Subscriptions made with `observeConfig` are automatically canceled when the
view is removed. You can cancel config subscriptions manually via the
`unobserveConfig` method.
```coffeescript
view1.unobserveConfig() # unobserve all properties
```
You can add the ability to observe config values to non-view classes by
extending their prototype with the `ConfigObserver` mixin:
```coffeescript
{ConfigObserver} = require 'atom'
class MyClass
ConfigObserver.includeInto(this)
constructor: ->
@observeConfig 'editor.showInvisibles', -> # ...
destroy: ->
@unobserveConfig()
```
### Writing Config Settings
The `atom.config` database is populated on startup from `~/.atom/config.cson`,
but you can programmatically write to it with `atom.config.set`:
```coffeescript
# basic key update
atom.config.set("core.showInvisibles", true)
```
You should never mutate the value of a config key, because that would circumvent
the notification of observers. You can however use methods like `pushAtKeyPath`,
`unshiftAtKeyPath`, and `removeAtKeyPath` to manipulate mutable config values.
```coffeescript
atom.config.pushAtKeyPath("core.disabledPackages", "wrap-guide")
atom.config.removeAtKeyPath("core.disabledPackages", "terminal")
```
You can also use `setDefaults`, which will assign default values for keys that
are always overridden by values assigned with `set`. Defaults are not written
out to the the `config.json` file to prevent it from becoming cluttered.
```coffeescript
atom.config.setDefaults("editor", fontSize: 18, showInvisibles: true)
```
+34
Ver Arquivo
@@ -0,0 +1,34 @@
# Globals
Atom exposes several services through singleton objects accessible via the
`atom` global:
* atom
* workspace:
Manipulate and query the state of the user interface for the current
window. Open editors, manipulate panes.
* workspaceView:
Similar to workspace, but provides access to the root of all views in the
current window.
* project:
Access the directory associated with the current window. Load editors,
perform project-wide searches, register custom openers for special file
types.
* config:
Read, write, and observe user configuration settings.
* keymap:
Add and query the currently active keybindings.
* deserializers:
Deserialize instances from their state objects and register deserializers.
* packages:
Activate, deactivate, and query user packages.
* themes:
Activate, deactivate, and query user themes.
* contextMenu:
Register context menus.
* menu:
Register application menus.
* pasteboard:
Read from and write to the system pasteboard.
* syntax:
Assign and query syntactically-scoped properties.
+123
Ver Arquivo
@@ -0,0 +1,123 @@
# Keymaps In-Depth
## Structure of a Keymap File
Keymap files are encoded as JSON or CSON files containing nested hashes. They
work much like stylesheets, but instead of applying style properties to elements
matching the selector, they specify the meaning of keystrokes on elements
matching the selector. Here is an example of some bindings that apply when
keystrokes pass through elements with the class `.editor`:
```coffee
'.editor':
'cmd-delete': 'editor:backspace-to-beginning-of-line'
'alt-backspace': 'editor:backspace-to-beginning-of-word'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-shift-e': 'editor:select-to-end-of-line'
'cmd-left': 'editor:move-to-first-character-of-line'
'.editor:not(.mini)'
'cmd-alt-[': 'editor:fold-current-row'
'cmd-alt-]': 'editor:unfold-current-row'
```
Beneath the first selector are several bindings, mapping specific *keystroke
patterns* to *commands*. When an element with the `.editor` class is focused and
`cmd-delete` is pressed, an custom DOM event called
`editor:backspace-to-beginning-of-line` is emitted on the `.editor` element.
The second selector group also targets editors, but only if they don't have the
`.mini` class. In this example, the commands for code folding don't really make
sense on mini-editors, so the selector restricts them to regular editors.
### Keystroke Patterns
Keystroke patterns express one or more keystrokes combined with optional
modifier keys. For example: `ctrl-w v`, or `cmd-shift-up`. A keystroke is
composed of the following symbols, separated by a `-`. A multi-keystroke pattern
can be expressed as keystroke patterns separated by spaces.
| Type | Examples
| --------------------|----------------------------
| Character literals | `a` `4` `$`
| Modifier keys | `cmd` `ctrl` `alt` `shift`
| Special keys | `enter` `escape` `backspace` `delete` `tab` `home` `end` `pageup` `pagedown` `left` `right` `up` `down`
### Commands
Commands are custom DOM events that are triggered when a keystroke matches a
binding. This allows user interface code to listen for named commands without
specifying the specific keybinding that triggers it. For example, the following
code sets up {EditorView} to listen for commands to move the cursor to the first
character of the current line:
```coffee
class EditorView
listenForEvents: ->
@command 'editor:move-to-first-character-of-line', =>
@editor.moveCursorToFirstCharacterOfLine()
```
The `::command` method is basically an enhanced version of jQuery's `::on`
method that listens for a custom DOM event and adds some metadata to the DOM,
which is read by the command palette.
When you are looking to bind new keys, it is often useful to use the command
palette (`ctrl-shift-p`) to discover what commands are being listened for in a
given focus context. Commands are "humanized" following a simple algorithm, so a
command like `editor:fold-current-row` would appear as "Editor: Fold Current
Row".
### Specificity and Cascade Order
As is the case with CSS applying styles, when multiple bindings match for a
single element, the conflict is resolved by choosing the most *specific*
selector. If two matching selectors have the same specificity, the binding
for the selector appearing later in the cascade takes precedence.
Currently, there's no way to specify selector ordering within a single keymap,
because JSON objects do not preserve order. We eventually plan to introduce a
custom CSS-like file format for keymaps that allows for ordering within a single
file. For now, we've opted to handle cases where selector ordering is critical
by breaking the keymap into two separate files, such as `snippets-1.cson` and
`snippets-2.cson`.
## Overloading Key Bindings
Occasionally, it makes sense to layer multiple actions on top of the same key
binding. An example of this is the snippets package. Snippets are inserted by
typing a snippet prefix such as `for` and then pressing `tab`. Every time `tab`
is pressed, we want to execute code attempting to expand a snippet if one exists
for the text preceding the cursor. If a snippet *doesn't* exist, we want `tab`
to actually insert whitespace.
To achieve this, the snippets package makes use of the `.abortKeyBinding()`
method on the event object representing the `snippets:expand` command.
```coffee-script
# pseudo-code
editor.command 'snippets:expand', (e) =>
if @cursorFollowsValidPrefix()
@expandSnippet()
else
e.abortKeyBinding()
```
When the event handler observes that the cursor does not follow a valid prefix,
it calls `e.abortKeyBinding()`, telling the keymap system to continue searching
for another matching binding.
## Step-by-Step: How Keydown Events are Mapped to Commands
* A keydown event occurs on a *focused* element.
* Starting at the focused element, the keymap walks upward towards the root of
the document, searching for the most specific CSS selector that matches the
current DOM element and also contains a keystroke pattern matching the keydown
event.
* When a matching keystroke pattern is found, the search is terminated and the
pattern's corresponding command is triggered on the current element.
* If `.abortKeyBinding()` is called on the triggered event object, the search
is resumed, triggering a binding on the next-most-specific CSS selector for
the same element or continuing upward to parent elements.
* If no bindings are found, the event is handled by Chromium normally.
@@ -40,25 +40,18 @@ window, and contains every other view. If you open Atom's inspector with
#### Panes
The `WorkspaceView` contains a `#horizontal` and a `#vertical` axis surrounding
`#panes`. Elements in the horizontal axis will tile across the window
horizontally, appearing to have a vertical orientation. Items in the vertical
axis will tile across the window vertically, appearing to have a horizontal
orientation. You would typically attach tool panels to the root view's primary
axes. Tool panels are elements which take up some screen real estate that isn't
devoted to direct editing. In the example above, the `TreeView` is present in
the `#horizontal` axis to the left of the `#panes`, and the `CommandPanel` is
present in the `#vertical` axis below the `#panes`.
You can attach a tool panel to an axis using the `horizontal` or `vertical`
outlets as follows:
The `WorkspaceView` contains `prependToBottom/Top/Left/Right` and
`appendToBottom/Top/Left/Right` methods, which are used to add Tool Panels. Tool
panels are elements that take up screen real estate not devoted to text editing.
In the example above, the `TreeView` is appended to the left, and the
`CommandPanel` is appended to the top.
```coffeescript
# place a view to the left of the panes (or use .append() to place it to the right)
atom.workspaceView.horizontal.prepend(new MyView)
# place a view to the left of the panes
atom.workspaceView.appendToLeft(new MyView)
# place a view below the panes (or use .prepend() to place it above)
atom.workspaceView.vertical.append(new MyOtherView)
# place a view below the panes
atom.workspaceView.appendToBottom(new MyOtherView)
```
[spacepen]: http://github.com/nathansobo/space-pen
+7 -7
Ver Arquivo
@@ -44,13 +44,13 @@ key mappings your package needs to load. If not specified, mappings in the
_keymaps_ directory are added alphabetically.
- `menus`(**Optional**): an Array of Strings identifying the order of
the menu mappings your package needs to load. If not specified, mappings
in the _keymap_ directory are added alphabetically.
in the _menus_ directory are added alphabetically.
- `snippets` (**Optional**): an Array of Strings identifying the order of the
snippets your package needs to load. If not specified, snippets in the
_snippets_ directory are added alphabetically.
- `activationEvents` (**Optional**): an Array of Strings identifying events that
trigger your package's activation. You can delay the loading of your package
until one of these events is trigged.
until one of these events is triggered.
## Source Code
@@ -154,7 +154,7 @@ loaded in alphabetical order. An optional `keymaps` array in your _package.json_
can specify which keymaps to load and in what order.
Keybindings are executed by determining which element the keypress occured on. In
Keybindings are executed by determining which element the keypress occurred on. In
the example above, `changer:magic` command is executed when pressing `ctrl-V` on
the `.tree-view-scroller` element.
@@ -172,7 +172,7 @@ specify which menus to load and in what order.
It's recommended that you create an application menu item for common actions
with your package that aren't tied to a specific element:
```coffee-script
```coffeescript
'menu': [
{
'label': 'Packages'
@@ -202,7 +202,7 @@ by other packages in the order which they were loaded.
It's recommended to specify a context menu item for commands that are linked to
specific parts of the interface, like adding a file in the tree-view:
```coffee-script
```coffeescript
'context-menu':
'.tree-view':
'Add file': 'tree-view:add-file'
@@ -311,7 +311,7 @@ protocol URLs to load resources in the package.
The URLs should be in the format of
`atom://package-name/relative-path-to-package-of-resource`, for example, the
`atom://image-view/images/transparent-background.gif` would be equivablent to
`atom://image-view/images/transparent-background.gif` would be equivalent to
`~/.atom/packages/image-view/images/transparent-background.gif`.
You can also use the `atom` protocol URLs in themes.
@@ -381,7 +381,7 @@ Additional libraries can be found by browsing Atom's *node_modules* folder.
[apm]: https://github.com/atom/apm
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[wrap-guide]: https://github.com/atom/wrap-guide/
[keymaps]: internals/keymaps.md
[keymaps]: advanced/keymaps.md
[theme-variables]: theme-variables.md
[tm-tokens]: http://manual.macromates.com/en/language_grammars.html
[spacepen]: https://github.com/nathansobo/space-pen
+22 -11
Ver Arquivo
@@ -19,6 +19,16 @@ Themes` section on the `Packages` tab within the Settings panel.
You can install non-bundled packages by going to the `Available Packages`
section on the `Packages` tab within the Settings panel (`cmd-,`).
You can also install packages from the command line using the
[apm](https://github.com/atom/apm) command:
`apm install <package_name>` to install the latest version.
`apm install <package_name>@<package_version>` to install a specific version.
For example `apm install emmet@0.1.5` installs the `0.1.5` release of the
[Emmet](https://github.com/atom/emmet) package into `~/.atom/packages`.
## Customizing Key Bindings
Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
@@ -56,7 +66,7 @@ directory, which contains CoffeeScript-style JSON:
```coffeescript
core:
hideGitIgnoredFiles: true
excludeVcsIgnoredPaths: true
editor:
fontSize: 18
```
@@ -69,7 +79,6 @@ namespaces: `core` and `editor`.
- `core`
- `disabledPackages`: An array of package names to disable
- `excludeVcsIgnoredPaths`: Don't search within files specified by _.gitignore_
- `hideGitIgnoredFiles`: Whether files in the _.gitignore_ should be hidden
- `ignoredNames`: File names to ignore across all of Atom
- `projectHome`: The directory where projects are assumed to be located
- `themes`: An array of theme names to load, in cascading order
@@ -97,7 +106,7 @@ namespaces: `core` and `editor`.
- `whitespace`
- `ensureSingleTrailingNewline`: Whether to reduce multiple newlines to one at the end of files
- `removeTrailingWhitespace`: Enable/disable striping of whitespace at the end of lines (defaults to `true`)
- `wrapGuide`
- `wrap-guide`
- `columns`: Array of hashes with a `pattern` and `column` key to match the
the path of the current editor to a column position.
@@ -111,22 +120,24 @@ make customizations. You have full access to Atom's API from code in this file.
If customizations become extensive, consider [creating a
package][create-a-package].
### user.less
### styles.css
If you want to apply quick-and-dirty personal styling changes without creating
an entire theme that you intend to distribute, you can add styles to
_user.less_ in your _~/.atom_ directory.
_styles.css_ in your _~/.atom_ directory.
For example, to change the color of the highlighted line number for the line
that contains the cursor, you could add the following style to _user.less_:
that contains the cursor, you could add the following style to _styles.css_:
```less
@highlight-color: pink;
.editor .line-number.cursor-line {
color: @highlight-color;
```css
.editor .cursor {
border-color: pink;
}
```
You can also name the file _styles.less_ if you want to style Atom using
[LESS][LESS].
[create-a-package]: creating-packages.md
[create-theme]: creating-a-theme.md
[LESS]: http://www.lesscss.org
+35 -32
Ver Arquivo
@@ -19,13 +19,11 @@ bindings][key-bindings] section.
### Working With Files
Atom windows are scoped to the directory they're opened from. If you launch Atom
from the command line everything will be relative to the current directory. This
means that the tree view on the left will only show files contained within that
directory.
This can be a useful way to organize multiple projects, as each project will be
contained within its own window.
Atom windows are scoped to a single directory on disk. If you launch Atom from
the command line via the `atom` command and don't specify a path, Atom opens a
window for the current working directory. The current window's directory will be
visible as the root of the tree view at the left, and also serve as the context
for all file-related operations.
#### Finding Files
@@ -34,20 +32,17 @@ begin typing the name of the file you're looking for. If you are looking for a
file that is already open press `cmd-b` to bring up a searchable list of open
files.
You can also use the tree view to navigate to a file. To open or move focus to
the tree view, press `cmd-\`. You can then navigate to a file using the arrow
keys and select it with `return`.
You can also use the tree view to navigate to a file. To open and focus the
the tree view, press `ctrl-0`. The tree view can be toggled open and closed with
`cmd-\`.
#### Adding, Moving, Deleting Files
Currently, all file modification is performed via the tree view. To add a file,
select a directory in the tree view and press `a`. Then type the name of the
file. Any intermediate directories you type will be created automatically if
needed.
To move or rename a file or directory, select it in the tree view and press `m`.
To delete a file, select it in the tree view and press `delete`.
Currently, all file modification is performed via the tree view. Add, move, or
delete a file by right-clicking in the tree view and selecting the desired
operation from the context menu. You can also perform these operations from the
keyboard by selecting a file or directory and using `a` to add, `m` to move, and
`delete` to delete.
### Searching
@@ -58,35 +53,43 @@ To search within a buffer use `cmd-f`. To search the entire project use
#### Navigating By Symbols
If you want to jump to a method press `cmd-r`. It opens a list of all symbols
in the current file.
To jump to a symbol such as a method definition, press `cmd-r`. This opens a
list of all symbols in the current file, which you can fuzzy filter similarly to
`cmd-t`.
To search for symbols across your project use `cmd-shift-r`, but you'll need to
make sure you have a ctags installed and a tags file generated for your project.
Also, if you're editing CoffeeScript, it's a good idea to update your `~/.ctags`
file to understand the language. Here is [a good example][ctags].
To search for symbols across your project, use `cmd-shift-r`. First you'll need
to make sure you have ctags installed and a tags file generated for your
project. Also, if you're editing CoffeeScript, it's a good idea to update your
`~/.ctags` file to understand the language. Here is [a good example][ctags].
### Split Panes
You can split any editor pane horizontally or vertically by using `cmd-k right` or
`cmd-k down`. Once you have a split pane, you can move focus between them with
`cmd-k cmd-right` or `cmd-k cmd-down`. To close a pane, close all tabs inside it.
You can split any editor pane horizontally or vertically by using `cmd-k right`
or `cmd-k down`. Once you have a split pane, you can move focus between them
with `cmd-k cmd-right` or `cmd-k cmd-down`. To close a pane, close all its
editors with `meta-w`, then press `meta-w` one more time to close the pane. You
can configure panes to auto-close with empty in the preferences.
### Folding
You can fold everything with `alt-cmd-{` and unfold everything with
`alt-cmd-}`. Or, you can fold / unfold by a single level with `alt-cmd-[` and
`alt-cmd-]`.
You can fold blocks of code by clicking the arrows that appear when you hover
your mouse cursor over the gutter. You can also fold and unfold from the
keyboard with `alt-cmd-[` and `alt-cmd-]`. To fold everything, use
`alt-cmd-shift-{` and to unfold everything use `alt-cmd-shift-}`. You can also
fold at a specific indentation level with `cmd-k cmd-N` where N is the
indentation depth.
### Soft-Wrap
If you want to toggle soft wrap, trigger the command from the command palette.
Press `cmd-shift-P` to open the palette, then type "wrap" to find the correct
command.
command. By default, lines will wrap based on the size of the editor. If you
prefer to wrap at a specific line length, toggle "Wrap at preferred line length"
in preferences.
## Configuration
Press `cmd-,` to display the a settings pane. This serves as the primary
Press `cmd-,` to display the preferences pane. This serves as the primary
interface for adjusting config settings, installing packages and changing
themes.
+4 -4
Ver Arquivo
@@ -7,7 +7,7 @@
### Advanced Topics
* [Configuration](internals/configuration.md)
* [Keymaps](internals/keymaps.md)
* [Serialization](internals/serialization.md)
* [View System](internals/view-system.md)
* [Configuration](advanced/configuration.md)
* [Keymaps](advanced/keymaps.md)
* [Serialization](advanced/serialization.md)
* [View System](advanced/view-system.md)
-61
Ver Arquivo
@@ -1,61 +0,0 @@
## Configuration API
### Reading Config Settings
If you are writing a package that you want to make configurable, you'll need to
read config settings. You can read a value from `config` with `config.get`:
```coffeescript
# read a value with `config.get`
@showInvisibles() if config.get "edtior.showInvisibles"
```
Or you can use `observeConfig` to track changes from a view object.
```coffeescript
class MyView extends View
initialize: ->
@observeConfig 'editor.fontSize', () =>
@adjustFontSize()
```
The `observeConfig` method will call the given callback immediately with the
current value for the specified key path, and it will also call it in the future
whenever the value of that key path changes.
Subscriptions made with `observeConfig` are automatically cancelled when the
view is removed. You can cancel config subscriptions manually via the
`unobserveConfig` method.
```coffeescript
view1.unobserveConfig() # unobserve all properties
```
You can add the ability to observe config values to non-view classes by
extending their prototype with the `ConfigObserver` mixin:
```coffeescript
ConfigObserver = require 'config-observer'
_.extend MyClass.prototype, ConfigObserver
```
### Writing Config Settings
As discussed above, the config database is automatically populated from
`config.cson` when Atom is started, but you can programmatically write to it in
the following way:
```coffeescript
# basic key update
config.set("core.showInvisibles", true)
config.pushAtKeyPath("core.disabledPackages", "wrap-guide")
```
You can also use `setDefaults`, which will assign default values for keys that
are always overridden by values assigned with `set`. Defaults are not written out
to the the `config.json` file to prevent it from becoming cluttered.
```coffeescript
config.setDefaults("editor", fontSize: 18, showInvisibles: true)
```
-69
Ver Arquivo
@@ -1,69 +0,0 @@
## Keymaps In-Depth
### Structure of a Keymap File
Keymap files are encoded as JSON or CSON files containing nested hashes. The
top-level keys of a keymap are **CSS 3 selectors**, which specify a particular
context in Atom's interface. Common selectors are `.editor`, which scopes
bindings to just work when an editor is focused, and `body`, which scopes
bindings globally.
Beneath the selectors are hashes mapping **keystroke patterns** to
**semantic events**. A keystroke pattern looks like the following examples.
Note that the last example describes multiple keystrokes in succession:
- `p`
- `2`
- `ctrl-p`
- `ctrl-alt-cmd-p`
- `tab`
- `escape`
- `enter`
- `ctrl-w w`
A semantic event is the name of the custom event that will be triggered on the
target of the keydown event when a key binding matches. You can use the command
palette (bound to `cmd-shift-P`), to get a list of relevant events and their bindings
in any focused context in Atom.
### Rules for Mapping A Keydown Event to A Semantic Event
A keymap's job is to translate a physical keystroke event (like `cmd-D`) into a
semantic event (like `editor:duplicate-line`). Whenever a keydown event occurs
on a focused element, it bubbles up the DOM as usual. As soon as an element on
the bubble path matches a key binding for the keystroke, the binding's semantic
event is triggered on the original target of the keydown event. Just as with
CSS, if multiple selectors match an element, the most specific selector is
favored. If two selectors have the same specificity, the selector that occurs
latest in the cascade is favored.
Currently, there's no way to specify selector ordering within a single keymap,
because JSON hashes do not preserve order. Rather than making the format more
awkward in order to preserve order, we've opted to handle cases where order is
critical by breaking the keymap into two separate files, such as
`snippets-1.cson` and `snippets-2.cson`.
### Overloading Key Bindings
Occasionally, it makes sense to layer multiple actions on top of the same key
binding. An example of this is the snippets package. You expand a snippet by
pressing `tab` immediately following a snippet's prefix. But if the cursor is
not following a valid snippet prefix, then we want tab to perform its normal
action (probably inserting a tab character or the appropriate number of spaces).
To achieve this, the snippets package makes use of the `abortKeyBinding` method
on the event object that's triggered by the binding for `tab`.
```coffee-script
# pseudo-code
editor.command 'snippets:expand', (e) =>
if @cursorFollowsValidPrefix()
@expandSnippet()
else
e.abortKeyBinding()
```
When the event handler observes that the cursor does not follow a valid prefix,
it calls `e.abortKeyBinding()`, which tells the keymap system to continue
searching up the cascade for another matching binding. In this case, the default
implementation of `tab` ends up getting triggered.
-70
Ver Arquivo
@@ -1,70 +0,0 @@
**Polish the user experience**
First and foremost, Atom is a **product**. Atom needs to feel familiar and
inviting. This includes a solid introductory experience and parity with the most
important features of Sublime Text.
* First launch UI and flow (actions below should be easily discoverable)
* Create a new file
* Open a project and edit an existing file
* Install a package
* Change settings (adjust theme, change key bindings, set config options)
* How to use command P
* Use collaboration internally
* How and where to edit keyBinding should be obvious to new users
* Finish find and replace in buffer/project
* Atom should start < 300ms
* Match Sublime's multiple selection functionality (#523)
* Fix softwrap bugs
* Menus & Context menus
* Track usage/engagement of our users (make this opted in?)
* Windows support
* Reliably and securely auto-update and list what's new
* Secure access to the keychain (don't give every package access to the keychain)
* Secure access to GitHub (each package can ask to have it's own oauth token)
* Don't crash when opening/editing large (> 10Mb) files
* Send js and native crash reports to a remote server
**Lay solid groundwork for a package and theme ecosystem**
Extensibility is one of Atom's key value propositions, so a smooth experience
for creating and maintaining packages is just as important as the user
experience. The package development, dependency and publishing workflow needs to
be solid. We also want to have a mechanism for clearly communicating with
package authors about breaking API changes.
* Finish APM backend (integrate with GitHub Releases)
* Streamline Dev workflow
* `apm create` - create package scaffolding
* `apm test` - so users can run focused package tests
* `apm publish` - should integrate release best practices (ie npm version)
* Determine which classes and methods should be included in the public API
* Users can find/install/update/fork existing packages and themes
**Tighten up the view layer**
Our current approach to the view layer need some improvement. We want to
actively promote the use of the M-V-VM design pattern, provide some declarative
event binding mechanisms in the view layer, and improve the performance of the
typical package specs. We don't want the current approach to be used as an
example in a bunch of new packages, so it's important to improve it now.
* Add marker view API
**Get atom.io online with some exciting articles and documentation**
We'd love to send our private alpha candidates to a nice site with information
about what Atom is, the philosophies and technologies behind it, and guidance
for how to get started.
* Design and create www.atom.io
* Guides
* Theme & Package creation guide
* Full API per release tag
* Changelog per release
* Explanation of features
* Explain Semver and general plans for the future (reassure developers we care about them)
* General Values/Goals
* Make docs accessible from Atom
* Community/contribution guidelines
* Is all communication to be done through issues?
* When should you publish a plugin?
* Do we need to vet plugins from a security perspective?
-16
Ver Arquivo
@@ -1,16 +0,0 @@
## Proposed Timeline
1. **October 30st** - Internal launch - persuade as many githubbers to switch as
possible.
1. Triage bugs and identify what needs to be fixed before private alpha. Maybe
talk to @chrissiebrodigan about doing a UX study.
1. **November 22st** - Private alpha launch
1. Trickle out invites as people ask/we need more testers.
1. If our usage metrics/engagement metrics decrease, stop, identify the issue
and fix it before continuing.
1. Launch
+39
Ver Arquivo
@@ -0,0 +1,39 @@
# Setting up Travis CI
Packages under the [atom org][atom-org] should use [Travis CI][travis-ci] for
builds.
Currently we have a [Travis Pro][travis-pro] account since the repositories
are private. This process will be simpler and have fewer steps once the
package repos are made public.
Each package builds using the [build-package][build-package] script, any
changes to the build should be made in that script and will affect all
package builds immediately.
Each package builds against the latest successful build of atom@master. The
master builds are stored in the [atom-master-builds][atom-master-builds] repo
as releases named by the SHA-1 built.
## Configuring a package
* Run `cd ~/github/my-package` to navigate to the package repo locally
* Run `apm test` to verify that the package currently builds via [apm][apm]
* Add the package repo to the [Travis CI team][travis-ci-team]
* Run `gem install travis` to install the [travis gem][travis-gem]
* Run `travis login --pro` and log in using the [atom-build][atom-build] user
and the password from the *Shared-Developers* folder in LastPass
* Run `apm ci` to add a `.travis.yml` file to the repo and to configure Travis
* Log into [Travis][travis-ci] as the `atom-build` user and you should now see
the package listed and building
[apm]: https://github.com/atom/apm
[build-package]: https://github.com/atom/apm/blob/master/script/build-package
[atom-build]: https://github.com/atom-build
[atom-master-builds]: https://github.com/atom/atom-master-builds/releases
[atom-org]: https://github.com/atom
[travis-ci]: https://magnum.travis-ci.com
[travis-ci-team]: https://github.com/organizations/atom/teams/596636
[travis-gem]: https://rubygems.org/gems/travis
[travis-pro]: http://about.travis-ci.org/docs/user/travis-pro
+117 -306
Ver Arquivo
@@ -1,334 +1,145 @@
# Creating Your First Package
# Create Your First Package
Let's take a look at creating your first package.
This tutorial will guide you though creating a simple command that replaces the
selected text with [ascii art](http://en.wikipedia.org/wiki/ASCII_art). When you
run our new command with the word "cool" selected, it will be replaced with:
To get started, hit `cmd-shift-P`, and start typing "Generate Package" to generate
a package. Once you select the "Generate Package" command, it'll ask you for a
name for your new package. Let's call ours _changer_.
Atom will pop open a new window, showing the _changer_ package with a default set of
folders and files created for us. Hit `cmd-shift-P` and start typing "Changer." You'll
see a new `Changer:Toggle` command which, if selected, pops up a greeting. So far,
so good!
In order to demonstrate the capabilities of Atom and its API, our Changer plugin
is going to do two things:
1. It'll show only modified files in the file tree
2. It'll append a new pane to the editor with some information about the modified
files
Let's get started!
## Changing Keybindings and Commands
Since Changer is primarily concerned with the file tree, let's write a
key binding that works only when the tree is focused. Instead of using the
default `toggle`, our keybinding executes a new command called `magic`.
_keymaps/changer.cson_ should change to look like this:
```coffeescript
'.tree-view':
'ctrl-V': 'changer:magic'
```
/\_ \
___ ___ ___\//\ \
/'___\ / __`\ / __`\\ \ \
/\ \__//\ \L\ \/\ \L\ \\_\ \_
\ \____\ \____/\ \____//\____\
\/____/\/___/ \/___/ \/____/
```
Notice that the keybinding is called `ctrl-V` &mdash; that's actually `ctrl-shift-v`.
You can use capital letters to denote using `shift` for your binding.
The final package can be viewed at
[https://github.com/atom/ascii-art](https://github.com/atom/ascii-art).
`.tree-view` represents the parent container for the tree view.
Keybindings only work within the context of where they're entered. In this case,
hitting `ctrl-V` anywhere other than tree won't do anything. Obviously, you can
bind to any part of the editor using element, id, or class names. For example,
you can map to `body` if you want to scope to anywhere in Atom, or just `.editor`
for the editor portion.
To begin, press `cmd-shift-P` to bring up the [Command
Palette](https://github.com/atom/command-palette). Type "generate package" and
select the "Package Generator: Generate Package" command. Now we need to name
the package. Let's call it _ascii-art_.
To bind keybindings to a command, we'll need to do a bit of association in our
CoffeeScript code using the `atom.workspaceView.command` method. This method takes a command
name and executes a callback function. Open up _lib/changer-view.coffee_, and
change `atom.workspaceView.command "changer:toggle"` to look like this:
Atom will open a new window with the contents of our new _ascii-art_ package
displayed in the Tree View. Because this window is opened **after** the package
is created, the ASCII Art package will be loaded and available in our new
window. To verify this, toggle the Command Palette (`cmd-shift-P`) and type
"ASCII Art" you'll see a new `ASCII Art: Toggle` command. When triggered, this
command displays a default message.
Now let's edit the package files to make our ascii art package do something
interesting. Since this package doesn't need any UI, we can remove all
view-related code. Start by opening up _lib/ascii-art.coffee_. Remove all view
code, so the file looks like this:
```coffeescript
atom.workspaceView.command "changer:magic", => @magic()
module.exports =
activate: ->
```
It's common practice to namespace your commands with your package name, separated
with a colon (`:`). Make sure to rename your `toggle` method to `magic` as well.
## Create a Command
Every time you reload the Atom editor, changes to your package code will be reevaluated,
just as if you were writing a script for the browser. Reload the editor, click on
the tree, hit your keybinding, and...nothing happens! What the heck?!
Now let's add a command. We recommend that you namespace your commands with the
package name followed by a `:`, so we'll call our command `ascii-art:convert`.
Register the command in _lib/ascii-art.coffee_:
Open up the _package.json_ file, and find the property called `activationEvents`.
Basically, this key tells Atom to not load a package until it hears a certain event.
Change the event to `changer:magic` and reload the editor:
```coffeescript
module.exports =
activate: ->
atom.workspaceView.command "ascii-art:convert", => @convert()
convert: ->
# This assumes the active pane item is an editor
editor = atom.workspace.activePaneItem
editor.insertText('Hello, World!')
```
The `atom.workspaceView.command` method takes a command name and a callback. The
callback executes when the command is triggered. In this case, when the command
is triggered the callback will call the `convert` method and insert 'Hello,
World!'.
## Reload the Package
Before we can trigger `ascii-art:convert`, we need to load the latest code for
our package by reloading the window. Run the command `window:reload` from the
command palette or by pressing `ctrl-alt-cmd-l`.
## Trigger the Command
Now open the command panel and search for the `ascii-art:convert` command. But
its not there! To fix this open _package.json_ and find the property called
`activationEvents`. Activation Events speed up load time by allowing an Atom to
delay a package's activation until it's needed. So add the `ascii-art:convert`
to the activationEvents array:
```json
"activationEvents": ["changer:magic"]
"activationEvents": ["ascii-art:convert"],
```
Hitting the key binding on the tree now works!
First, run reload the window by running the command `window:reload`. Now when
you run the `ascii-art:convert` command it will output 'Hello, World!'
## Working with Styles
## Add A Key Binding
The next step is to hide elements in the tree that aren't modified. To do that,
we'll first try and get a list of files that have not changed.
All packages are able to use jQuery in their code. In fact, there's [a list of
the bundled libraries Atom provides by default][bundled-libs].
We bring in jQuery by requiring the `atom` package and binding it to the `$` variable:
Now let's add a key binding to trigger the `ascii-art:convert` command. Open
_keymaps/ascii-art.cson_ and add a key binding linking `ctrl-alt-a` to the
`ascii-art:convert` command. When finished, the file will look like this:
```coffeescript
{$, View} = require 'atom'
'.editor':
'cmd-alt-a': 'ascii-art:convert'
```
Now, we can define the `magic` method to query the tree to get us a list of every
file that _wasn't_ modified:
Notice `.editor` on the first line. Just like CSS, keymap selectors *scope* key
bindings so they only apply to specific elements. In this case, our binding is
only active for elements matching the `.editor` selector. If the Tree View has
focus, pressing `cmd-alt-a` won't trigger the `ascii-art:convert` command. But
if the editor has focus, the `ascii-art:convert` method *will* be triggered.
More information on key bindings can be found in the
[keymaps](advanced/keymaps.html) documentation.
Now reload the window and verify that the key binding works! You can also verify
that it **doesn't** work when the Tree View is focused.
## Add the ASCII Art
Now we need to convert the selected text to ascii art. To do this we will use
the [figlet](https://npmjs.org/package/figlet) [node](http://nodejs.org/) module
from [npm](https://npmjs.org/). Open _package.json_ and add the latest version of
figlet to the dependencies:
```json
"dependencies": {
"figlet": "1.0.8"
}
```
After saving the file run the command 'update-package-dependencies:update' from
the Command Palette. This will install the packages node module dependencies,
only figlet in this case. You will need to run
'update-package-dependencies:update' whenever you update the dependencies field
in your _package.json_ file.
Now require the figlet node module in _lib/ascii-art.coffee_ and instead of
inserting 'Hello, World!' convert the selected text to ascii art!
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
console.log el
convert: ->
# This assumes the active pane item is an editor
editor = atom.workspace.activePaneItem
selection = editor.getSelection()
figlet = require 'figlet'
figlet selection.getText(), {font: "Larry 3D 2"}, (error, asciiArt) ->
if error
console.error(error)
else
selection.insertText("\n#{asciiArt}\n")
```
You can access the dev console by hitting `alt-cmd-i`. Here, you'll see all the
statements from `console` calls. When we execute the `changer:magic` command, the
browser console lists items that are not being modified (_i.e._, those without the
`status-modified` class). Let's add a class to each of these elements called `hide-me`:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
$(el).addClass("hide-me")
```
With our newly added class, we can manipulate the visibility of the elements
with a simple stylesheet. Open up _changer.css_ in the _stylesheets_ directory,
and add a single entry:
```css
ol.entries .hide-me {
display: none;
}
```
Refresh Atom, and run the `changer` command. You'll see all the non-changed
files disappear from the tree. Success!
![Changer_File_View]
There are a number of ways you can get the list back; let's just naively iterate
over the same elements and remove the class:
```coffeescript
magic: ->
$('ol.entries li').each (i, el) ->
if !$(el).hasClass("status-modified")
if !$(el).hasClass("hide-me")
$(el).addClass("hide-me")
else
$(el).removeClass("hide-me")
```
## Creating a New Panel
The next goal of this package is to append a panel to the Atom editor that lists
some information about the modified files.
To do that, we're going to first open up [the style guide][styleguide]. The Style
Guide lists every type of UI element that can be created by an Atom package. Aside
from helping you avoid writing fresh code from scratch, it ensures that packages
have the same look and feel no matter how they're built.
Every package that extends from the `View` class can provide an optional class
method called `content`. The `content` method constructs the DOM that your
package uses as its UI. The principals of `content` are built entirely on
[SpacePen][space-pen], which we'll touch upon only briefly here.
Our display will simply be an unordered list of the file names, and their
modified times. We'll append this list to a panel on the bottom of the editor. A
basic `panel` element inside a `tool-panel` will work well for us. Let's start by carving out a
`div` to hold the filenames:
```coffeescript
@content: ->
@div class: "changer tool-panel panel-bottom", =>
@div class: "panel", =>
@div class: "panel-heading", "Modified Files"
@div class: "panel-body padded", outlet: 'modifiedFilesContainer', =>
@ul class: 'modified-files-list', outlet: 'modifiedFilesList', =>
@li 'Modified File Test'
@li 'Modified File Test'
```
You can add any HTML attribute you like. `outlet` names the variable your
package can use to manipulate the element directly. The fat arrow (`=>`)
indicates that the next DOM set are nested children.
Once again, you can style `li` elements using your stylesheets. Let's test that
out by adding these lines to the _changer.css_ file:
```css
ul.modified-files-list {
color: white;
}
```
We'll add one more line to the end of the `magic` method to make this pane appear:
```coffeescript
atom.workspaceView.vertical.append(this)
```
If you refresh Atom and hit the key command, you'll see a box appear right underneath
the editor:
![Changer_Panel_Append]
As you might have guessed, `atom.workspaceView.vertical.append` tells Atom to append `this`
item (_i.e._, whatever is defined by`@content`) _vertically_ to the editor. If
we had called `atom.workspaceView.horizontal.append`, the pane would be attached to the
right-hand side of the editor.
Before we populate this panel for real, let's apply some logic to toggle the pane
off and on, just like we did with the tree view. Replace the `atom.workspaceView.vertical.append`
call with this code:
```coffeescript
# toggles the pane
if @hasParent()
atom.workspaceView.vertical.children().last().remove()
else
atom.workspaceView.vertical.append(this)
```
There are about a hundred different ways to toggle a pane on and off, and this
might not be the most efficient one. If you know your package needs to be
toggled on and off more freely, it might be better to draw the interface during the
initialization, then immediately call `hide()` on the element to remove it from
the view. You can then swap between `show()` and `hide()`, and instead of
forcing Atom to add and remove the element as we're doing here, it'll just set a
CSS property to control your package's visibility.
Refresh Atom, hit the key combo, and watch your test list appear and disappear.
## Calling Node.js Code
Since Atom is built on top of [Node.js][node], you can call any of its libraries,
including other modules that your package requires.
We'll iterate through our resulting tree, and construct the path to our modified
file based on its depth in the tree. We'll use Node to handle path joining for
directories.
Add the following Node module to the top of your file:
```coffeescript
path = require 'path'
```
Then, add these lines to your `magic` method, _before_ your pane drawing code:
```coffeescript
modifiedFiles = []
# for each single entry...
$('ol.entries li.file.status-modified span.name').each (i, el) ->
filePath = []
# ...grab its name...
filePath.unshift($(el).text())
# ... then find its parent directories, and grab their names
parents = $(el).parents('.directory.status-modified')
parents.each (i, el) ->
filePath.unshift($(el).find('div.header span.name').eq(0).text())
modifiedFilePath = path.join(atom.project.rootDirectory.path, filePath.join(path.sep))
modifiedFiles.push modifiedFilePath
```
`modifiedFiles` is an array containing a list of our modified files. We're also
using the node.js [`path` library][path] to get the proper directory separator
for our system.
Remove the two `@li` elements we added in `@content`, so that we can
populate our `modifiedFilesList` with real information. We'll do that by
iterating over `modifiedFiles`, accessing a file's last modified time, and
appending it to `modifiedFilesList`:
```coffeescript
# toggles the pane
if @hasParent()
atom.workspaceView.vertical.children().last().remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
atom.workspaceView.vertical.append(this)
```
When you toggle the modified files list, your pane is now populated with the
filenames and modified times of files in your project:
![Changer_Panel_Timestamps]
You might notice that subsequent calls to this command reduplicate information.
We could provide an elegant way of rechecking files already in the list, but for
this demonstration, we'll just clear the `modifiedFilesList` each time it's closed:
```coffeescript
# toggles the pane
if @hasParent()
@modifiedFilesList.empty() # added this to clear the list on close
atom.workspaceView.vertical.children().last().remove()
else
for file in modifiedFiles
stat = fs.lstatSync(file)
mtime = stat.mtime
@modifiedFilesList.append("<li>#{file} - Modified at #{mtime}")
atom.workspaceView.vertical.append(this)
```
## Coloring UI Elements
For packages that create new UI elements, adhering to the style guide is just one
part to keeping visual consistency. Packages dealing with color, fonts, padding,
margins, and other visual cues should rely on [Theme Variables][theme-vars], instead
of developing individual styles. Theme variables are variables defined by Atom
for use in packages and themes. They're only available in [`LESS`](http://lesscss.org/)
stylesheets.
For our package, let's remove the style defined by `ul.modified-files-list` in
_changer.css_. Create a new file under the _stylesheets_ directory called _text-colors.less_.
Here, we'll import the _ui-variables.less_ file, and define some Atom-specific
styles:
```less
@import "ui-variables";
ul.modified-files-list {
color: @text-color;
background-color: @background-color-info;
}
```
Using theme variables ensures that packages look great alongside any theme.
## Further reading
For more information on the mechanics of packages, check out
[Creating a Package][creating-a-package].
[bundled-libs]: creating-a-package.html#included-libraries
[styleguide]: https://github.com/atom/styleguide
[space-pen]: https://github.com/atom/space-pen
[node]: http://nodejs.org/
[path]: http://nodejs.org/docs/latest/api/path.html
[changer_file_view]: https://f.cloud.github.com/assets/69169/1441187/d7a7cb46-41a7-11e3-8128-d93f70a5d5c1.png
[changer_panel_append]: https://f.cloud.github.com/assets/69169/1441189/db0c74da-41a7-11e3-8286-b82dd9190c34.png
[changer_panel_timestamps]: https://f.cloud.github.com/assets/69169/1441190/dcc8eeb6-41a7-11e3-830f-1f1b33072fcd.png
[theme-vars]: theme-variables.html
[creating-a-package]: creating-a-package.html
For more information on the mechanics of packages, check out [Creating a
Package](creating-a-package.html)
+15
Ver Arquivo
@@ -0,0 +1,15 @@
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing `snip` and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
-44
Ver Arquivo
@@ -1,44 +0,0 @@
".source.coffee":
"Describe block":
prefix: "de"
body: """
describe "${1:description}", ->
${2:body}
"""
"It block":
prefix: "i"
body: """
it "$1", ->
$2
"""
"Before each":
prefix: "be"
body: """
beforeEach ->
$1
"""
"After each":
prefix: "af"
body: """
afterEach ->
$1
"""
"Expectation":
prefix: "ex"
body: "expect($1).to$2"
"Console log":
prefix: "log"
body: "console.log $1"
"Range array":
prefix: "ra"
body: "[[$1, $2], [$3, $4]]"
"Point array":
prefix: "pt"
body: "[$1, $2]"
"Key-value pair":
prefix: ":"
body: '${1:"${2:key}"}: ${3:value}'
"Create Jasmine spy":
prefix: "spy"
body: 'jasmine.createSpy("${1:description}")$2'
+18
Ver Arquivo
@@ -0,0 +1,18 @@
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*/
.tree-view {
}
.editor {
}
.editor .cursor {
}
-8
Ver Arquivo
@@ -1,8 +0,0 @@
/* User styles */
.tree-view {
}
.editor {
}
+4 -4
Ver Arquivo
@@ -1,11 +1,11 @@
{Document, Point, Range} = require 'telepath'
{Point, Range} = require 'text-buffer'
module.exports =
_: require 'underscore-plus'
BufferedNodeProcess: require '../src/buffered-node-process'
BufferedProcess: require '../src/buffered-process'
ConfigObserver: require '../src/config-observer'
Directory: require '../src/directory'
Document: Document
File: require '../src/file'
fs: require 'fs-plus'
Git: require '../src/git'
@@ -21,8 +21,8 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
module.exports.$$ = $$
module.exports.$$$ = $$$
module.exports.EditorView = require '../src/editor-view'
module.exports.WorkspaceView = require '../src/workspace-view'
module.exports.SelectList = require '../src/select-list'
module.exports.ScrollView = require '../src/scroll-view'
module.exports.SelectListView = require '../src/select-list-view'
module.exports.Task = require '../src/task'
module.exports.View = View
module.exports.WorkspaceView = require '../src/workspace-view'
+29 -8
Ver Arquivo
@@ -1,11 +1,11 @@
'.editor':
# Platform Bindings
'alt-left': 'editor:move-to-previous-word-boundary'
'alt-right': 'editor:move-to-next-word-boundary'
'alt-shift-left': 'editor:select-to-previous-word-boundary'
'alt-shift-right': 'editor:select-to-next-word-boundary'
'alt-left': 'editor:move-to-beginning-of-word'
'alt-right': 'editor:move-to-end-of-word'
'alt-shift-left': 'editor:select-to-beginning-of-word'
'alt-shift-right': 'editor:select-to-end-of-word'
'home': 'editor:move-to-first-character-of-line'
'end': 'editor:move-to-end-of-line'
'end': 'editor:move-to-end-of-screen-line'
'shift-home': 'editor:select-to-first-character-of-line'
'shift-end': 'editor:select-to-end-of-line'
@@ -24,9 +24,6 @@
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
'.tool-panel':
'escape': 'core:close'
'.tool-panel.panel-left, .tool-panel.panel-right':
'escape': 'tool-panel:unfocus'
@@ -41,6 +38,22 @@
'backspace': 'native!'
'shift-backspace': 'native!'
'delete': 'native!'
'up': 'native!'
'down': 'native!'
'shift-up': 'native!'
'shift-down': 'native!'
'alt-up': 'native!'
'alt-down': 'native!'
'alt-shift-up': 'native!'
'alt-shift-down': 'native!'
'cmd-up': 'native!'
'cmd-down': 'native!'
'cmd-shift-up': 'native!'
'cmd-shift-down': 'native!'
'ctrl-up': 'native!'
'ctrl-down': 'native!'
'ctrl-shift-up': 'native!'
'ctrl-shift-down': 'native!'
'left': 'native!'
'right': 'native!'
'shift-left': 'native!'
@@ -49,6 +62,14 @@
'alt-right': 'native!'
'alt-shift-left': 'native!'
'alt-shift-right': 'native!'
'cmd-left': 'native!'
'cmd-right': 'native!'
'cmd-shift-left': 'native!'
'cmd-shift-right': 'native!'
'ctrl-left': 'native!'
'ctrl-right': 'native!'
'ctrl-shift-left': 'native!'
'ctrl-shift-right': 'native!'
'ctrl-b': 'native!'
'ctrl-f': 'native!'
'ctrl-F': 'native!'
+10 -8
Ver Arquivo
@@ -1,8 +1,8 @@
'.platform-darwin':
'body':
# Apple specific
'cmd-q': 'application:quit'
'cmd-h': 'application:hide'
'cmd-H': 'application:hide-other-applications'
'cmd-alt-h': 'application:hide-other-applications'
'cmd-m': 'application:minimize'
'alt-cmd-ctrl-m': 'application:zoom'
@@ -26,7 +26,7 @@
'down': 'core:move-down'
'left': 'core:move-left'
'right': 'core:move-right'
'ctrl-alt-cmd-r': 'window:reload'
'ctrl-alt-cmd-l': 'window:reload'
'alt-cmd-i': 'window:toggle-dev-tools'
'cmd-alt-ctrl-p': 'window:run-package-specs'
@@ -87,19 +87,19 @@
'cmd-8': 'pane:show-item-8'
'cmd-9': 'pane:show-item-9'
'.platform-darwin .editor':
'.editor':
# Apple Specific
'cmd-backspace': 'editor:backspace-to-beginning-of-line'
'cmd-delete': 'editor:backspace-to-beginning-of-line'
'ctrl-A': 'editor:select-to-first-character-of-line'
'ctrl-E': 'editor:select-to-end-of-line'
'cmd-left': 'editor:move-to-first-character-of-line'
'cmd-right': 'editor:move-to-end-of-line'
'cmd-right': 'editor:move-to-end-of-screen-line'
'cmd-shift-left': 'editor:select-to-first-character-of-line'
'cmd-shift-right': 'editor:select-to-end-of-line'
'alt-backspace': 'editor:backspace-to-beginning-of-word'
'alt-delete': 'editor:delete-to-end-of-word'
'ctrl-a': 'editor:move-to-first-character-of-line'
'ctrl-a': 'editor:move-to-beginning-of-line'
'ctrl-e': 'editor:move-to-end-of-line'
'ctrl-k': 'editor:cut-to-end-of-line'
@@ -111,8 +111,9 @@
'cmd-alt-p': 'editor:log-cursor-scope'
'cmd-k cmd-u': 'editor:upper-case'
'cmd-k cmd-l': 'editor:lower-case'
'cmd-l': 'editor:select-line'
'body.platform-darwin .editor:not(.mini)':
'.workspace .editor:not(.mini)':
# Atom specific
'alt-cmd-z': 'editor:checkout-head-revision'
'cmd-<': 'editor:scroll-to-cursor'
@@ -129,6 +130,7 @@
'cmd-/': 'editor:toggle-line-comments'
'cmd-j': 'editor:join-line'
'cmd-D': 'editor:duplicate-line'
'cmd-L': 'editor:split-selections-into-lines'
'cmd-alt-[': 'editor:fold-current-row'
'cmd-alt-]': 'editor:unfold-current-row'
@@ -146,7 +148,7 @@
'cmd-k cmd-9': 'editor:fold-at-indent-level-9'
# allow standard input fields to work correctly
'body.platform-darwin .native-key-bindings':
'body .native-key-bindings':
'cmd-z': 'native!'
'cmd-Z': 'native!'
'cmd-x': 'native!'
+4 -4
Ver Arquivo
@@ -1,4 +1,4 @@
'.platform-win32':
'body':
# Atom Specific
'enter': 'core:confirm'
'escape': 'core:cancel'
@@ -50,7 +50,7 @@
'ctrl-k ctrl-left': 'window:focus-previous-pane'
'ctrl-k ctrl-right': 'window:focus-next-pane'
'.platform-win32 .editor':
'.workspace .editor':
# Windows specific
'ctrl-delete': 'editor:backspace-to-beginning-of-word'
@@ -60,7 +60,7 @@
'ctrl-k ctrl-u': 'editor:upper-case'
'ctrl-k ctrl-l': 'editor:lower-case'
'.platform-win32 .editor:not(.mini)':
'.workspace .editor:not(.mini)':
# Atom specific
'alt-ctrl-z': 'editor:checkout-head-revision'
'ctrl-<': 'editor:scroll-to-cursor'
@@ -94,7 +94,7 @@
'ctrl-k ctrl-9': 'editor:fold-at-indent-level-9'
# allow standard input fields to work correctly
'.platform-win32 input:not(.hidden-input), .platform-win32 .native-key-bindings':
'body .native-key-bindings':
'ctrl-z': 'native!'
'ctrl-Z': 'native!'
'ctrl-x': 'native!'
+7 -17
Ver Arquivo
@@ -7,6 +7,12 @@
{ label: "Install update", command: 'application:install-update', visible: false }
{ type: 'separator' }
{ label: 'Preferences...', command: 'application:show-settings' }
{ label: 'Open Your Config', command: 'application:open-your-config' }
{ 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: 'Install Shell Commands', command: 'window:install-shell-commands' }
{ type: 'separator' }
{ label: 'Hide Atom', command: 'application:hide' }
{ label: 'Hide Others', command: 'application:hide-other-applications' }
@@ -99,6 +105,7 @@
submenu: [
{ label: 'Add Selection Above', command: 'editor:add-selection-above' }
{ label: 'Add Selection Below', command: 'editor:add-selection-below' }
{ label: 'Split into Lines', command: 'editor:split-selections-into-lines'}
{ type: 'separator' }
{ label: 'Select to Top', command: 'core:select-to-top' }
{ label: 'Select to Bottom', command: 'core:select-to-bottom' }
@@ -113,23 +120,6 @@
]
}
{
label: 'Movement'
submenu: [
{ label: 'Move to Top', command: 'core:move-to-top' }
{ label: 'Move to Bottom', command: 'core:move-to-bottom' }
{ type: 'separator' }
{ label: 'Move to Beginning of Line', command: 'editor:move-to-beginning-of-line' }
{ label: 'Move to First Character of Line', command: 'editor:move-to-first-character-of-line' }
{ label: 'Move to End of Line', command: 'editor:move-to-end-of-line' }
{ type: 'separator' }
{ label: 'Move to Beginning of Word', command: 'editor:move-to-beginning-of-word' }
{ label: 'Move to End of Word', command: 'editor:move-to-end-of-word' }
{ label: 'Move to Next Word', command: 'editor:move-to-next-word-boundary' }
{ label: 'Move to Previous Word', command: 'editor:move-to-previous-word-boundary' }
]
}
{
label: 'Find'
submenu: []
+1 -17
Ver Arquivo
@@ -106,6 +106,7 @@
submenu: [
{ label: 'Add Selection &Above', command: 'editor:add-selection-above' }
{ label: 'Add Selection &Below', command: 'editor:add-selection-below' }
{ label: 'S&plit into Lines', command: 'editor:split-selections-into-lines'}
{ type: 'separator' }
{ label: 'Select to &Top', command: 'core:select-to-top' }
{ label: 'Select to Botto&m', command: 'core:select-to-bottom' }
@@ -120,23 +121,6 @@
]
}
{
label: '&Movement'
submenu: [
{ label: 'Move to &Top', command: 'core:move-to-top' }
{ label: 'Move to &Bottom', command: 'core:move-to-bottom' }
{ type: 'separator' }
{ label: 'Move to Beginning of &Line', command: 'editor:move-to-beginning-of-line' }
{ label: 'Move to &First Character of Line', command: 'editor:move-to-first-character-of-line' }
{ label: 'Move to &End of Line', command: 'editor:move-to-end-of-line' }
{ type: 'separator' }
{ label: 'Move to Beginning of &Word', command: 'editor:move-to-beginning-of-word' }
{ label: 'Move to End of Wor&d', command: 'editor:move-to-end-of-word' }
{ label: 'Move to &Next Word', command: 'editor:move-to-next-word-boundary' }
{ label: 'Move to &Previous Word', command: 'editor:move-to-previous-word-boundary' }
]
}
{
label: 'F&ind'
submenu: []
+90 -103
Ver Arquivo
@@ -1,6 +1,7 @@
{
"name": "atom",
"version": "0.41.0",
"productName": "Atom",
"version": "0.49.0",
"main": "./src/browser/main.js",
"repository": {
"type": "git",
@@ -15,119 +16,106 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.7.4",
"atomShellVersion": "0.8.7",
"dependencies": {
"async": "0.2.6",
"bootstrap": "git://github.com/benogle/bootstrap.git",
"bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.2.0",
"coffee-script": "1.6.3",
"coffeestack": "0.6.0",
"emissary": "0.19.0",
"first-mate": "0.5.0",
"fs-plus": "0.10.0",
"fuzzaldrin": "0.1.0",
"git-utils": "0.29.0",
"guid": "0.0.10",
"jasmine-focused": "~0.15.0",
"mkdirp": "0.3.5",
"less-cache": "0.10.0",
"nslog": "0.1.0",
"oniguruma": "0.24.0",
"optimist": "0.4.0",
"pathwatcher": "0.10.0",
"pegjs": "0.7.0",
"q": "0.9.7",
"scandal": "0.8.0",
"season": "0.14.0",
"semver": "1.1.4",
"space-pen": "2.0.1",
"telepath": "0.45.1",
"temp": "0.5.0",
"underscore-plus": "0.3.0"
},
"devDependencies": {
"biscotto": "0.0.17",
"formidable": "~1.0.14",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
"delegato": "1.x",
"emissary": "1.x",
"first-mate": ">=1.1 <2.0",
"fs-plus": "1.x",
"fstream": "0.1.24",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git://github.com/atom/grunt-coffeelint.git",
"grunt-lesslint": "0.13.0",
"grunt-cson": "0.5.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-less": "~0.8.0",
"walkdir": "0.0.7",
"js-yaml": "~2.1.0",
"grunt-markdown": "~0.4.0",
"json-front-matter": "~0.1.3",
"grunt-shell": "~0.3.1",
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
"jasmine-tagged": "0.2.0",
"request": "~2.27.0",
"unzip": "~0.1.9",
"rcedit": "~0.1.2",
"rimraf": "~2.2.2"
"fuzzaldrin": "1.x",
"git-utils": "0.34.0",
"guid": "0.0.10",
"jasmine-tagged": "1.x",
"mkdirp": "0.3.5",
"keytar": "0.15.1",
"less-cache": "0.11.0",
"mixto": "1.x",
"nslog": "0.4.0",
"oniguruma": "1.x",
"optimist": "0.4.0",
"pathwatcher": "0.14.2",
"pegjs": "0.8.0",
"property-accessors": "1.x",
"q": "0.9.7",
"scandal": "0.13.0",
"season": "1.x",
"semver": "1.1.4",
"serializable": "1.x",
"space-pen": "3.1.1",
"temp": "0.5.0",
"text-buffer": "0.16.0",
"theorist": "1.x",
"underscore-plus": "1.x",
"vm-compatibility-layer": "0.1.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.6.0",
"atom-dark-ui": "0.11.0",
"atom-light-syntax": "0.6.0",
"atom-light-ui": "0.13.0",
"base16-tomorrow-dark-theme": "0.6.0",
"solarized-dark-syntax": "0.4.0",
"archive-view": "0.16.0",
"autocomplete": "0.18.0",
"autoflow": "0.11.0",
"autosave": "0.9.0",
"bookmarks": "0.15.0",
"bracket-matcher": "0.15.0",
"command-logger": "0.8.0",
"command-palette": "0.11.0",
"dev-live-reload": "0.18.0",
"editor-stats": "0.8.0",
"exception-reporting": "0.8.0",
"feedback": "0.12.0",
"find-and-replace": "0.55.0",
"fuzzy-finder": "0.27.0",
"gists": "0.12.0",
"git-diff": "0.19.0",
"github-sign-in": "0.14.0",
"go-to-line": "0.12.0",
"grammar-selector": "0.13.0",
"image-view": "0.10.0",
"keybinding-resolver": "0.6.0",
"link": "0.11.0",
"markdown-preview": "0.22.0",
"metrics": "0.12.0",
"package-generator": "0.23.0",
"release-notes": "0.14.0",
"settings-view": "0.49.0",
"snippets": "0.17.0",
"spell-check": "0.17.0",
"status-bar": "0.23.0",
"styleguide": "0.17.0",
"symbols-view": "0.27.0",
"tabs": "0.15.0",
"terminal": "0.23.0",
"timecop": "0.11.0",
"to-the-hubs": "0.15.0",
"tree-view": "0.42.0",
"atom-dark-syntax": "0.12.0",
"atom-dark-ui": "0.21.0",
"atom-light-syntax": "0.12.0",
"atom-light-ui": "0.20.0",
"base16-tomorrow-dark-theme": "0.10.0",
"solarized-dark-syntax": "0.8.0",
"solarized-light-syntax": "0.4.0",
"archive-view": "0.21.0",
"autocomplete": "0.21.0",
"autoflow": "0.12.0",
"autosave": "0.10.0",
"background-tips": "0.5.0",
"bookmarks": "0.18.0",
"bracket-matcher": "0.19.0",
"command-logger": "0.10.0",
"command-palette": "0.15.0",
"dev-live-reload": "0.23.0",
"editor-stats": "0.12.0",
"exception-reporting": "0.13.0",
"feedback": "0.22.0",
"find-and-replace": "0.81.0",
"fuzzy-finder": "0.32.0",
"gists": "0.15.0",
"git-diff": "0.23.0",
"github-sign-in": "0.18.0",
"go-to-line": "0.16.0",
"grammar-selector": "0.18.0",
"image-view": "0.17.0",
"keybinding-resolver": "0.9.0",
"link": "0.15.0",
"markdown-preview": "0.25.1",
"metrics": "0.24.0",
"package-generator": "0.25.0",
"release-notes": "0.17.0",
"settings-view": "0.63.0",
"snippets": "0.24.0",
"spell-check": "0.21.0",
"status-bar": "0.32.0",
"styleguide": "0.22.0",
"symbols-view": "0.30.0",
"tabs": "0.18.0",
"terminal": "0.27.0",
"timecop": "0.13.0",
"to-the-hubs": "0.18.0",
"tree-view": "0.65.0",
"update-package-dependencies": "0.2.0",
"visual-bell": "0.6.0",
"welcome": "0.3.0",
"welcome": "0.4.0",
"whitespace": "0.10.0",
"wrap-guide": "0.8.0",
"wrap-guide": "0.12.0",
"language-c": "0.2.0",
"language-clojure": "0.1.0",
"language-coffee-script": "0.3.0",
"language-coffee-script": "0.6.0",
"language-css": "0.2.0",
"language-gfm": "0.9.0",
"language-gfm": "0.12.0",
"language-git": "0.3.0",
"language-go": "0.2.0",
"language-html": "0.2.0",
"language-hyperlink": "0.3.0",
"language-java": "0.2.0",
"language-javascript": "0.3.0",
"language-javascript": "0.5.0",
"language-json": "0.2.0",
"language-less": "0.1.0",
"language-make": "0.1.0",
@@ -135,12 +123,12 @@
"language-objective-c": "0.2.0",
"language-pegjs": "0.1.0",
"language-perl": "0.2.0",
"language-php": "0.2.0",
"language-php": "0.3.0",
"language-property-list": "0.2.0",
"language-puppet": "0.2.0",
"language-python": "0.2.0",
"language-ruby": "0.5.0",
"language-ruby-on-rails": "0.3.0",
"language-ruby": "0.8.0",
"language-ruby-on-rails": "0.4.0",
"language-sass": "0.3.0",
"language-shellscript": "0.2.0",
"language-source": "0.2.0",
@@ -149,8 +137,7 @@
"language-todo": "0.2.0",
"language-toml": "0.7.0",
"language-xml": "0.2.0",
"language-yaml": "0.1.0",
"grunt-download-atom-shell": "0.1.1"
"language-yaml": "0.1.0"
},
"private": true,
"scripts": {
Arquivo executável → Arquivo normal
BIN
Ver Arquivo
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 52 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 48 KiB

Arquivo binário não exibido.
Arquivo binário não exibido.
+18 -10
Ver Arquivo
@@ -1,5 +1,6 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var fs = require('fs');
var path = require('path');
// OAuth token for atom-bot
@@ -22,21 +23,28 @@ function executeCommands(commands, done, index) {
done(null);
}
// Join multiple commands into one line.
function joinCommands() {
var commandSeparator = process.platform == 'win32' ? '&' : ';';
return Array.prototype.slice.call(arguments, 0).join(commandSeparator);
}
var apmVendorPath = path.resolve(__dirname, '..', 'vendor', 'apm');
var apmInstallPath = path.resolve(__dirname, '..', 'apm');
if (!fs.existsSync(apmInstallPath))
fs.mkdirSync(apmInstallPath);
if (!fs.existsSync(path.join(apmInstallPath, 'node_modules')))
fs.mkdirSync(path.join(apmInstallPath, 'node_modules'));
var apmFlags = process.env.JANKY_SHA1 || process.argv.indexOf('--no-color') !== -1 ? '--no-color' : '';
var packagesToDedupe = ['fs-plus', 'humanize-plus', 'nan', 'oniguruma', 'roaster', 'season'];
var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
{command: joinCommands('cd vendor/apm', 'npm install --silent .'), options: {ignoreStdout: true}},
{command: 'npm install --silent vendor/apm', options: {ignoreStdout: true}},
{command: 'npm install --quiet', options: {cwd: path.resolve(__dirname, '..', 'build'), ignoreStdout: true}},
{command: 'npm install --quiet', options: {cwd: apmVendorPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {cwd: apmInstallPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {ignoreStdout: true}},
{command: 'node ../../apm/node_modules/atom-package-manager/bin/apm rebuild', options: {cwd: path.resolve('node_modules', 'atom-package-manager'), ignoreStdout: true}},
echoNewLine,
'node node_modules/atom-package-manager/bin/apm clean',
'node node_modules/atom-package-manager/bin/apm install --silent',
'node apm/node_modules/atom-package-manager/bin/apm clean ' + apmFlags,
'node apm/node_modules/atom-package-manager/bin/apm install --quiet ' + apmFlags,
'node apm/node_modules/atom-package-manager/bin/apm dedupe --quiet ' + apmFlags + ' ' + packagesToDedupe.join(' '),
];
process.chdir(path.dirname(__dirname));
+6 -5
Ver Arquivo
@@ -1,12 +1,13 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
process.chdir(path.dirname(__dirname));
cp.safeExec('node script/bootstrap', function() {
// node node_modules/grunt-cli/bin/grunt "$@"
var gruntPath = path.join('node_modules', 'grunt-cli', 'bin', 'grunt');
var args = [gruntPath].concat(process.argv.slice(2));
cp.safeSpawn(process.execPath, args, process.exit);
// build/node_modules/.bin/grunt "$@"
var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(gruntPath, args, process.exit);
});
+16 -11
Ver Arquivo
@@ -1,20 +1,18 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var fs = require('fs');
var path = require('path');
process.chdir(path.dirname(__dirname));
if (process.platform != 'darwin')
throw new Error('cibuild can not run on ' + process.platform + ' yet!');
if (process.platform == 'linux')
throw new Error('cibuild can not run on linux yet!');
var homeDir = process.platform == 'win32' ? process.env.USERPROFILE : process.env.HOME;
function readEnvironmentVariables() {
var credentialsPath = '/var/lib/jenkins/config/atomcredentials';
function loadEnvironmentVariables(filePath) {
try {
var credentials = fs.readFileSync(credentialsPath, 'utf8');
var lines = credentials.trim().split('\n');
var lines = fs.readFileSync(filePath, 'utf8').trim().split('\n');
for (i in lines) {
var parts = lines[i].split('=');
var key = parts[0].trim();
@@ -24,16 +22,23 @@ function readEnvironmentVariables() {
} catch(error) { }
}
function readEnvironmentVariables() {
loadEnvironmentVariables('/var/lib/jenkins/config/atomcredentials')
loadEnvironmentVariables('/var/lib/jenkins/config/xcodekeychain')
}
readEnvironmentVariables();
cp.safeExec.bind(global, 'node script/bootstrap', function(error) {
if (error)
process.exit(1);
require('fs-plus').removeSync.bind(global, path.join(homeDir, '.atom'))
var async = require('async');
async.series([
require('rimraf').bind(global, path.join(homeDir, '.atom')),
var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var tasks = [
cp.safeExec.bind(global, 'git clean -dff'),
cp.safeExec.bind(global, 'node node_modules/grunt-cli/bin/grunt ci --stack --no-color'),
], function(error) {
cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color'),
]
async.series(tasks, function(error) {
process.exit(error ? 1 : 0);
});
})();
Arquivo executável
+37
Ver Arquivo
@@ -0,0 +1,37 @@
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
var os = require('os');
var removeCommand = process.platform === 'win32' ? 'del /F /Q /S ' : 'rm -rf ';
var productName = require('../package.json').productName;
process.chdir(path.dirname(__dirname));
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
var tmpdir = process.platform === 'win32' ? os.tmpdir() : '/tmp';
// Windows: Use START as a way to ignore error if Atom.exe isnt running
var killatom = process.platform === 'win32' ? 'START taskkill /F /IM ' + productName + '.exe' : 'pkill -9 ' + productName + ' || true';
var commands = [
killatom,
[__dirname, '..', 'node_modules'],
[__dirname, '..', 'build', 'node_modules'],
[__dirname, '..', 'apm', 'node_modules'],
[__dirname, '..', 'vendor', 'apm', 'node_modules'],
[__dirname, '..', 'atom-shell'],
[home, '.atom', '.node-gyp'],
[home, '.atom', 'storage'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
[tmpdir, 'atom-compile-cache'],
];
var run = function() {
var next = commands.shift();
if (!next)
process.exit(0);
if (Array.isArray(next))
next = removeCommand + path.resolve.apply(path.resolve, next);
cp.safeExec(next, run);
};
run();
+5
Ver Arquivo
@@ -0,0 +1,5 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\clean" %*
) ELSE (
node "%~dp0\clean" %*
)
-15
Ver Arquivo
@@ -1,15 +0,0 @@
#!/bin/sh
set -ex
# This entire file is a hack so that constructicon can build Atom via
# xcode
cd "$(dirname "$0")/../.."
rm -fr node_modules
./script/bootstrap
./node_modules/.bin/grunt --no-color --build-dir="$BUILT_PRODUCTS_DIR" deploy
echo "TARGET_BUILD_DIR=$BUILT_PRODUCTS_DIR"
echo "FULL_PRODUCT_NAME=Atom.app"
echo "PRODUCT_NAME=Atom"
-8
Ver Arquivo
@@ -1,8 +0,0 @@
#!/bin/sh
set -ex
cd "$(dirname "$0")/../.."
export PATH="atom-shell/Atom.app/Contents/Resources/:${PATH}"
rm -rf atom.xcodeproj
gyp --depth=. atom.gyp
+18
Ver Arquivo
@@ -0,0 +1,18 @@
@echo off
set USAGE=Usage: %0 source destination
if [%1] == [] (
echo %USAGE%
exit 1
)
if [%2] == [] (
echo %USAGE%
exit 2
)
:: rm -rf %2
if exist %2 rmdir %2 /s /q
:: cp -rf %1 %2
xcopy %1 %2 /e /h /c /i /y /r
+23
Ver Arquivo
@@ -0,0 +1,23 @@
@echo off
set USAGE=Usage: %0 source name-on-desktop
if [%1] == [] (
echo %USAGE%
exit 1
)
if [%2] == [] (
echo %USAGE%
exit 2
)
set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\%2.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = %1 >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%
Arquivo executável
+9
Ver Arquivo
@@ -0,0 +1,9 @@
#!/usr/bin/env node --harmony_collections
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
// node build/node_modules/.bin/grunt "$@"
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(gruntPath, args, process.exit);
Arquivo executável
+10
Ver Arquivo
@@ -0,0 +1,10 @@
#!/usr/bin/env coffee
path = require 'path'
CommandInstaller = require '../src/command-installer'
callback = (error) ->
console.warn error.message if error?
CommandInstaller.installAtomCommand(path.resolve(__dirname, '..'), callback)
CommandInstaller.installApmCommand(path.resolve(__dirname, '..'), callback)
+1 -1
Ver Arquivo
@@ -3,11 +3,11 @@
set -e
BUILT_PRODUCTS_DIR=$1
VERSION=$2
PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Info.plist"
HELPER_PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist"
# Update version
VERSION=$(git rev-parse --short HEAD | tr -d "\n")
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$HELPER_PLIST_PATH"
+3 -2
Ver Arquivo
@@ -1,9 +1,10 @@
#!/usr/bin/env node
#!/usr/bin/env node --harmony_collections
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var path = require('path');
process.chdir(path.dirname(__dirname));
safeExec('node script/bootstrap', function() {
safeExec('node node_modules/grunt-cli/bin/grunt ci --stack --no-color', process.exit);
var gruntPath = path.join('node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
safeExec(gruntPath + ' ci --stack --no-color', process.exit);
});
+1 -1
Ver Arquivo
@@ -24,7 +24,7 @@ fs.createReadStream(fontSrc).pipe(fs.createWriteStream(fontDest))
# Update Octicon UTF codes
glyphsSrc = path.join(pathToOcticons, 'data', 'glyphs.yml')
octiconUtfDest = path.join atomDir, 'static', 'octicon-utf-codes.less'
octiconUtfDest = path.join atomDir, 'static', 'variables', 'octicon-utf-codes.less'
output = []
for {css, code} in YAML.load(fs.readFileSync(glyphsSrc).toString())
output.push "@#{css}: \"\\#{code}\";"
+8
Ver Arquivo
@@ -438,3 +438,11 @@ describe "the `atom` global", ->
expect(atom.config.get('core.themes')).not.toContain packageName
expect(atom.config.get('core.themes')).not.toContain packageName
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
describe ".isReleasedVersion()", ->
it "returns false if the version is a SHA and true otherwise", ->
version = '0.1.0'
spyOn(atom.constructor, 'getVersion').andCallFake -> version
expect(atom.isReleasedVersion()).toBe true
version = '36b5518'
expect(atom.isReleasedVersion()).toBe false
+14 -16
Ver Arquivo
@@ -4,33 +4,31 @@ temp = require 'temp'
installer = require '../src/command-installer'
describe "install(commandPath, callback)", ->
directory = path.join(temp.dir, 'install-atom-command', 'atom')
commandPath = path.join(directory, 'source')
destinationPath = path.join(directory, 'bin', 'source')
commandFilePath = temp.openSync("atom-command").path
commandName = path.basename(commandFilePath)
installationPath = temp.mkdirSync("atom-bin")
installationFilePath = path.join(installationPath, commandName)
beforeEach ->
spyOn(installer, 'findInstallDirectory').andCallFake (callback) ->
callback(directory)
fs.removeSync(directory) if fs.existsSync(directory)
spyOn(installer, 'getInstallDirectory').andReturn installationPath
describe "on #darwin", ->
it "symlinks the command and makes it executable", ->
fs.writeFileSync(commandPath, 'test')
expect(fs.isFileSync(commandPath)).toBeTruthy()
expect(fs.isExecutableSync(commandPath)).toBeFalsy()
expect(fs.isFileSync(destinationPath)).toBeFalsy()
expect(fs.isFileSync(commandFilePath)).toBeTruthy()
expect(fs.isExecutableSync(commandFilePath)).toBeFalsy()
expect(fs.isFileSync(installationFilePath)).toBeFalsy()
installDone = false
installError = null
installer.install commandPath, (error) ->
installer.install commandFilePath, (error) ->
installDone = true
installError = error
waitsFor -> installDone
waitsFor ->
installDone
runs ->
expect(installError).toBeNull()
expect(fs.isFileSync(destinationPath)).toBeTruthy()
expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath)
expect(fs.isExecutableSync(destinationPath)).toBeTruthy()
expect(fs.isFileSync(installationFilePath)).toBeTruthy()
expect(fs.realpathSync(installationFilePath)).toBe fs.realpathSync(commandFilePath)
expect(fs.isExecutableSync(installationFilePath)).toBeTruthy()
+10 -10
Ver Arquivo
@@ -108,10 +108,10 @@ describe "Config", ->
expect(atom.config.getPositiveInt('editor.preferredLineLength', 80)).toBe 80
describe ".save()", ->
nodeFs = require 'fs'
CSON = require 'season'
beforeEach ->
spyOn(nodeFs, 'writeFileSync')
spyOn(CSON, 'writeFileSync')
jasmine.unspy atom.config, 'save'
describe "when ~/.atom/config.json exists", ->
@@ -122,12 +122,12 @@ describe "Config", ->
atom.config.set("x.y.z", 3)
atom.config.setDefaults("a.b", e: 4, f: 5)
nodeFs.writeFileSync.reset()
CSON.writeFileSync.reset()
atom.config.save()
expect(nodeFs.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.json"))
writtenConfig = JSON.parse(nodeFs.writeFileSync.argsForCall[0][1])
expect(writtenConfig).toEqual atom.config.settings
expect(CSON.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.json"))
writtenConfig = CSON.writeFileSync.argsForCall[0][1]
expect(writtenConfig).toBe atom.config.settings
describe "when ~/.atom/config.json doesn't exist", ->
it "writes any non-default properties to ~/.atom/config.cson", ->
@@ -137,12 +137,12 @@ describe "Config", ->
atom.config.set("x.y.z", 3)
atom.config.setDefaults("a.b", e: 4, f: 5)
nodeFs.writeFileSync.reset()
CSON.writeFileSync.reset()
atom.config.save()
expect(nodeFs.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.cson"))
expect(CSON.writeFileSync.argsForCall[0][0]).toBe(path.join(atom.config.configDirPath, "atom.config.cson"))
CoffeeScript = require 'coffee-script'
writtenConfig = CoffeeScript.eval(nodeFs.writeFileSync.argsForCall[0][1], bare: true)
writtenConfig = CSON.writeFileSync.argsForCall[0][1]
expect(writtenConfig).toEqual atom.config.settings
describe ".setDefaults(keyPath, defaults)", ->
@@ -218,7 +218,7 @@ describe "Config", ->
runs ->
expect(fs.existsSync(atom.config.configDirPath)).toBeTruthy()
expect(fs.existsSync(path.join(atom.config.configDirPath, 'packages'))).toBeTruthy()
expect(fs.existsSync(path.join(atom.config.configDirPath, 'snippets'))).toBeTruthy()
expect(fs.isFileSync(path.join(atom.config.configDirPath, 'snippets.cson'))).toBeTruthy()
expect(fs.isFileSync(path.join(atom.config.configDirPath, 'config.cson'))).toBeTruthy()
describe ".loadUserConfig()", ->
+15 -1
Ver Arquivo
@@ -68,7 +68,7 @@ describe "Directory", ->
describe "on #darwin or #linux", ->
it "includes symlink information about entries", ->
entries = directory.getEntries()
entries = directory.getEntriesSync()
for entry in entries
name = entry.getBaseName()
if name is 'symlink-to-dir' or name is 'symlink-to-file'
@@ -76,6 +76,20 @@ describe "Directory", ->
else
expect(entry.symlink).toBeFalsy()
callback = jasmine.createSpy('getEntries')
directory.getEntries(callback)
waitsFor -> callback.callCount is 1
runs ->
entries = callback.mostRecentCall.args[1]
for entry in entries
name = entry.getBaseName()
if name is 'symlink-to-dir' or name is 'symlink-to-file'
expect(entry.symlink).toBeTruthy()
else
expect(entry.symlink).toBeFalsy()
describe ".relativize(path)", ->
describe "on #darwin or #linux", ->
it "returns a relative path based on the directory's path", ->
+8 -13
Ver Arquivo
@@ -15,19 +15,6 @@ describe "DisplayBuffer", ->
displayBuffer.destroy()
buffer.release()
describe "@deserialize(state)", ->
it "constructs a display buffer with the same buffer, folds, editorWidthInChars, and tabLength", ->
displayBuffer.setTabLength(4)
displayBuffer.setEditorWidthInChars(64)
displayBuffer.createFold(2, 4)
displayBuffer2 = atom.deserializers.deserialize(displayBuffer.serialize())
expect(displayBuffer2.id).toBe displayBuffer.id
expect(displayBuffer2.buffer).toBe displayBuffer.buffer
expect(displayBuffer2.tokenizedBuffer.buffer).toBe displayBuffer.tokenizedBuffer.buffer
expect(displayBuffer2.isFoldedAtBufferRow(2)).toBeTruthy()
expect(displayBuffer2.getSoftWrapColumn()).toBe displayBuffer.getSoftWrapColumn()
expect(displayBuffer2.getTabLength()).toBe displayBuffer.getTabLength()
describe ".copy()", ->
it "creates a new DisplayBuffer with the same initial state", ->
marker1 = displayBuffer.markBufferRange([[1, 2], [3, 4]], id: 1)
@@ -103,6 +90,14 @@ describe "DisplayBuffer", ->
expect(displayBuffer.lineForRow(3).text).toBe ' var pivot = items.shift(), current, left = [], '
expect(displayBuffer.lineForRow(4).text).toBe 'right = [];'
describe "when there are hard tabs", ->
beforeEach ->
buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t'))
it "correctly tokenizes the hard tabs", ->
expect(displayBuffer.lineForRow(3).tokens[0].isHardTab).toBeTruthy()
expect(displayBuffer.lineForRow(3).tokens[1].isHardTab).toBeTruthy()
describe "when the buffer changes", ->
describe "when buffer lines are updated", ->
describe "when whitespace is added after the max line length", ->
+137 -14
Ver Arquivo
@@ -21,20 +21,21 @@ describe "Editor", ->
buffer = editor.buffer
lineLengths = buffer.getLines().map (line) -> line.length
describe "@deserialize(state)", ->
describe "when the editor is deserialized", ->
it "restores selections and folds based on markers in the buffer", ->
editor.setSelectedBufferRange([[1, 2], [3, 4]])
editor.addSelectionForBufferRange([[5, 6], [7, 5]], isReversed: true)
editor.foldBufferRow(4)
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
editor2 = atom.deserializers.deserialize(editor.serialize())
editor2 = editor.testSerialization()
expect(editor2.id).toBe editor.id
expect(editor2.getBuffer().getPath()).toBe editor.getBuffer().getPath()
expect(editor2.getSelectedBufferRanges()).toEqual [[[1, 2], [3, 4]], [[5, 6], [7, 5]]]
expect(editor2.getSelection(1).isReversed()).toBeTruthy()
expect(editor2.isFoldedAtBufferRow(4)).toBeTruthy()
editor2.destroy()
describe ".copy()", ->
it "returns a different edit session with the same initial state", ->
@@ -101,6 +102,16 @@ describe "Editor", ->
lastCursor = editor.addCursorAtScreenPosition([2, 0])
expect(editor.getCursor()).toBe lastCursor
describe "when the cursor moves", ->
it "clears a goal column established by vertical movement", ->
editor.setText('b')
editor.setCursorBufferPosition([0,0])
editor.insertNewline()
editor.moveCursorUp()
editor.insertText('a')
editor.moveCursorDown()
expect(editor.getCursorBufferPosition()).toEqual [1, 1]
describe ".setCursorScreenPosition(screenPosition)", ->
it "clears a goal column established by vertical movement", ->
# set a goal column by moving down
@@ -347,13 +358,13 @@ describe "Editor", ->
expect(editor.getCursors().length).toBe 1
expect(editor.getCursorBufferPosition()).toEqual [12,2]
describe ".moveCursorToBeginningOfLine()", ->
describe ".moveCursorToBeginningOfScreenLine()", ->
describe "when soft wrap is on", ->
it "moves cursor to the beginning of the screen line", ->
editor.setSoftWrap(true)
editor.setEditorWidthInChars(10)
editor.setCursorScreenPosition([1, 2])
editor.moveCursorToBeginningOfLine()
editor.moveCursorToBeginningOfScreenLine()
cursor = editor.getCursor()
expect(cursor.getScreenPosition()).toEqual [1, 0]
@@ -361,19 +372,19 @@ describe "Editor", ->
it "moves cursor to the beginning of then line", ->
editor.setCursorScreenPosition [0,5]
editor.addCursorAtScreenPosition [1,7]
editor.moveCursorToBeginningOfLine()
editor.moveCursorToBeginningOfScreenLine()
expect(editor.getCursors().length).toBe 2
[cursor1, cursor2] = editor.getCursors()
expect(cursor1.getBufferPosition()).toEqual [0,0]
expect(cursor2.getBufferPosition()).toEqual [1,0]
describe ".moveCursorToEndOfLine()", ->
describe ".moveCursorToEndOfScreenLine()", ->
describe "when soft wrap is on", ->
it "moves cursor to the beginning of the screen line", ->
editor.setSoftWrap(true)
editor.setEditorWidthInChars(10)
editor.setCursorScreenPosition([1, 2])
editor.moveCursorToEndOfLine()
editor.moveCursorToEndOfScreenLine()
cursor = editor.getCursor()
expect(cursor.getScreenPosition()).toEqual [1, 9]
@@ -381,12 +392,30 @@ describe "Editor", ->
it "moves cursor to the end of line", ->
editor.setCursorScreenPosition [0,0]
editor.addCursorAtScreenPosition [1,0]
editor.moveCursorToEndOfLine()
editor.moveCursorToEndOfScreenLine()
expect(editor.getCursors().length).toBe 2
[cursor1, cursor2] = editor.getCursors()
expect(cursor1.getBufferPosition()).toEqual [0,29]
expect(cursor2.getBufferPosition()).toEqual [1,30]
describe ".moveCursorToBeginningOfLine()", ->
it "moves cursor to the beginning of the buffer line", ->
editor.setSoftWrap(true)
editor.setEditorWidthInChars(10)
editor.setCursorScreenPosition([1, 2])
editor.moveCursorToBeginningOfLine()
cursor = editor.getCursor()
expect(cursor.getScreenPosition()).toEqual [0, 0]
describe ".moveCursorToEndOfLine()", ->
it "moves cursor to the end of the buffer line", ->
editor.setSoftWrap(true)
editor.setEditorWidthInChars(10)
editor.setCursorScreenPosition([0, 2])
editor.moveCursorToEndOfLine()
cursor = editor.getCursor()
expect(cursor.getScreenPosition()).toEqual [3, 4]
describe ".moveCursorToFirstCharacterOfLine()", ->
describe "when soft wrap is on", ->
it "moves to the first character of the current screen line or the beginning of the screen line if it's already on the first character", ->
@@ -418,6 +447,13 @@ describe "Editor", ->
expect(cursor1.getBufferPosition()).toEqual [0,0]
expect(cursor2.getBufferPosition()).toEqual [1,0]
it "moves to the beginning of the line if it only contains whitespace ", ->
editor.setText("first\n \nthird")
editor.setCursorScreenPosition [1,2]
editor.moveCursorToFirstCharacterOfLine()
cursor = editor.getCursor()
expect(cursor.getBufferPosition()).toEqual [1,0]
describe ".moveCursorToBeginningOfWord()", ->
it "moves the cursor to the beginning of the word", ->
editor.setCursorBufferPosition [0, 8]
@@ -783,6 +819,11 @@ describe "Editor", ->
editor.selectLine()
expect(editor.getSelectedBufferRange()).toEqual [[12,0], [12,2]]
editor.setCursorBufferPosition([0, 2])
editor.selectLine()
editor.selectLine()
expect(editor.getSelectedBufferRange()).toEqual [[0,0], [2,0]]
describe ".selectToBeginningOfWord()", ->
it "selects text from cusor position to beginning of word", ->
editor.setCursorScreenPosition [0,13]
@@ -1145,6 +1186,27 @@ describe "Editor", ->
[[10, 0], [10, 0]]
]
describe ".splitSelectionsIntoLines()", ->
it "splits all multi-line selections into one selection per line", ->
editor.setSelectedBufferRange([[0, 3], [2, 4]])
editor.splitSelectionsIntoLines()
expect(editor.getSelectedBufferRanges()).toEqual [
[[0, 3], [0, 29]]
[[1, 0], [1, 30]]
[[2, 0], [2, 4]]
]
editor.setSelectedBufferRange([[0, 3], [1, 10]])
editor.splitSelectionsIntoLines()
expect(editor.getSelectedBufferRanges()).toEqual [
[[0, 3], [0, 29]]
[[1, 0], [1, 10]]
]
editor.setSelectedBufferRange([[0, 0], [0, 3]])
editor.splitSelectionsIntoLines()
expect(editor.getSelectedBufferRanges()).toEqual [[[0, 0], [0, 3]]]
describe ".consolidateSelections()", ->
it "destroys all selections but the most recent, returning true if any selections were destroyed", ->
editor.setSelectedBufferRange([[3, 16], [3, 21]])
@@ -2389,17 +2451,16 @@ describe "Editor", ->
describe "when a better-matched grammar is added to syntax", ->
it "switches to the better-matched grammar and re-tokenizes the buffer", ->
editor.destroy()
jsGrammar = atom.syntax.selectGrammar('a.js')
atom.syntax.removeGrammar(jsGrammar)
editor = atom.project.openSync('sample.js', autoIndent: false)
expect(editor.getGrammar()).toBe atom.syntax.nullGrammar
expect(editor.lineForScreenRow(0).tokens.length).toBe 1
editor2 = atom.project.openSync('sample.js', autoIndent: false)
expect(editor2.getGrammar()).toBe atom.syntax.nullGrammar
expect(editor2.lineForScreenRow(0).tokens.length).toBe 1
atom.syntax.addGrammar(jsGrammar)
expect(editor.getGrammar()).toBe jsGrammar
expect(editor.lineForScreenRow(0).tokens.length).toBeGreaterThan 1
expect(editor2.getGrammar()).toBe jsGrammar
expect(editor2.lineForScreenRow(0).tokens.length).toBeGreaterThan 1
describe "auto-indent", ->
copyText = (text, {startColumn}={}) ->
@@ -2611,6 +2672,7 @@ describe "Editor", ->
describe ".shouldPromptToSave()", ->
it "returns false when an edit session's buffer is in use by more than one session", ->
jasmine.unspy(editor, 'shouldPromptToSave')
expect(editor.shouldPromptToSave()).toBeFalsy()
buffer.setText('changed')
expect(editor.shouldPromptToSave()).toBeTruthy()
@@ -2659,3 +2721,64 @@ describe "Editor", ->
expect(editor.getCursorBufferPosition()).toEqual [0, 2]
editor.moveCursorLeft()
expect(editor.getCursorBufferPosition()).toEqual [0, 0]
describe ".setIndentationForBufferRow", ->
describe "when the editor uses soft tabs but the row has hard tabs", ->
it "only replaces whitespace charachters", ->
editor.setSoftWrap(true)
editor.setText(" 1\n 2")
editor.setCursorBufferPosition([0, 0])
editor.setIndentationForBufferRow(0, 2)
expect(editor.getText()).toBe(" 1\n 2")
describe "when the editor's grammar has an injection selector", ->
beforeEach ->
atom.packages.activatePackage('language-text', sync: true)
atom.packages.activatePackage('language-javascript', sync: true)
it "includes the grammar's patterns when the selector matches the current scope in other grammars", ->
atom.packages.activatePackage('language-hyperlink', sync: true)
grammar = atom.syntax.selectGrammar("text.js")
{tokens} = grammar.tokenizeLine("var i; // http://github.com")
expect(tokens[0].value).toBe "var"
expect(tokens[0].scopes).toEqual ["source.js", "storage.modifier.js"]
expect(tokens[6].value).toBe "http://github.com"
expect(tokens[6].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"]
describe "when the grammar is added", ->
it "retokenizes existing buffers that contain tokens that match the injection selector", ->
editor = atom.project.openSync('sample.js')
editor.setText("// http://github.com")
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " http://github.com"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.packages.activatePackage('language-hyperlink', sync: true)
{tokens} = editor.lineForScreenRow(0)
expect(tokens[2].value).toBe "http://github.com"
expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"]
describe "when the grammar is updated", ->
it "retokenizes existing buffers that contain tokens that match the injection selector", ->
editor = atom.project.openSync('sample.js')
editor.setText("// SELECT * FROM OCTOCATS")
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.packages.activatePackage('package-with-injection-selector', sync: true)
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.packages.activatePackage('language-sql', sync: true)
{tokens} = editor.lineForScreenRow(0)
expect(tokens[2].value).toBe "SELECT"
expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "keyword.other.DML.sql"]
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+2 -2
Ver Arquivo
@@ -63,7 +63,7 @@ describe 'File', ->
afterEach ->
if fs.existsSync(newPath)
fs.removeSync(newPath)
waitsFor "remove event", (done) -> file.on 'removed', done
waitsFor "remove event", 30000, (done) -> file.on 'removed', done
it "it updates its path", ->
jasmine.unspy(window, "setTimeout")
@@ -73,7 +73,7 @@ describe 'File', ->
fs.moveSync(filePath, newPath)
waitsFor "move event", ->
waitsFor "move event", 30000, ->
moveHandler.callCount > 0
runs ->
@@ -0,0 +1,4 @@
'name': 'test'
'scopeName': 'source.test'
'injectionSelector': 'comment'
'patterns': [{'include': 'source.sql'}]
+1 -1
Ver Arquivo
@@ -15,6 +15,6 @@ var quicksort = function () {
}
return sort(left).concat(pivot).concat(sort(right));
};
// this is a single-line comment
return sort(Array.apply(this, arguments));
};
+2 -2
Ver Arquivo
@@ -187,6 +187,7 @@ describe "Git", ->
newPath = atom.project.resolve('git/working-dir/untracked.txt')
cleanPath = atom.project.resolve('git/working-dir/other.txt')
fs.writeFileSync(newPath, '')
newPath = fs.absolute newPath # specs could be running under symbol path.
afterEach ->
fs.writeFileSync(modifiedPath, originalModifiedPathText)
@@ -257,8 +258,7 @@ describe "Git", ->
it "subscribes to all the serialized buffers in the project", ->
atom.project.openSync('sample.js')
#TODO Replace with atom.replicate().project when Atom is a telepath model
project2 = atom.replicate().get('project')
project2 = atom.project.testSerialization()
buffer = project2.getBuffers()[0]
waitsFor ->
+19 -11
Ver Arquivo
@@ -1,23 +1,31 @@
module.exports.runSpecSuite = (specSuite, logErrors=true) ->
fs = require 'fs'
module.exports.runSpecSuite = (specSuite, logFile, logErrors=true) ->
{$, $$} = require 'atom'
window[key] = value for key, value of require '../vendor/jasmine'
require 'jasmine-focused'
require 'jasmine-tagged'
{TerminalReporter} = require 'jasmine-tagged'
TimeReporter = require './time-reporter'
timeReporter = new TimeReporter()
logStream = fs.openSync(logFile, 'w') if logFile?
log = (str) ->
if logStream?
fs.writeSync(logStream, str)
else
process.stderr.write(str)
if atom.getLoadSettings().exitWhenDone
{jasmineNode} = require 'jasmine-node/lib/jasmine-node/reporter'
reporter = new jasmineNode.TerminalReporter
print: (args...) ->
process.stderr.write(args...)
reporter = new TerminalReporter
print: (str) ->
log(str)
onComplete: (runner) ->
process.stdout.write('\n')
timeReporter.logLongestSuites 10, (line) -> process.stdout.write("#{line}\n")
process.stdout.write('\n')
timeReporter.logLongestSpecs 10, (line) -> process.stdout.write("#{line}\n")
log('\n')
timeReporter.logLongestSuites 10, (line) -> log("#{line}\n")
log('\n')
timeReporter.logLongestSpecs 10, (line) -> log("#{line}\n")
fs.closeSync(logStream) if logStream?
atom.exit(runner.results().failedCount > 0 ? 1 : 0)
else
AtomReporter = require './atom-reporter'
+54 -2
Ver Arquivo
@@ -1,5 +1,6 @@
fs = require 'fs-plus'
path = require 'path'
temp = require 'temp'
Keymap = require '../src/keymap'
{$, $$, WorkspaceView} = require 'atom'
@@ -7,9 +8,11 @@ describe "Keymap", ->
fragment = null
keymap = null
resourcePath = atom.getLoadSettings().resourcePath
configDirPath = null
beforeEach ->
keymap = new Keymap({configDirPath: atom.getConfigDirPath(), resourcePath})
configDirPath = temp.mkdirSync('atom')
keymap = new Keymap({configDirPath, resourcePath})
fragment = $ """
<div class="command-mode">
<div class="child-node">
@@ -18,6 +21,9 @@ describe "Keymap", ->
</div>
"""
afterEach ->
keymap.destroy()
describe ".handleKeyEvent(event)", ->
deleteCharHandler = null
insertCharHandler = null
@@ -347,3 +353,49 @@ describe "Keymap", ->
el = $$ -> @div class: 'brown'
bindings = keymap.keyBindingsForCommandMatchingElement('cultivate', el)
expect(bindings).toHaveLength 0
describe "loading platform specific keybindings", ->
customKeymap = null
beforeEach ->
resourcePath = temp.mkdirSync('atom')
customKeymap = new Keymap({configDirPath, resourcePath})
afterEach ->
customKeymap.destroy()
it "doesn't load keybindings from other platforms", ->
win32FilePath = path.join(resourcePath, "keymaps", "win32.cson")
darwinFilePath = path.join(resourcePath, "keymaps", "darwin.cson")
fs.writeFileSync(win32FilePath, '"body": "ctrl-l": "core:win32-move-left"')
fs.writeFileSync(darwinFilePath, '"body": "ctrl-l": "core:darwin-move-left"')
customKeymap.loadBundledKeymaps()
keyBindings = customKeymap.keyBindingsForKeystroke('ctrl-l')
expect(keyBindings).toHaveLength 1
expect(keyBindings[0].command).toBe "core:#{process.platform}-move-left"
describe "when the user keymap file is changed", ->
it "is reloaded", ->
keymapFilePath = path.join(configDirPath, "keymap.cson")
fs.writeFileSync(keymapFilePath, '"body": "ctrl-l": "core:move-left"')
keymap.loadUserKeymap()
spyOn(keymap, 'loadUserKeymap').andCallThrough()
fs.writeFileSync(keymapFilePath, "'body': 'ctrl-l': 'core:move-right'")
waitsFor ->
keymap.loadUserKeymap.callCount > 0
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding.command).toBe 'core:move-right'
keymap.loadUserKeymap.reset()
fs.removeSync(keymapFilePath)
waitsFor ->
keymap.loadUserKeymap.callCount > 0
runs ->
keyBinding = keymap.keyBindingsForKeystroke('ctrl-l')[0]
expect(keyBinding).toBeUndefined()
+31 -21
Ver Arquivo
@@ -44,20 +44,12 @@ describe "LanguageMode", ->
languageMode.toggleLineCommentsForBufferRows(0, 0)
expect(buffer.lineForRow(0)).toBe " // var i;"
describe "fold suggestion", ->
describe ".doesBufferRowStartFold(bufferRow)", ->
it "returns true only when the buffer row starts a foldable region", ->
expect(languageMode.doesBufferRowStartFold(0)).toBeTruthy()
expect(languageMode.doesBufferRowStartFold(1)).toBeTruthy()
expect(languageMode.doesBufferRowStartFold(2)).toBeFalsy()
expect(languageMode.doesBufferRowStartFold(3)).toBeFalsy()
describe ".rowRangeForCodeFoldAtBufferRow(bufferRow)", ->
it "returns the start/end rows of the foldable region starting at the given row", ->
expect(languageMode.rowRangeForCodeFoldAtBufferRow(0)).toEqual [0, 12]
expect(languageMode.rowRangeForCodeFoldAtBufferRow(1)).toEqual [1, 9]
expect(languageMode.rowRangeForCodeFoldAtBufferRow(2)).toBeNull()
expect(languageMode.rowRangeForCodeFoldAtBufferRow(4)).toEqual [4, 7]
describe ".rowRangeForCodeFoldAtBufferRow(bufferRow)", ->
it "returns the start/end rows of the foldable region starting at the given row", ->
expect(languageMode.rowRangeForCodeFoldAtBufferRow(0)).toEqual [0, 12]
expect(languageMode.rowRangeForCodeFoldAtBufferRow(1)).toEqual [1, 9]
expect(languageMode.rowRangeForCodeFoldAtBufferRow(2)).toBeNull()
expect(languageMode.rowRangeForCodeFoldAtBufferRow(4)).toEqual [4, 7]
describe "suggestedIndentForBufferRow", ->
it "returns the suggested indentation based on auto-indent/outdent rules", ->
@@ -106,7 +98,6 @@ describe "LanguageMode", ->
range = languageMode.rowRangeForParagraphAtBufferRow(15)
expect(range).toEqual [[15,0], [15,26]]
describe "coffeescript", ->
beforeEach ->
atom.packages.activatePackage('language-coffee-script', sync: true)
@@ -139,13 +130,13 @@ describe "LanguageMode", ->
expect(buffer.lineForRow(7)).toBe " # "
describe "fold suggestion", ->
describe ".doesBufferRowStartFold(bufferRow)", ->
describe ".isFoldableAtBufferRow(bufferRow)", ->
it "returns true only when the buffer row starts a foldable region", ->
expect(languageMode.doesBufferRowStartFold(0)).toBeTruthy()
expect(languageMode.doesBufferRowStartFold(1)).toBeTruthy()
expect(languageMode.doesBufferRowStartFold(2)).toBeFalsy()
expect(languageMode.doesBufferRowStartFold(3)).toBeFalsy()
expect(languageMode.doesBufferRowStartFold(19)).toBeTruthy()
expect(languageMode.isFoldableAtBufferRow(0)).toBeTruthy()
expect(languageMode.isFoldableAtBufferRow(1)).toBeTruthy()
expect(languageMode.isFoldableAtBufferRow(2)).toBeFalsy()
expect(languageMode.isFoldableAtBufferRow(3)).toBeFalsy()
expect(languageMode.isFoldableAtBufferRow(19)).toBeTruthy()
describe ".rowRangeForCodeFoldAtBufferRow(bufferRow)", ->
it "returns the start/end rows of the foldable region starting at the given row", ->
@@ -297,6 +288,14 @@ describe "LanguageMode", ->
languageMode.unfoldBufferRow(1)
expect(editor.lineForScreenRow(1).fold).toBeUndefined()
describe ".isFoldableAtBufferRow(bufferRow)", ->
it "returns true if the line starts a foldable row range", ->
expect(languageMode.isFoldableAtBufferRow(0)).toBe true
expect(languageMode.isFoldableAtBufferRow(1)).toBe true
expect(languageMode.isFoldableAtBufferRow(2)).toBe false
expect(languageMode.isFoldableAtBufferRow(3)).toBe false
expect(languageMode.isFoldableAtBufferRow(4)).toBe true
describe "folding with comments", ->
beforeEach ->
atom.packages.activatePackage('language-javascript', sync: true)
@@ -350,6 +349,17 @@ describe "LanguageMode", ->
fold2 = editor.lineForScreenRow(5).fold
expect(fold2).toBeFalsy()
describe ".isFoldableAtBufferRow(bufferRow)", ->
it "returns true if the line starts a multi-line comment", ->
expect(languageMode.isFoldableAtBufferRow(1)).toBe true
expect(languageMode.isFoldableAtBufferRow(6)).toBe true
expect(languageMode.isFoldableAtBufferRow(17)).toBe false
it "does not return true for a line in the middle of a comment that's followed by an indented line", ->
expect(languageMode.isFoldableAtBufferRow(7)).toBe false
editor.buffer.insert([8, 0], ' ')
expect(languageMode.isFoldableAtBufferRow(7)).toBe false
describe "css", ->
beforeEach ->
atom.packages.activatePackage('language-source', sync: true)
+54 -328
Ver Arquivo
@@ -1,341 +1,67 @@
path = require 'path'
temp = require 'temp'
PaneContainer = require '../src/pane-container'
Pane = require '../src/pane'
{_, $, View, $$} = require 'atom'
describe "PaneContainer", ->
[TestView, container, pane1, pane2, pane3] = []
beforeEach ->
class TestView extends View
atom.deserializers.add(this)
@deserialize: ({name}) -> new TestView(name)
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other.name
container = new PaneContainer
pane1 = new Pane(new TestView('1'))
container.setRoot(pane1)
pane2 = pane1.splitRight(new TestView('2'))
pane3 = pane2.splitDown(new TestView('3'))
afterEach ->
atom.deserializers.remove(TestView)
describe ".focusNextPane()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
describe ".focusPreviousPane()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
describe ".getActivePane()", ->
it "returns the most-recently focused pane", ->
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
focusStealer.attachToDom()
container.attachToDom()
pane2.focus()
expect(container.getFocusedPane()).toBe pane2
expect(container.getActivePane()).toBe pane2
focusStealer.focus()
expect(container.getFocusedPane()).toBeUndefined()
expect(container.getActivePane()).toBe pane2
pane3.focus()
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3
# returns the first pane if none have been set to active
container.find('.pane.active').removeClass('active')
expect(container.getActivePane()).toBe pane1
describe ".eachPane(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
panes = []
subscription = container.eachPane (pane) -> panes.push(pane)
expect(panes).toEqual [pane1, pane2, pane3]
panes = []
pane4 = pane3.splitRight(pane3.copyActiveItem())
expect(panes).toEqual [pane4]
panes = []
subscription.off()
pane4.splitDown()
expect(panes).toEqual []
describe ".reopenItem()", ->
describe "when there is an active pane", ->
it "reconstructs and shows the last-closed pane item", ->
expect(container.getActivePane()).toBe pane3
item3 = pane3.activeItem
item4 = new TestView('4')
pane3.showItem(item4)
pane3.destroyItem(item3)
pane3.destroyItem(item4)
expect(container.getActivePane()).toBe pane1
expect(container.reopenItem()).toBeTruthy()
expect(pane1.activeItem).toEqual item4
expect(container.reopenItem()).toBeTruthy()
expect(pane1.activeItem).toEqual item3
expect(container.reopenItem()).toBeFalsy()
expect(pane1.activeItem).toEqual item3
describe "when the last-closed pane item is an edit session", ->
it "reopens the edit session (regression)", ->
editor = atom.project.openSync('sample.js')
pane3.showItem(editor)
pane3.destroyItem(editor)
expect(container.reopenItem()).toBeTruthy()
expect(pane3.activeItem.getPath()).toBe editor.getPath()
expect(container.reopenItem()).toBeFalsy()
describe "when there is no active pane", ->
it "attaches a new pane with the reconstructed last pane item and focuses it", ->
container.attachToDom()
pane1.remove()
pane2.remove()
item3 = pane3.activeItem
pane3.destroyItem(item3)
expect(container.getActivePane()).toBeUndefined()
container.reopenItem()
expect(container.getActivePane().activeItem).toEqual item3
expect(container.getActivePane().activeView).toMatchSelector ':focus'
it "does not reopen an item that is already open", ->
item3 = pane3.activeItem
item4 = new TestView('4')
pane3.showItem(item4)
pane3.destroyItem(item3)
pane3.destroyItem(item4)
expect(container.getActivePane()).toBe pane1
pane1.showItem(new TestView('4'))
expect(container.reopenItem()).toBeTruthy()
expect(_.pluck(pane1.getItems(), 'name')).toEqual ['1', '4', '3']
expect(pane1.activeItem).toEqual item3
expect(container.reopenItem()).toBeFalsy()
expect(pane1.activeItem).toEqual item3
pane1.destroyItem(item3)
container.setRoot(new Pane(item3))
expect(container.reopenItem()).toBeFalsy()
expect(container.getActivePane().getItems().length).toBe 1
expect(container.getActivePaneItem()).toEqual item3
describe ".saveAll()", ->
it "saves all open pane items", ->
pane1.showItem(new TestView('4'))
container.saveAll()
for pane in container.getPanes()
for item in pane.getItems()
expect(item.saved).toBeTruthy()
describe ".confirmClose()", ->
it "returns true after modified files are saved", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(0)
saved = container.confirmClose()
runs ->
expect(saved).toBeTruthy()
expect(atom.confirm).toHaveBeenCalled()
it "returns false if the user cancels saving", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(1)
saved = container.confirmClose()
runs ->
expect(saved).toBeFalsy()
expect(atom.confirm).toHaveBeenCalled()
describe "serialization", ->
it "can be serialized and deserialized, and correctly adjusts dimensions of deserialized panes after attach", ->
newContainer = atom.deserializers.deserialize(container.serialize())
expect(newContainer.find('.row > :contains(1)')).toExist()
expect(newContainer.find('.row > .column > :contains(2)')).toExist()
expect(newContainer.find('.row > .column > :contains(3)')).toExist()
[containerA, pane1A, pane2A, pane3A] = []
newContainer.height(200).width(300).attachToDom()
expect(newContainer.find('.row > :contains(1)').width()).toBe 150
expect(newContainer.find('.row > .column > :contains(2)').height()).toBe 100
xit "removes empty panes on deserialization", ->
# only deserialize pane 1's view successfully
TestView.deserialize = ({name}) -> new TestView(name) if name is '1'
newContainer = atom.deserializers.deserialize(container.serialize())
expect(newContainer.find('.row, .column')).not.toExist()
expect(newContainer.find('> :contains(1)')).toExist()
describe "pane-container:active-pane-item-changed", ->
[pane1, item1a, item1b, item2a, item2b, item3a, container, activeItemChangedHandler] = []
beforeEach ->
item1a = new TestView('1a')
item1b = new TestView('1b')
item2a = new TestView('2a')
item2b = new TestView('2b')
item3a = new TestView('3a')
# This is a dummy item to prevent panes from being empty on deserialization
class Item
atom.deserializers.add(this)
@deserialize: -> new this
serialize: -> deserializer: 'Item'
pane1A = new Pane(items: [new Item])
containerA = new PaneContainer(root: pane1A)
pane2A = pane1A.splitRight(items: [new Item])
pane3A = pane2A.splitDown(items: [new Item])
it "preserves the focused pane across serialization", ->
expect(pane3A.focused).toBe true
containerB = containerA.testSerialization()
[pane1B, pane2B, pane3B] = containerB.getPanes()
expect(pane3B.focused).toBe true
it "preserves the active pane across serialization, independent of focus", ->
pane3A.activate()
expect(containerA.activePane).toBe pane3A
containerB = containerA.testSerialization()
[pane1B, pane2B, pane3B] = containerB.getPanes()
expect(containerB.activePane).toBe pane3B
describe "::activePane", ->
[container, pane1, pane2] = []
beforeEach ->
container = new PaneContainer
container.attachToDom()
pane1 = new Pane(item1a)
container.setRoot(pane1)
pane1 = container.root
activeItemChangedHandler = jasmine.createSpy("activeItemChangedHandler")
container.on 'pane-container:active-pane-item-changed', activeItemChangedHandler
it "references the first pane if no pane has been made active", ->
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
describe "when there are no panes", ->
it "is triggered when a new pane containing a pane item is added", ->
container.setRoot()
expect(container.getPanes().length).toBe 0
activeItemChangedHandler.reset()
it "references the most pane on which ::activate was most recently called", ->
pane2 = pane1.splitRight()
pane2.activate()
expect(container.activePane).toBe pane2
expect(pane1.active).toBe false
expect(pane2.active).toBe true
pane1.activate()
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
expect(pane2.active).toBe false
pane = new Pane(item1a)
container.setRoot(pane)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is reassigned to the next pane if the current active pane is destroyed", ->
pane2 = pane1.splitRight()
pane2.activate()
pane2.destroy()
expect(container.activePane).toBe pane1
expect(pane1.active).toBe true
describe "when there is one pane", ->
it "is triggered when a new pane item is added", ->
pane1.showItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1b
it "is not triggered when the active pane item is shown again", ->
pane1.showItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when switching to an existing pane item", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
pane1.showItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is triggered when the active pane item is removed", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
pane1.removeItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane item is removed", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
pane1.removeItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when all pane items are removed", ->
pane1.removeItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
it "is triggered when the pane is removed", ->
pane1.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
describe "when there are two panes", ->
[pane2] = []
beforeEach ->
pane2 = pane1.splitLeft(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane item is added to the active pane", ->
pane2.showItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2b
it "is not triggered when a new pane item is added to an inactive pane", ->
pane1.showItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane item removed from the active pane", ->
pane2.showItem(item2b)
activeItemChangedHandler.reset()
pane2.removeItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2a
it "is not triggered when the active pane item removed from an inactive pane", ->
pane1.showItem(item1b)
activeItemChangedHandler.reset()
pane1.removeItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is removed", ->
pane2.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane is removed", ->
pane1.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is changed", ->
pane1.makeActive()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
describe "when there are multiple panes", ->
beforeEach ->
pane2 = pane1.splitRight(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane is added", ->
pane2.splitDown(item3a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item3a
it "is not triggered when the non active pane is removed", ->
pane3 = pane2.splitDown(item3a)
activeItemChangedHandler.reset()
pane1.remove()
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "does not allow the root pane to be destroyed", ->
pane1.destroy()
expect(container.root).toBe pane1
expect(pane1.isDestroyed()).toBe false
+267
Ver Arquivo
@@ -0,0 +1,267 @@
path = require 'path'
temp = require 'temp'
PaneContainerView = require '../src/pane-container-view'
PaneView = require '../src/pane-view'
{_, $, View, $$} = require 'atom'
describe "PaneContainerView", ->
[TestView, container, pane1, pane2, pane3] = []
beforeEach ->
class TestView extends View
atom.deserializers.add(this)
@deserialize: ({name}) -> new TestView(name)
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other?.name
container = new PaneContainerView
pane1 = container.getRoot()
pane1.activateItem(new TestView('1'))
pane2 = pane1.splitRight(new TestView('2'))
pane3 = pane2.splitDown(new TestView('3'))
afterEach ->
atom.deserializers.remove(TestView)
describe ".focusNextPane()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
expect(pane1.activeItem).toMatchSelector ':focus'
describe ".focusPreviousPane()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.getPanes()[0].focus() # activate first pane
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'
describe ".getActivePane()", ->
it "returns the most-recently focused pane", ->
focusStealer = $$ -> @div tabindex: -1, "focus stealer"
focusStealer.attachToDom()
container.attachToDom()
pane2.focus()
expect(container.getFocusedPane()).toBe pane2
expect(container.getActivePane()).toBe pane2
focusStealer.focus()
expect(container.getFocusedPane()).toBeUndefined()
expect(container.getActivePane()).toBe pane2
pane3.focus()
expect(container.getFocusedPane()).toBe pane3
expect(container.getActivePane()).toBe pane3
describe ".eachPane(callback)", ->
it "runs the callback with all current and future panes until the subscription is cancelled", ->
panes = []
subscription = container.eachPane (pane) -> panes.push(pane)
expect(panes).toEqual [pane1, pane2, pane3]
panes = []
pane4 = pane3.splitRight(pane3.copyActiveItem())
expect(panes).toEqual [pane4]
panes = []
subscription.off()
pane4.splitDown()
expect(panes).toEqual []
describe ".saveAll()", ->
it "saves all open pane items", ->
pane1.activateItem(new TestView('4'))
container.saveAll()
for pane in container.getPanes()
for item in pane.getItems()
expect(item.saved).toBeTruthy()
describe ".confirmClose()", ->
it "returns true after modified files are saved", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(0)
saved = container.confirmClose()
runs ->
expect(saved).toBeTruthy()
expect(atom.confirm).toHaveBeenCalled()
it "returns false if the user cancels saving", ->
pane1.itemAtIndex(0).shouldPromptToSave = -> true
pane2.itemAtIndex(0).shouldPromptToSave = -> true
spyOn(atom, "confirm").andReturn(1)
saved = container.confirmClose()
runs ->
expect(saved).toBeFalsy()
expect(atom.confirm).toHaveBeenCalled()
describe "serialization", ->
it "can be serialized and deserialized, and correctly adjusts dimensions of deserialized panes after attach", ->
newContainer = new PaneContainerView(container.model.testSerialization())
expect(newContainer.find('.pane-row > :contains(1)')).toExist()
expect(newContainer.find('.pane-row > .pane-column > :contains(2)')).toExist()
expect(newContainer.find('.pane-row > .pane-column > :contains(3)')).toExist()
newContainer.height(200).width(300).attachToDom()
expect(newContainer.find('.pane-row > :contains(1)').width()).toBe 150
expect(newContainer.find('.pane-row > .pane-column > :contains(2)').height()).toBe 100
describe "if there are empty panes after deserialization", ->
beforeEach ->
# only deserialize pane 1's view successfully
TestView.deserialize = ({name}) -> new TestView(name) if name is '1'
describe "if the 'core.destroyEmptyPanes' config option is false (the default)", ->
it "leaves the empty panes intact", ->
newContainer = new PaneContainerView(container.model.testSerialization())
expect(newContainer.find('.pane-row > :contains(1)')).toExist()
expect(newContainer.find('.pane-row > .pane-column > .pane').length).toBe 2
describe "if the 'core.destroyEmptyPanes' config option is true", ->
it "removes empty panes on deserialization", ->
atom.config.set('core.destroyEmptyPanes', true)
newContainer = new PaneContainerView(container.model.testSerialization())
expect(newContainer.find('.pane-row, .pane-column')).not.toExist()
expect(newContainer.find('> :contains(1)')).toExist()
describe "pane-container:active-pane-item-changed", ->
[pane1, item1a, item1b, item2a, item2b, item3a, container, activeItemChangedHandler] = []
beforeEach ->
item1a = new TestView('1a')
item1b = new TestView('1b')
item2a = new TestView('2a')
item2b = new TestView('2b')
item3a = new TestView('3a')
container = new PaneContainerView
pane1 = container.getRoot()
pane1.activateItem(item1a)
container.attachToDom()
activeItemChangedHandler = jasmine.createSpy("activeItemChangedHandler")
container.on 'pane-container:active-pane-item-changed', activeItemChangedHandler
describe "when there is one pane", ->
it "is triggered when a new pane item is added", ->
pane1.activateItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1b
it "is not triggered when the active pane item is shown again", ->
pane1.activateItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when switching to an existing pane item", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.activateItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is triggered when the active pane item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1a)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when all pane items are destroyed", ->
pane1.destroyItem(item1a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toBe undefined
describe "when there are two panes", ->
[pane2] = []
beforeEach ->
pane2 = pane1.splitLeft(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane item is added to the active pane", ->
pane2.activateItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2b
it "is not triggered when a new pane item is added to an inactive pane", ->
pane1.activateItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane's active item is destroyed", ->
pane2.activateItem(item2b)
activeItemChangedHandler.reset()
pane2.destroyItem(item2b)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item2a
it "is not triggered when an inactive pane's active item is destroyed", ->
pane1.activateItem(item1b)
activeItemChangedHandler.reset()
pane1.destroyItem(item1b)
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is destroyed", ->
pane2.remove()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
it "is not triggered when an inactive pane is destroyed", ->
pane1.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
it "is triggered when the active pane is changed", ->
pane1.activate()
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item1a
describe "when there are multiple panes", ->
beforeEach ->
pane2 = pane1.splitRight(item2a)
activeItemChangedHandler.reset()
it "is triggered when a new pane is added", ->
pane2.splitDown(item3a)
expect(activeItemChangedHandler.callCount).toBe 1
expect(activeItemChangedHandler.argsForCall[0][1]).toEqual item3a
it "is not triggered when an inactive pane is destroyed", ->
pane3 = pane2.splitDown(item3a)
activeItemChangedHandler.reset()
pane1.remove()
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
+398 -602
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+276
Ver Arquivo
@@ -0,0 +1,276 @@
PaneContainerView = require '../src/pane-container-view'
PaneView = require '../src/pane-view'
{fs, $, View} = require 'atom'
path = require 'path'
temp = require 'temp'
describe "PaneView", ->
[container, view1, view2, editor1, editor2, pane, paneModel] = []
class TestView extends View
@deserialize: ({id, text}) -> new TestView({id, text})
@content: ({id, text}) -> @div class: 'test-view', id: id, tabindex: -1, text
initialize: ({@id, @text}) ->
serialize: -> { deserializer: 'TestView', @id, @text }
getUri: -> @id
isEqual: (other) -> other? and @id == other.id and @text == other.text
beforeEach ->
atom.deserializers.add(TestView)
container = new PaneContainerView
view1 = new TestView(id: 'view-1', text: 'View 1')
view2 = new TestView(id: 'view-2', text: 'View 2')
editor1 = atom.project.openSync('sample.js')
editor2 = atom.project.openSync('sample.txt')
pane = container.getRoot()
paneModel = pane.model
paneModel.addItems([view1, editor1, view2, editor2])
afterEach ->
atom.deserializers.remove(TestView)
describe "when the active pane item changes", ->
it "hides all item views except the active one", ->
expect(pane.activeItem).toBe view1
expect(view1.css('display')).not.toBe 'none'
pane.activateItem(view2)
expect(view1.css('display')).toBe 'none'
expect(view2.css('display')).not.toBe 'none'
it "triggers 'pane:active-item-changed'", ->
itemChangedHandler = jasmine.createSpy("itemChangedHandler")
container.on 'pane:active-item-changed', itemChangedHandler
expect(pane.activeItem).toBe view1
paneModel.activateItem(view2)
paneModel.activateItem(view2)
expect(itemChangedHandler.callCount).toBe 1
expect(itemChangedHandler.argsForCall[0][1]).toBe view2
itemChangedHandler.reset()
paneModel.activateItem(editor1)
expect(itemChangedHandler).toHaveBeenCalled()
expect(itemChangedHandler.argsForCall[0][1]).toBe editor1
itemChangedHandler.reset()
it "transfers focus to the new active view if the previous view was focused", ->
container.attachToDom()
pane.focus()
expect(pane.activeView).not.toBe view2
expect(pane.activeView).toMatchSelector ':focus'
paneModel.activateItem(view2)
expect(view2).toMatchSelector ':focus'
describe "when the new activeItem is a model", ->
it "shows the item's view or creates and shows a new view for the item if none exists", ->
initialViewCount = pane.itemViews.find('.test-view').length
model1 =
id: 'test-model-1'
text: 'Test Model 1'
serialize: -> {@id, @text}
getViewClass: -> TestView
model2 =
id: 'test-model-2'
text: 'Test Model 2'
serialize: -> {@id, @text}
getViewClass: -> TestView
paneModel.activateItem(model1)
paneModel.activateItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
paneModel.activatePreviousItem()
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 2
paneModel.destroyItem(model2)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount + 1
paneModel.destroyItem(model1)
expect(pane.itemViews.find('.test-view').length).toBe initialViewCount
describe "when the new activeItem is a view", ->
it "appends it to the itemViews div if it hasn't already been appended and shows it", ->
expect(pane.itemViews.find('#view-2')).not.toExist()
paneModel.activateItem(view2)
expect(pane.itemViews.find('#view-2')).toExist()
paneModel.activateItem(view1)
paneModel.activateItem(view2)
expect(pane.itemViews.find('#view-2').length).toBe 1
describe "when an item is destroyed", ->
it "triggers the 'pane:item-removed' event with the item and its former index", ->
itemRemovedHandler = jasmine.createSpy("itemRemovedHandler")
pane.on 'pane:item-removed', itemRemovedHandler
paneModel.destroyItem(editor1)
expect(itemRemovedHandler).toHaveBeenCalled()
expect(itemRemovedHandler.argsForCall[0][1..2]).toEqual [editor1, 1]
describe "when the destroyed item is a view", ->
it "removes the item from the 'item-views' div", ->
expect(view1.parent()).toMatchSelector pane.itemViews
paneModel.destroyItem(view1)
expect(view1.parent()).not.toMatchSelector pane.itemViews
describe "when the destroyed item is a model", ->
it "removes the associated view", ->
paneModel.activateItem(editor1)
expect(pane.itemViews.find('.editor').length).toBe 1
pane.destroyItem(editor1)
expect(pane.itemViews.find('.editor').length).toBe 0
describe "when an item is moved within the same pane", ->
it "emits a 'pane:item-moved' event with the item and the new index", ->
pane.on 'pane:item-moved', itemMovedHandler = jasmine.createSpy("itemMovedHandler")
paneModel.moveItem(view1, 2)
expect(itemMovedHandler).toHaveBeenCalled()
expect(itemMovedHandler.argsForCall[0][1..2]).toEqual [view1, 2]
describe "when an item is moved to another pane", ->
it "detaches the item's view rather than removing it", ->
paneModel2 = paneModel.splitRight()
view1.data('preservative', 1234)
paneModel.moveItemToPane(view1, paneModel2, 1)
expect(view1.data('preservative')).toBe 1234
paneModel2.activateItemAtIndex(1)
expect(view1.data('preservative')).toBe 1234
describe "when the title of the active item changes", ->
it "emits pane:active-item-title-changed", ->
activeItemTitleChangedHandler = jasmine.createSpy("activeItemTitleChangedHandler")
pane.on 'pane:active-item-title-changed', activeItemTitleChangedHandler
expect(pane.activeItem).toBe view1
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).not.toHaveBeenCalled()
view1.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
activeItemTitleChangedHandler.reset()
pane.activateItem(view2)
view2.trigger 'title-changed'
expect(activeItemTitleChangedHandler).toHaveBeenCalled()
describe "when an unmodifed buffer's path is deleted", ->
it "removes the pane item", ->
filePath = temp.openSync('atom').path
editor = atom.project.openSync(filePath)
pane.activateItem(editor)
expect(pane.items).toHaveLength(5)
fs.removeSync(filePath)
waitsFor ->
pane.items.length == 4
describe "when a pane is destroyed", ->
[pane2, pane2Model] = []
beforeEach ->
pane2Model = paneModel.splitRight() # Can't destroy the last pane, so we add another
pane2 = pane2Model._view
it "triggers a 'pane:removed' event with the pane", ->
removedHandler = jasmine.createSpy("removedHandler")
container.on 'pane:removed', removedHandler
paneModel.destroy()
expect(removedHandler).toHaveBeenCalled()
expect(removedHandler.argsForCall[0][1]).toBe pane
describe "if the destroyed pane has focus", ->
[paneToLeft, paneToRight] = []
it "focuses the next pane", ->
container.attachToDom()
expect(pane.hasFocus()).toBe false
expect(pane2.hasFocus()).toBe true
pane2Model.destroy()
expect(pane.hasFocus()).toBe true
describe "::getNextPane()", ->
it "returns the next pane if one exists, wrapping around from the last pane to the first", ->
pane.activateItem(editor1)
expect(pane.getNextPane()).toBeUndefined
pane2 = pane.splitRight(pane.copyActiveItem())
expect(pane.getNextPane()).toBe pane2
expect(pane2.getNextPane()).toBe pane
describe "when the pane's active status changes", ->
[pane2, pane2Model] = []
beforeEach ->
pane2Model = paneModel.splitRight(items: [pane.copyActiveItem()])
pane2 = pane2Model._view
expect(pane2Model.isActive()).toBe true
it "adds or removes the .active class as appropriate", ->
expect(pane).not.toHaveClass('active')
paneModel.activate()
expect(pane).toHaveClass('active')
pane2Model.activate()
expect(pane).not.toHaveClass('active')
it "triggers 'pane:became-active' or 'pane:became-inactive' according to the current status", ->
pane.on 'pane:became-active', becameActiveHandler = jasmine.createSpy("becameActiveHandler")
pane.on 'pane:became-inactive', becameInactiveHandler = jasmine.createSpy("becameInactiveHandler")
paneModel.activate()
expect(becameActiveHandler.callCount).toBe 1
expect(becameInactiveHandler.callCount).toBe 0
pane2Model.activate()
expect(becameActiveHandler.callCount).toBe 1
expect(becameInactiveHandler.callCount).toBe 1
describe "when the pane is focused", ->
beforeEach ->
container.attachToDom()
it "transfers focus to the active view", ->
focusHandler = jasmine.createSpy("focusHandler")
pane.activeItem.on 'focus', focusHandler
pane.focus()
expect(focusHandler).toHaveBeenCalled()
it "makes the pane active", ->
paneModel.splitRight(items: [pane.copyActiveItem()])
expect(paneModel.isActive()).toBe false
pane.focus()
expect(paneModel.isActive()).toBe true
describe "when a pane is split", ->
it "builds the appropriate pane-row and pane-column views", ->
pane1 = pane
pane1Model = pane.model
pane.activateItem(editor1)
pane2Model = pane1Model.splitRight(items: [pane1Model.copyActiveItem()])
pane3Model = pane2Model.splitDown(items: [pane2Model.copyActiveItem()])
pane2 = pane2Model._view
pane3 = pane3Model._view
expect(container.find('> .pane-row > .pane').toArray()).toEqual [pane1[0]]
expect(container.find('> .pane-row > .pane-column > .pane').toArray()).toEqual [pane2[0], pane3[0]]
pane1Model.destroy()
expect(container.find('> .pane-column > .pane').toArray()).toEqual [pane2[0], pane3[0]]
describe "serialization", ->
it "focuses the pane after attach only if had focus when serialized", ->
container.attachToDom()
pane.focus()
container2 = new PaneContainerView(container.model.testSerialization())
pane2 = container2.getRoot()
container2.attachToDom()
expect(pane2).toMatchSelector(':has(:focus)')
$(document.activeElement).blur()
container3 = new PaneContainerView(container.model.testSerialization())
pane3 = container3.getRoot()
container3.attachToDom()
expect(pane3).not.toMatchSelector(':has(:focus)')
+4 -23
Ver Arquivo
@@ -16,21 +16,17 @@ describe "Project", ->
afterEach ->
deserializedProject?.destroy()
it "destroys unretained buffers and does not include them in the serialized state", ->
it "does not include unretained buffers in the serialized state", ->
atom.project.bufferForPathSync('a')
expect(atom.project.getBuffers().length).toBe 1
atom.project.getState().serializeForPersistence()
deserializedProject = atom.replicate().get('project')
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
expect(atom.project.getBuffers().length).toBe 0
it "listens for destroyed events on deserialized buffers and removes them when they are destroyed", ->
atom.project.openSync('a')
expect(atom.project.getBuffers().length).toBe 1
atom.project.getState().serializeForPersistence()
deserializedProject = atom.replicate().get('project')
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 1
deserializedProject.getBuffers()[0].destroy()
@@ -59,22 +55,6 @@ describe "Project", ->
editor.saveAs(tempFile)
expect(atom.project.getPath()).toBe path.dirname(tempFile)
describe "when an edit session is deserialized", ->
it "emits an 'editor-created' event and stores the edit session", ->
handler = jasmine.createSpy('editorCreatedHandler')
atom.project.on 'editor-created', handler
editor1 = atom.project.openSync("a")
expect(handler.callCount).toBe 1
expect(atom.project.getEditors().length).toBe 1
expect(atom.project.getEditors()[0]).toBe editor1
editor2 = atom.deserializers.deserialize(editor1.serialize())
expect(handler.callCount).toBe 2
expect(atom.project.getEditors().length).toBe 2
expect(atom.project.getEditors()[0]).toBe editor1
expect(atom.project.getEditors()[1]).toBe editor2
describe "when an edit session is copied", ->
it "emits an 'editor-created' event and stores the edit session", ->
handler = jasmine.createSpy('editorCreatedHandler')
@@ -419,6 +399,7 @@ describe "Project", ->
range: [[2, 6], [2, 11]]
it "works on evil filenames", ->
platform.generateEvilFiles()
atom.project.setPath(path.join(__dirname, 'fixtures', 'evil-files'))
paths = []
matches = []
@@ -1,7 +1,7 @@
SelectList = require '../src/select-list'
SelectListView = require '../src/select-list-view'
{$, $$} = require 'atom'
describe "SelectList", ->
describe "SelectListView", ->
[selectList, array, list, miniEditor] = []
beforeEach ->
@@ -10,7 +10,7 @@ describe "SelectList", ->
["D", "Delta"], ["E", "Echo"], ["F", "Foxtrot"]
]
selectList = new SelectList
selectList = new SelectListView
selectList.maxItems = 4
selectList.filterKey = 1
selectList.itemForElement = (element) ->
@@ -33,7 +33,7 @@ describe "SelectList", ->
selectList.attachToDom()
it "filters the elements in the list based on the scoreElement function and selects the first item", ->
miniEditor.insertText('la')
miniEditor.getEditor().insertText('la')
window.advanceClock(selectList.inputThrottle)
expect(list.find('li').length).toBe 2
@@ -43,13 +43,13 @@ describe "SelectList", ->
expect(selectList.error).not.toBeVisible()
it "displays an error if there are no matches, removes error when there are matches", ->
miniEditor.insertText('nothing will match this')
miniEditor.getEditor().insertText('nothing will match this')
window.advanceClock(selectList.inputThrottle)
expect(list.find('li').length).toBe 0
expect(selectList.error).not.toBeHidden()
miniEditor.setText('la')
miniEditor.getEditor().setText('la')
window.advanceClock(selectList.inputThrottle)
expect(list.find('li').length).toBe 2
@@ -58,7 +58,7 @@ describe "SelectList", ->
it "displays no elements until the array has been set on the list", ->
selectList.array = null
selectList.list.empty()
miniEditor.insertText('la')
miniEditor.getEditor().insertText('la')
window.advanceClock(selectList.inputThrottle)
expect(list.find('li').length).toBe 0
@@ -124,7 +124,7 @@ describe "SelectList", ->
selectList.attachToDom()
it "does not trigger the confirmed hook", ->
miniEditor.insertText("i will never match anything")
miniEditor.getEditor().insertText("i will never match anything")
window.advanceClock(selectList.inputThrottle)
expect(list.find('li')).not.toExist()
@@ -132,7 +132,7 @@ describe "SelectList", ->
expect(selectList.confirmed).not.toHaveBeenCalled()
it "does trigger the cancelled hook", ->
miniEditor.insertText("i will never match anything")
miniEditor.getEditor().insertText("i will never match anything")
window.advanceClock(selectList.inputThrottle)
expect(list.find('li')).not.toExist()
+24 -8
Ver Arquivo
@@ -53,15 +53,31 @@ describe "SpacePen extensions", ->
expect(eventHandler).toHaveBeenCalled()
describe "tooltips", ->
describe "replaceModifiers", ->
replaceModifiers = $.fn.setTooltip.replaceModifiers
describe "humanizeKeystrokes", ->
humanizeKeystrokes = $.fn.setTooltip.humanizeKeystrokes
it "replaces single keystroke", ->
expect(replaceModifiers('cmd-O')).toEqual '⌘⇧O'
expect(replaceModifiers('cmd-shift-up')).toEqual '⌘⇧↑'
expect(replaceModifiers('cmd-option-down')).toEqual '⌘⌥↓'
expect(replaceModifiers('cmd-option-left')).toEqual '⌘⌥←'
expect(replaceModifiers('cmd-option-right')).toEqual '⌘⌥→'
expect(humanizeKeystrokes('cmd-O')).toEqual '⌘⇧O'
expect(humanizeKeystrokes('cmd-shift-up')).toEqual '⌘⇧↑'
expect(humanizeKeystrokes('cmd-option-down')).toEqual '⌘⌥↓'
expect(humanizeKeystrokes('cmd-option-left')).toEqual '⌘⌥←'
expect(humanizeKeystrokes('cmd-option-right')).toEqual '⌘⌥→'
it "replaces multiple keystroke", ->
expect(replaceModifiers('cmd-o ctrl-2')).toEqual '⌘O ⌃2'
expect(humanizeKeystrokes('cmd-o ctrl-2')).toEqual '⌘O ⌃2'
describe "when the window is resized", ->
it "hides the tooltips", ->
class TooltipView extends View
@content: ->
@div()
view = new TooltipView()
view.attachToDom()
view.setTooltip('this is a tip')
view.tooltip('show')
expect($(document.body).find('.tooltip')).toBeVisible()
$(window).trigger('resize')
expect($(document.body).find('.tooltip')).not.toExist()
+2 -2
Ver Arquivo
@@ -4,12 +4,12 @@ require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')
try
require '../src/window'
Atom = require '../src/atom'
window.atom = new Atom()
window.atom = Atom.loadOrCreate('spec')
window.atom.show() unless atom.getLoadSettings().exitWhenDone
{runSpecSuite} = require './jasmine-helper'
document.title = "Spec Suite"
runSpecSuite './spec-suite'
runSpecSuite './spec-suite', atom.getLoadSettings().logFile
catch error
if atom?.getLoadSettings().exitWhenDone
console.error(error.stack ? error)
+8 -10
Ver Arquivo
@@ -1,8 +1,6 @@
path = require 'path'
fs = require 'fs-plus'
{_} = require 'atom'
## Platform specific helpers
module.exports =
# Public: Returns true if being run from within Windows
@@ -18,20 +16,20 @@ module.exports =
fs.removeSync(evilFilesPath) if fs.existsSync(evilFilesPath)
fs.mkdirSync(evilFilesPath)
if (@isWindows())
if @isWindows()
filenames = [
"a_file_with_utf8.txt",
"file with spaces.txt",
"a_file_with_utf8.txt"
"file with spaces.txt"
"utfa\u0306.md"
]
else
filenames = [
"a_file_with_utf8.txt",
"file with spaces.txt",
"goddam\nnewlines",
"quote\".txt",
"a_file_with_utf8.txt"
"file with spaces.txt"
"goddam\nnewlines"
"quote\".txt"
"utfa\u0306.md"
]
for filename in filenames
fd = fs.writeFileSync(path.join(evilFilesPath, filename), 'evil file!', flag: 'w')
fs.writeFileSync(path.join(evilFilesPath, filename), 'evil file!', flag: 'w')
+18 -14
Ver Arquivo
@@ -1,22 +1,20 @@
require '../src/window'
atom.setUpEnvironment('spec')
atom.restoreDimensions()
atom.initialize()
atom.restoreWindowDimensions()
require '../vendor/jasmine-jquery'
path = require 'path'
{_, $, File, WorkspaceView, fs} = require 'atom'
Keymap = require '../src/keymap'
Config = require '../src/config'
{Point} = require 'telepath'
{Point} = require 'text-buffer'
Project = require '../src/project'
Editor = require '../src/editor'
EditorView = require '../src/editor-view'
TokenizedBuffer = require '../src/tokenized-buffer'
pathwatcher = require 'pathwatcher'
platform = require './spec-helper-platform'
clipboard = require 'clipboard'
platform.generateEvilFiles()
atom.themes.loadBaseStylesheets()
atom.themes.requireStylesheet '../static/jasmine'
@@ -27,9 +25,8 @@ keyBindingsToRestore = atom.keymap.getKeyBindings()
$(window).on 'core:close', -> window.close()
$(window).on 'unload', ->
atom.windowMode = 'spec'
atom.getWindowState().set('dimensions', atom.getDimensions())
atom.saveWindowState()
atom.storeWindowDimensions()
atom.saveSync()
$('html,body').css('overflow', 'auto')
jasmine.getEnv().addEqualityTester(_.isEqual) # Use underscore's definition of equality for toEqual assertions
@@ -50,12 +47,15 @@ if specDirectory
beforeEach ->
$.fx.off = true
projectPath = specProjectPath ? path.join(@specDirectory, 'fixtures')
atom.project = atom.getWindowState().set('project', new Project(path: projectPath))
atom.project = new Project(path: projectPath)
atom.keymap.keyBindings = _.clone(keyBindingsToRestore)
window.resetTimeouts()
atom.packages.packageStates = {}
spyOn(atom, 'saveWindowState')
serializedWindowState = null
spyOn(atom, 'saveSync')
atom.syntax.clearGrammarOverrides()
atom.syntax.clearProperties()
@@ -89,6 +89,7 @@ beforeEach ->
spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout
spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout
spyOn(File.prototype, "detectResurrectionAfterDelay").andCallFake -> @detectResurrection()
spyOn(Editor.prototype, "shouldPromptToSave").andReturn false
# make tokenization synchronous
TokenizedBuffer.prototype.chunkSize = Infinity
@@ -106,13 +107,16 @@ afterEach ->
atom.workspaceView?.remove?()
atom.workspaceView = null
delete atom.state.workspace
atom.project?.destroy?()
atom.project = null
delete atom.state.packageStates
$('#jasmine-content').empty() unless window.debugContent
delete atom.windowState
jasmine.unspy(atom, 'saveWindowState')
jasmine.unspy(atom, 'saveSync')
ensureNoPathSubscriptions()
atom.syntax.off()
waits(0) # yield to ui thread to make screen update more frequently
@@ -131,7 +135,7 @@ jasmine.StringPrettyPrinter.prototype.emitObject = (obj) ->
emitObject.call(this, obj)
jasmine.unspy = (object, methodName) ->
throw new Error("Not a spy") unless object[methodName].originalValue?
throw new Error("Not a spy") unless object[methodName].hasOwnProperty('originalValue')
object[methodName] = object[methodName].originalValue
addCustomMatchers = (spec) ->
+12 -10
Ver Arquivo
@@ -1,7 +1,6 @@
{fs} = require 'atom'
path = require 'path'
temp = require 'temp'
TextMateGrammar = require '../src/text-mate-grammar'
describe "the `syntax` global", ->
beforeEach ->
@@ -62,20 +61,23 @@ describe "the `syntax` global", ->
describe "when multiple grammars have matching fileTypes", ->
it "selects the grammar with the longest fileType match", ->
grammar1 = new TextMateGrammar
grammarPath1 = temp.path(suffix: '.json')
fs.writeFileSync grammarPath1, JSON.stringify(
name: 'test1'
scopeName: 'source1'
fileTypes: ['test', 'more.test']
fileTypes: ['test']
)
grammar1 = atom.syntax.loadGrammarSync(grammarPath1)
expect(atom.syntax.selectGrammar('more.test', '')).toBe grammar1
grammar2 = new TextMateGrammar
grammarPath2 = temp.path(suffix: '.json')
fs.writeFileSync grammarPath2, JSON.stringify(
name: 'test2'
scopeName: 'source2'
fileTypes: ['test']
atom.syntax.addGrammar(grammar1)
atom.syntax.addGrammar(grammar2)
expect(atom.syntax.selectGrammar('more.test', '')).toBe grammar1
fileTypes: ['test', 'more.test']
)
grammar2 = atom.syntax.loadGrammarSync(grammarPath2)
expect(atom.syntax.selectGrammar('more.test', '')).toBe grammar2
describe "when there is no file path", ->
it "does not throw an exception (regression)", ->
+109 -46
Ver Arquivo
@@ -1,7 +1,6 @@
{_, fs} = require 'atom'
path = require 'path'
temp = require 'temp'
{Site} = require 'telepath'
TextBuffer = require '../src/text-buffer'
describe 'TextBuffer', ->
@@ -34,11 +33,11 @@ describe 'TextBuffer', ->
expect(buffer.getText()).toBe fs.readFileSync(filePath, 'utf8')
describe "when no file exists for the path", ->
it "is modified and is initially empty", ->
it "is not modified and is initially empty", ->
filePath = "does-not-exist.txt"
expect(fs.existsSync(filePath)).toBeFalsy()
buffer = atom.project.bufferForPathSync(filePath)
expect(buffer.isModified()).toBeTruthy()
expect(buffer.isModified()).not.toBeTruthy()
expect(buffer.getText()).toBe ''
describe "when no path is given", ->
@@ -113,10 +112,17 @@ describe 'TextBuffer', ->
runs ->
[event] = changeHandler.argsForCall[0]
expect(event.oldRange).toEqual [[0, 0], [0, 5]]
expect(event.oldRange).toEqual [[0, 0], [0, 0]]
expect(event.newRange).toEqual [[0, 0], [0, 6]]
expect(event.oldText).toBe "first"
expect(event.oldText).toBe ""
expect(event.newText).toBe "second"
[event] = changeHandler.argsForCall[1]
expect(event.oldRange).toEqual [[0, 6], [0, 11]]
expect(event.newRange).toEqual [[0, 6], [0, 6]]
expect(event.oldText).toBe "first"
expect(event.newText).toBe ""
expect(buffer.isModified()).toBeFalsy()
describe "when the buffer's memory contents differ from the *previous* disk contents", ->
@@ -160,20 +166,38 @@ describe 'TextBuffer', ->
filePath = bufferToDelete.getPath() # symlinks may have been converted
expect(bufferToDelete.getPath()).toBe filePath
expect(bufferToDelete.isModified()).toBeFalsy()
removeHandler = jasmine.createSpy('removeHandler')
bufferToDelete.file.on 'removed', removeHandler
fs.removeSync(filePath)
waitsFor "file to be removed", ->
removeHandler.callCount > 0
afterEach ->
bufferToDelete.destroy()
it "retains its path and reports the buffer as modified", ->
expect(bufferToDelete.getPath()).toBe filePath
expect(bufferToDelete.isModified()).toBeTruthy()
describe "when the file is modified", ->
beforeEach ->
bufferToDelete.setText("I WAS MODIFIED")
expect(bufferToDelete.isModified()).toBeTruthy()
removeHandler = jasmine.createSpy('removeHandler')
bufferToDelete.file.on 'removed', removeHandler
fs.removeSync(filePath)
waitsFor "file to be removed", ->
removeHandler.callCount > 0
it "retains its path and reports the buffer as modified", ->
expect(bufferToDelete.getPath()).toBe filePath
expect(bufferToDelete.isModified()).toBeTruthy()
describe "when the file is not modified", ->
beforeEach ->
expect(bufferToDelete.isModified()).toBeFalsy()
removeHandler = jasmine.createSpy('removeHandler')
bufferToDelete.file.on 'removed', removeHandler
fs.removeSync(filePath)
waitsFor "file to be removed", ->
removeHandler.callCount > 0
it "retains its path and reports the buffer as not modified", ->
expect(bufferToDelete.getPath()).toBe filePath
expect(bufferToDelete.isModified()).toBeFalsy()
it "resumes watching of the file when it is re-saved", ->
bufferToDelete.save()
@@ -210,19 +234,6 @@ describe 'TextBuffer', ->
advanceClock(buffer.stoppedChangingDelay)
expect(modifiedHandler).toHaveBeenCalledWith(false)
it "reports the modified status changing to true after the underlying file is deleted", ->
buffer.release()
filePath = path.join(temp.dir, 'atom-tmp-file')
fs.writeFileSync(filePath, 'delete me')
buffer = atom.project.bufferForPathSync(filePath)
modifiedHandler = jasmine.createSpy("modifiedHandler")
buffer.on 'modified-status-changed', modifiedHandler
fs.removeSync(filePath)
waitsFor "modified status to change", -> modifiedHandler.callCount
runs -> expect(buffer.isModified()).toBe true
it "reports the modified status changing to false after a modified buffer is saved", ->
filePath = path.join(temp.dir, 'atom-tmp-file')
fs.writeFileSync(filePath, '')
@@ -454,6 +465,68 @@ describe 'TextBuffer', ->
expect(event.oldRange).toEqual expectedPreRange
expect(event.newRange).toEqual [[0, 0], [1, 14]]
describe ".setTextViaDiff(text)", ->
it "can change the entire contents of the buffer when there are no newlines", ->
buffer.setText('BUFFER CHANGE')
newText = 'DISK CHANGE'
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
describe "with standard newlines", ->
it "can change the entire contents of the buffer with no newline at the end", ->
newText = "I know you are.\nBut what am I?"
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "can change the entire contents of the buffer with a newline at the end", ->
newText = "I know you are.\nBut what am I?\n"
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "can change a few lines at the beginning in the buffer", ->
newText = buffer.getText().replace(/function/g, 'omgwow')
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "can change a few lines in the middle of the buffer", ->
newText = buffer.getText().replace(/shift/g, 'omgwow')
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "can adds a newline at the end", ->
newText = buffer.getText() + '\n'
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
describe "with windows newlines", ->
beforeEach ->
buffer.setText(buffer.getText().replace(/\n/g, '\r\n'))
it "adds a newline at the end", ->
newText = buffer.getText() + '\r\n'
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "changes the entire contents of the buffer with smaller content with no newline at the end", ->
newText = "I know you are.\r\nBut what am I?"
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "changes the entire contents of the buffer with smaller content with newline at the end", ->
newText = "I know you are.\r\nBut what am I?\r\n"
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "changes a few lines at the beginning in the buffer", ->
newText = buffer.getText().replace(/function/g, 'omgwow')
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
it "changes a few lines in the middle of the buffer", ->
newText = buffer.getText().replace(/shift/g, 'omgwow')
buffer.setTextViaDiff(newText)
expect(buffer.getText()).toBe newText
describe ".save()", ->
saveBuffer = null
@@ -897,25 +970,22 @@ describe 'TextBuffer', ->
expect(buffer.getText()).toBe "\ninitialtexthello\n1\n2\n"
describe "serialization", ->
[buffer2, project2] = []
buffer2 = null
beforeEach ->
buffer.destroy()
filePath = temp.openSync('atom').path
fs.writeFileSync(filePath, "words")
buffer = atom.project.bufferForPathSync(filePath)
buffer = atom.project.bufferForPathSync(filePath).retain()
afterEach ->
buffer2?.release()
project2?.destroy()
buffer2?.destroy()
describe "when the serialized buffer had no unsaved changes", ->
it "loads the current contents of the file at the serialized path", ->
expect(buffer.isModified()).toBeFalsy()
project2 = atom.replicate().get('project')
buffer2 = project2.getBuffers()[0]
buffer2 = buffer.testSerialization()
waitsForPromise ->
buffer2.load()
@@ -931,8 +1001,7 @@ describe 'TextBuffer', ->
buffer.setText("BUFFER CHANGE")
fs.writeFileSync(filePath, "DISK CHANGE")
project2 = atom.replicate().get('project')
buffer2 = project2.getBuffers()[0]
buffer2 = buffer.testSerialization()
waitsFor ->
buffer2.cachedDiskContents
@@ -948,9 +1017,7 @@ describe 'TextBuffer', ->
buffer.setText("abc")
buffer.retain()
buffer.getState().serializeForPersistence()
project2 = atom.replicate().get('project')
buffer2 = project2.getBuffers()[0]
buffer2 = buffer.testSerialization()
waitsForPromise ->
buffer2.load()
@@ -964,15 +1031,11 @@ describe 'TextBuffer', ->
describe "when the serialized buffer was unsaved and had no path", ->
it "restores the previous unsaved state of the buffer", ->
buffer.release()
buffer.destroy()
buffer = atom.project.bufferForPathSync()
buffer.setText("abc")
state = buffer.getState().clone()
expect(state.get('path')).toBeUndefined()
expect(state.getObject('text')).toBe 'abc'
buffer2 = atom.project.addBuffer(new TextBuffer(state))
buffer2 = buffer.testSerialization()
expect(buffer2.getPath()).toBeUndefined()
expect(buffer2.getText()).toBe("abc")
-704
Ver Arquivo
@@ -1,704 +0,0 @@
TextMateGrammar = require '../src/text-mate-grammar'
TextMatePackage = require '../src/text-mate-package'
{_, fs} = require 'atom'
describe "TextMateGrammar", ->
grammar = null
beforeEach ->
atom.packages.activatePackage('language-text', sync: true)
atom.packages.activatePackage('language-javascript', sync: true)
atom.packages.activatePackage('language-coffee-script', sync: true)
atom.packages.activatePackage('language-ruby', sync: true)
atom.packages.activatePackage('language-html', sync: true)
atom.packages.activatePackage('language-php', sync: true)
atom.packages.activatePackage('language-python', sync: true)
grammar = atom.syntax.selectGrammar("hello.coffee")
describe "@loadSync(path)", ->
it "loads grammars from plists", ->
grammar = TextMateGrammar.loadSync(require.resolve('./fixtures/sample.plist'))
expect(grammar.scopeName).toBe "text.plain"
{tokens} = grammar.tokenizeLine("this text is so plain. i love it.")
expect(tokens[0]).toEqual value: "this text is so plain. i love it.", scopes: ["text.plain", "meta.paragraph.text"]
it "loads grammars from cson files", ->
grammar = TextMateGrammar.loadSync(require.resolve('./fixtures/packages/package-with-grammars/grammars/alot.cson'))
expect(grammar.scopeName).toBe "source.alot"
{tokens} = grammar.tokenizeLine("this is alot of code")
expect(tokens[1]).toEqual value: "alot", scopes: ["source.alot", "keyword.alot"]
describe ".tokenizeLine(line, ruleStack)", ->
describe "when the entire line matches a single pattern with no capture groups", ->
it "returns a single token with the correct scope", ->
{tokens} = grammar.tokenizeLine("return")
expect(tokens.length).toBe 1
[token] = tokens
expect(token.scopes).toEqual ['source.coffee', 'keyword.control.coffee']
describe "when the entire line matches a single pattern with capture groups", ->
it "returns a single token with the correct scope", ->
{tokens} = grammar.tokenizeLine("new foo.bar.Baz")
expect(tokens.length).toBe 3
[newOperator, whitespace, className] = tokens
expect(newOperator).toEqual value: 'new', scopes: ['source.coffee', 'meta.class.instance.constructor', 'keyword.operator.new.coffee']
expect(whitespace).toEqual value: ' ', scopes: ['source.coffee', 'meta.class.instance.constructor']
expect(className).toEqual value: 'foo.bar.Baz', scopes: ['source.coffee', 'meta.class.instance.constructor', 'entity.name.type.instance.coffee']
describe "when the line doesn't match any patterns", ->
it "returns the entire line as a single simple token with the grammar's scope", ->
textGrammar = atom.syntax.selectGrammar('foo.txt')
{tokens} = textGrammar.tokenizeLine("abc def")
expect(tokens.length).toBe 1
describe "when the line matches multiple patterns", ->
it "returns multiple tokens, filling in regions that don't match patterns with tokens in the grammar's global scope", ->
{tokens} = grammar.tokenizeLine(" return new foo.bar.Baz ")
expect(tokens.length).toBe 7
expect(tokens[0]).toEqual value: ' ', scopes: ['source.coffee']
expect(tokens[1]).toEqual value: 'return', scopes: ['source.coffee', 'keyword.control.coffee']
expect(tokens[2]).toEqual value: ' ', scopes: ['source.coffee']
expect(tokens[3]).toEqual value: 'new', scopes: ['source.coffee', 'meta.class.instance.constructor', 'keyword.operator.new.coffee']
expect(tokens[4]).toEqual value: ' ', scopes: ['source.coffee', 'meta.class.instance.constructor']
expect(tokens[5]).toEqual value: 'foo.bar.Baz', scopes: ['source.coffee', 'meta.class.instance.constructor', 'entity.name.type.instance.coffee']
expect(tokens[6]).toEqual value: ' ', scopes: ['source.coffee']
describe "when the line matches a pattern with optional capture groups", ->
it "only returns tokens for capture groups that matched", ->
{tokens} = grammar.tokenizeLine("class Quicksort")
expect(tokens.length).toBe 3
expect(tokens[0].value).toBe "class"
expect(tokens[1].value).toBe " "
expect(tokens[2].value).toBe "Quicksort"
describe "when the line matches a rule with nested capture groups and lookahead capture groups beyond the scope of the overall match", ->
it "creates distinct tokens for nested captures and does not return tokens beyond the scope of the overall capture", ->
{tokens} = grammar.tokenizeLine(" destroy: ->")
expect(tokens.length).toBe 6
expect(tokens[0]).toEqual(value: ' ', scopes: ["source.coffee"])
expect(tokens[1]).toEqual(value: 'destro', scopes: ["source.coffee", "meta.function.coffee", "entity.name.function.coffee"])
# this dangling 'y' with a duplicated scope looks wrong, but textmate yields the same behavior. probably a quirk in the coffee grammar.
expect(tokens[2]).toEqual(value: 'y', scopes: ["source.coffee", "meta.function.coffee", "entity.name.function.coffee", "entity.name.function.coffee"])
expect(tokens[3]).toEqual(value: ':', scopes: ["source.coffee", "keyword.operator.coffee"])
expect(tokens[4]).toEqual(value: ' ', scopes: ["source.coffee"])
expect(tokens[5]).toEqual(value: '->', scopes: ["source.coffee", "storage.type.function.coffee"])
describe "when the line matches a pattern that includes a rule", ->
it "returns tokens based on the included rule", ->
{tokens} = grammar.tokenizeLine("7777777")
expect(tokens.length).toBe 1
expect(tokens[0]).toEqual value: '7777777', scopes: ['source.coffee', 'constant.numeric.coffee']
describe "when the line is an interpolated string", ->
it "returns the correct tokens", ->
{tokens} = grammar.tokenizeLine('"the value is #{@x} my friend"')
expect(tokens[0]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","punctuation.definition.string.begin.coffee"]
expect(tokens[1]).toEqual value: "the value is ", scopes: ["source.coffee","string.quoted.double.coffee"]
expect(tokens[2]).toEqual value: '#{', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[3]).toEqual value: "@x", scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","variable.other.readwrite.instance.coffee"]
expect(tokens[4]).toEqual value: "}", scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[5]).toEqual value: " my friend", scopes: ["source.coffee","string.quoted.double.coffee"]
expect(tokens[6]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","punctuation.definition.string.end.coffee"]
describe "when the line has an interpolated string inside an interpolated string", ->
it "returns the correct tokens", ->
{tokens} = grammar.tokenizeLine('"#{"#{@x}"}"')
expect(tokens[0]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","punctuation.definition.string.begin.coffee"]
expect(tokens[1]).toEqual value: '#{', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[2]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","string.quoted.double.coffee","punctuation.definition.string.begin.coffee"]
expect(tokens[3]).toEqual value: '#{', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[4]).toEqual value: '@x', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","string.quoted.double.coffee","source.coffee.embedded.source","variable.other.readwrite.instance.coffee"]
expect(tokens[5]).toEqual value: '}', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[6]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","string.quoted.double.coffee","punctuation.definition.string.end.coffee"]
expect(tokens[7]).toEqual value: '}', scopes: ["source.coffee","string.quoted.double.coffee","source.coffee.embedded.source","punctuation.section.embedded.coffee"]
expect(tokens[8]).toEqual value: '"', scopes: ["source.coffee","string.quoted.double.coffee","punctuation.definition.string.end.coffee"]
describe "when the line is empty", ->
it "returns a single token which has the global scope", ->
{tokens} = grammar.tokenizeLine('')
expect(tokens[0]).toEqual value: '', scopes: ["source.coffee"]
describe "when the line matches no patterns", ->
it "does not infinitely loop", ->
grammar = atom.syntax.selectGrammar("sample.txt")
{tokens} = grammar.tokenizeLine('hoo')
expect(tokens.length).toBe 1
expect(tokens[0]).toEqual value: 'hoo', scopes: ["text.plain", "meta.paragraph.text"]
describe "when the line matches a pattern with a 'contentName'", ->
it "creates tokens using the content of contentName as the token name", ->
grammar = atom.syntax.selectGrammar("sample.txt")
{tokens} = grammar.tokenizeLine('ok, cool')
expect(tokens[0]).toEqual value: 'ok, cool', scopes: ["text.plain", "meta.paragraph.text"]
describe "when the line matches a pattern with no `name` or `contentName`", ->
it "creates tokens without adding a new scope", ->
grammar = atom.syntax.selectGrammar('foo.rb')
{tokens} = grammar.tokenizeLine('%w|oh \\look|')
expect(tokens.length).toBe 5
expect(tokens[0]).toEqual value: '%w|', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby", "punctuation.definition.string.begin.ruby"]
expect(tokens[1]).toEqual value: 'oh ', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby"]
expect(tokens[2]).toEqual value: '\\l', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby"]
expect(tokens[3]).toEqual value: 'ook', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby"]
describe "when the line matches a begin/end pattern", ->
it "returns tokens based on the beginCaptures, endCaptures and the child scope", ->
{tokens} = grammar.tokenizeLine("'''single-quoted heredoc'''")
expect(tokens.length).toBe 3
expect(tokens[0]).toEqual value: "'''", scopes: ['source.coffee', 'string.quoted.heredoc.coffee', 'punctuation.definition.string.begin.coffee']
expect(tokens[1]).toEqual value: "single-quoted heredoc", scopes: ['source.coffee', 'string.quoted.heredoc.coffee']
expect(tokens[2]).toEqual value: "'''", scopes: ['source.coffee', 'string.quoted.heredoc.coffee', 'punctuation.definition.string.end.coffee']
describe "when the pattern spans multiple lines", ->
it "uses the ruleStack returned by the first line to parse the second line", ->
{tokens: firstTokens, ruleStack} = grammar.tokenizeLine("'''single-quoted")
{tokens: secondTokens, ruleStack} = grammar.tokenizeLine("heredoc'''", ruleStack)
expect(firstTokens.length).toBe 2
expect(secondTokens.length).toBe 2
expect(firstTokens[0]).toEqual value: "'''", scopes: ['source.coffee', 'string.quoted.heredoc.coffee', 'punctuation.definition.string.begin.coffee']
expect(firstTokens[1]).toEqual value: "single-quoted", scopes: ['source.coffee', 'string.quoted.heredoc.coffee']
expect(secondTokens[0]).toEqual value: "heredoc", scopes: ['source.coffee', 'string.quoted.heredoc.coffee']
expect(secondTokens[1]).toEqual value: "'''", scopes: ['source.coffee', 'string.quoted.heredoc.coffee', 'punctuation.definition.string.end.coffee']
describe "when the pattern contains sub-patterns", ->
it "returns tokens within the begin/end scope based on the sub-patterns", ->
{tokens} = grammar.tokenizeLine('"""heredoc with character escape \\t"""')
expect(tokens.length).toBe 4
expect(tokens[0]).toEqual value: '"""', scopes: ['source.coffee', 'string.quoted.double.heredoc.coffee', 'punctuation.definition.string.begin.coffee']
expect(tokens[1]).toEqual value: "heredoc with character escape ", scopes: ['source.coffee', 'string.quoted.double.heredoc.coffee']
expect(tokens[2]).toEqual value: "\\t", scopes: ['source.coffee', 'string.quoted.double.heredoc.coffee', 'constant.character.escape.coffee']
expect(tokens[3]).toEqual value: '"""', scopes: ['source.coffee', 'string.quoted.double.heredoc.coffee', 'punctuation.definition.string.end.coffee']
describe "when the end pattern contains a back reference", ->
it "constructs the end rule based on its back-references to captures in the begin rule", ->
grammar = atom.syntax.selectGrammar('foo.rb')
{tokens} = grammar.tokenizeLine('%w|oh|,')
expect(tokens.length).toBe 4
expect(tokens[0]).toEqual value: '%w|', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby", "punctuation.definition.string.begin.ruby"]
expect(tokens[1]).toEqual value: 'oh', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby"]
expect(tokens[2]).toEqual value: '|', scopes: ["source.ruby", "string.quoted.other.literal.lower.ruby", "punctuation.definition.string.end.ruby"]
expect(tokens[3]).toEqual value: ',', scopes: ["source.ruby", "punctuation.separator.object.ruby"]
it "allows the rule containing that end pattern to be pushed to the stack multiple times", ->
grammar = atom.syntax.selectGrammar('foo.rb')
{tokens} = grammar.tokenizeLine('%Q+matz had some #{%Q-crazy ideas-} for ruby syntax+ # damn.')
expect(tokens[0]).toEqual value: '%Q+', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","punctuation.definition.string.begin.ruby"]
expect(tokens[1]).toEqual value: 'matz had some ', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby"]
expect(tokens[2]).toEqual value: '#{', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","meta.embedded.line.ruby","punctuation.section.embedded.begin.ruby"]
expect(tokens[3]).toEqual value: '%Q-', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","meta.embedded.line.ruby","string.quoted.other.literal.upper.ruby","punctuation.definition.string.begin.ruby"]
expect(tokens[4]).toEqual value: 'crazy ideas', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","meta.embedded.line.ruby","string.quoted.other.literal.upper.ruby"]
expect(tokens[5]).toEqual value: '-', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","meta.embedded.line.ruby","string.quoted.other.literal.upper.ruby","punctuation.definition.string.end.ruby"]
expect(tokens[6]).toEqual value: '}', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","meta.embedded.line.ruby","punctuation.section.embedded.end.ruby", "source.ruby"]
expect(tokens[7]).toEqual value: ' for ruby syntax', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby"]
expect(tokens[8]).toEqual value: '+', scopes: ["source.ruby","string.quoted.other.literal.upper.ruby","punctuation.definition.string.end.ruby"]
expect(tokens[9]).toEqual value: ' ', scopes: ["source.ruby"]
expect(tokens[10]).toEqual value: '#', scopes: ["source.ruby","comment.line.number-sign.ruby","punctuation.definition.comment.ruby"]
expect(tokens[11]).toEqual value: ' damn.', scopes: ["source.ruby","comment.line.number-sign.ruby"]
describe "when the pattern includes rules from another grammar", ->
describe "when a grammar matching the desired scope is available", ->
it "parses tokens inside the begin/end patterns based on the included grammar's rules", ->
atom.packages.activatePackage('language-html', sync: true)
atom.packages.activatePackage('language-ruby-on-rails', sync: true)
grammar = atom.syntax.grammarForScopeName('text.html.ruby')
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"]
expect(tokens[1]).toEqual value: 'div', scopes: ["text.html.ruby","meta.tag.block.any.html","entity.name.tag.block.any.html"]
expect(tokens[2]).toEqual value: ' ', scopes: ["text.html.ruby","meta.tag.block.any.html"]
expect(tokens[3]).toEqual value: 'class', scopes: ["text.html.ruby","meta.tag.block.any.html", "entity.other.attribute-name.html"]
expect(tokens[4]).toEqual value: '=', scopes: ["text.html.ruby","meta.tag.block.any.html"]
expect(tokens[5]).toEqual value: '\'', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html","punctuation.definition.string.begin.html"]
expect(tokens[6]).toEqual value: 'name', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html"]
expect(tokens[7]).toEqual value: '\'', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html","punctuation.definition.string.end.html"]
expect(tokens[8]).toEqual value: '>', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.end.html"]
expect(tokens[9]).toEqual value: '<%=', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.embedded.ruby"]
expect(tokens[10]).toEqual value: ' ', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
expect(tokens[11]).toEqual value: 'User', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","support.class.ruby"]
expect(tokens[12]).toEqual value: '.', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.separator.method.ruby"]
expect(tokens[13]).toEqual value: 'find', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
expect(tokens[14]).toEqual value: '(', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.function.ruby"]
expect(tokens[15]).toEqual value: '2', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","constant.numeric.ruby"]
expect(tokens[16]).toEqual value: ')', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.function.ruby"]
expect(tokens[17]).toEqual value: '.', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.separator.method.ruby"]
expect(tokens[18]).toEqual value: 'full_name ', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
expect(tokens[19]).toEqual value: '%>', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.embedded.ruby"]
expect(tokens[20]).toEqual value: '</', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"]
expect(tokens[21]).toEqual value: 'div', scopes: ["text.html.ruby","meta.tag.block.any.html","entity.name.tag.block.any.html"]
expect(tokens[22]).toEqual value: '>', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.end.html"]
it "updates the grammar if the included grammar is updated later", ->
atom.packages.activatePackage('language-html', sync: true)
atom.packages.activatePackage('language-ruby-on-rails', sync: true)
grammar = atom.syntax.selectGrammar('foo.html.erb')
grammarUpdatedHandler = jasmine.createSpy("grammarUpdatedHandler")
grammar.on 'grammar-updated', grammarUpdatedHandler
{tokens} = grammar.tokenizeLine("<div class='name'><% <<-SQL select * from users;")
expect(tokens[12].value).toBe " select * from users;"
atom.packages.activatePackage('language-sql', sync: true)
expect(grammarUpdatedHandler).toHaveBeenCalled()
{tokens} = grammar.tokenizeLine("<div class='name'><% <<-SQL select * from users;")
expect(tokens[12].value).toBe " "
expect(tokens[13].value).toBe "select"
describe "when a grammar matching the desired scope is unavailable", ->
it "updates the grammar if a matching grammar is added later", ->
atom.packages.deactivatePackage('language-html')
atom.packages.activatePackage('language-ruby-on-rails', sync: true)
grammar = atom.syntax.grammarForScopeName('text.html.ruby')
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
expect(tokens[0]).toEqual value: "<div class='name'>", scopes: ["text.html.ruby"]
expect(tokens[1]).toEqual value: '<%=', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.embedded.ruby"]
expect(tokens[2]).toEqual value: ' ', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
expect(tokens[3]).toEqual value: 'User', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","support.class.ruby"]
atom.packages.activatePackage('language-html', sync: true)
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"]
expect(tokens[1]).toEqual value: 'div', scopes: ["text.html.ruby","meta.tag.block.any.html","entity.name.tag.block.any.html"]
expect(tokens[2]).toEqual value: ' ', scopes: ["text.html.ruby","meta.tag.block.any.html"]
expect(tokens[3]).toEqual value: 'class', scopes: ["text.html.ruby","meta.tag.block.any.html", "entity.other.attribute-name.html"]
expect(tokens[4]).toEqual value: '=', scopes: ["text.html.ruby","meta.tag.block.any.html"]
expect(tokens[5]).toEqual value: '\'', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html","punctuation.definition.string.begin.html"]
expect(tokens[6]).toEqual value: 'name', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html"]
expect(tokens[7]).toEqual value: '\'', scopes: ["text.html.ruby","meta.tag.block.any.html","string.quoted.single.html","punctuation.definition.string.end.html"]
expect(tokens[8]).toEqual value: '>', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.end.html"]
expect(tokens[9]).toEqual value: '<%=', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","punctuation.section.embedded.ruby"]
expect(tokens[10]).toEqual value: ' ', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
it "can parse a grammar with newline characters in its regular expressions (regression)", ->
grammar = new TextMateGrammar
name: "test"
scopeName: "source.imaginaryLanguage"
repository: {}
patterns: [
{
name: "comment-body"
begin: "//"
end: "\\n"
beginCaptures:
"0": { name: "comment-start" }
}
]
{tokens, ruleStack} = grammar.tokenizeLine("// a singleLineComment")
expect(ruleStack.length).toBe 1
expect(ruleStack[0].scopeName).toBe "source.imaginaryLanguage"
expect(tokens.length).toBe 2
expect(tokens[0].value).toBe "//"
expect(tokens[1].value).toBe " a singleLineComment"
it "does not loop infinitely (regression)", ->
grammar = atom.syntax.selectGrammar("hello.js")
{tokens, ruleStack} = grammar.tokenizeLine("// line comment")
{tokens, ruleStack} = grammar.tokenizeLine(" // second line comment with a single leading space", ruleStack)
describe "when inside a C block", ->
beforeEach ->
atom.packages.activatePackage('language-c', sync: true)
it "correctly parses a method. (regression)", ->
grammar = atom.syntax.selectGrammar("hello.c")
{tokens, ruleStack} = grammar.tokenizeLine("if(1){m()}")
expect(tokens[5]).toEqual value: "m", scopes: ["source.c", "meta.block.c", "meta.function-call.c", "support.function.any-method.c"]
it "correctly parses nested blocks. (regression)", ->
grammar = atom.syntax.selectGrammar("hello.c")
{tokens, ruleStack} = grammar.tokenizeLine("if(1){if(1){m()}}")
expect(tokens[5]).toEqual value: "if", scopes: ["source.c", "meta.block.c", "keyword.control.c"]
expect(tokens[10]).toEqual value: "m", scopes: ["source.c", "meta.block.c", "meta.block.c", "meta.function-call.c", "support.function.any-method.c"]
describe "when the grammar can infinitely loop over a line", ->
it "aborts tokenization", ->
spyOn(console, 'error')
atom.packages.activatePackage("package-with-infinite-loop-grammar")
grammar = atom.syntax.selectGrammar("something.package-with-infinite-loop-grammar")
{tokens} = grammar.tokenizeLine("abc")
expect(tokens[0].value).toBe "a"
expect(tokens[1].value).toBe "bc"
expect(console.error).toHaveBeenCalled()
describe "when a grammar has a pattern that has back references in the match value", ->
it "does not special handle the back references and instead allows oniguruma to resolve them", ->
atom.packages.activatePackage('language-sass', sync: true)
grammar = atom.syntax.selectGrammar("style.scss")
{tokens} = grammar.tokenizeLine("@mixin x() { -moz-selector: whatever; }")
expect(tokens[9]).toEqual value: "-moz-selector", scopes: ["source.css.scss", "meta.property-list.scss", "meta.property-name.scss"]
describe "when a line has more tokens than `maxTokensPerLine`", ->
it "creates a final token with the remaining text and resets the ruleStack to match the begining of the line", ->
grammar = atom.syntax.selectGrammar("hello.js")
spyOn(grammar, 'getMaxTokensPerLine').andCallFake -> 5
originalRuleStack = [grammar.initialRule, grammar.initialRule, grammar.initialRule]
{tokens, ruleStack} = grammar.tokenizeLine("one(two(three(four(five(_param_)))))", originalRuleStack)
expect(tokens.length).toBe 5
expect(tokens[4].value).toBe "three(four(five(_param_)))))"
expect(ruleStack).toEqual originalRuleStack
describe "when a grammar has a capture with patterns", ->
it "matches the patterns and includes the scope specified as the pattern's match name", ->
grammar = atom.syntax.selectGrammar("hello.php")
{tokens} = grammar.tokenizeLine("<?php public final function meth() {} ?>")
expect(tokens[2].value).toBe "public"
expect(tokens[2].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php", "storage.modifier.php"]
expect(tokens[3].value).toBe " "
expect(tokens[3].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php"]
expect(tokens[4].value).toBe "final"
expect(tokens[4].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php", "storage.modifier.php"]
expect(tokens[5].value).toBe " "
expect(tokens[5].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php"]
expect(tokens[6].value).toBe "function"
expect(tokens[6].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php", "storage.type.function.php"]
it "ignores child captures of a capture with patterns", ->
grammar = new TextMateGrammar
name: "test"
scopeName: "source"
repository: {}
patterns: [
{
name: "text"
match: "(a(b))"
captures:
"1":
patterns: [
{
match: "ab"
name: "a"
}
]
"2":
name: "b"
}
]
{tokens} = grammar.tokenizeLine("ab")
expect(tokens[0].value).toBe "ab"
expect(tokens[0].scopes).toEqual ["source", "text", "a"]
describe "when the grammar has injections", ->
it "correctly includes the injected patterns when tokenizing", ->
grammar = atom.syntax.selectGrammar("hello.php")
{tokens} = grammar.tokenizeLine("<div><?php function hello() {} ?></div>")
expect(tokens[3].value).toBe "<?php"
expect(tokens[3].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "punctuation.section.embedded.begin.php"]
expect(tokens[5].value).toBe "function"
expect(tokens[5].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php", "storage.type.function.php"]
expect(tokens[7].value).toBe "hello"
expect(tokens[7].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "meta.function.php", "entity.name.function.php"]
expect(tokens[14].value).toBe "?"
expect(tokens[14].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "source.php", "punctuation.section.embedded.end.php", "source.php"]
expect(tokens[15].value).toBe ">"
expect(tokens[15].scopes).toEqual ["text.html.php", "meta.embedded.line.php", "punctuation.section.embedded.end.php"]
expect(tokens[16].value).toBe "</"
expect(tokens[16].scopes).toEqual ["text.html.php", "meta.tag.block.any.html", "punctuation.definition.tag.begin.html"]
expect(tokens[17].value).toBe "div"
expect(tokens[17].scopes).toEqual ["text.html.php", "meta.tag.block.any.html", "entity.name.tag.block.any.html"]
describe "when the grammar's pattern name has a group number in it", ->
it "replaces the group number with the matched captured text", ->
atom.packages.activatePackage('language-hyperlink', sync: true)
grammar = atom.syntax.grammarForScopeName("text.hyperlink")
{tokens} = grammar.tokenizeLine("https://github.com")
expect(tokens[0].scopes).toEqual ["text.hyperlink", "markup.underline.link.https.hyperlink"]
describe "when the grammar has an injection selector", ->
it "includes the grammar's patterns when the selector matches the current scope in other grammars", ->
atom.packages.activatePackage('language-hyperlink', sync: true)
grammar = atom.syntax.selectGrammar("text.js")
{tokens} = grammar.tokenizeLine("var i; // http://github.com")
expect(tokens[0].value).toBe "var"
expect(tokens[0].scopes).toEqual ["source.js", "storage.modifier.js"]
expect(tokens[6].value).toBe "http://github.com"
expect(tokens[6].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"]
describe "when the grammar is added", ->
it "retokenizes existing buffers that contain tokens that match the injection selector", ->
editor = atom.project.openSync('sample.js')
editor.setText("// http://github.com")
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " http://github.com"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.packages.activatePackage('language-hyperlink', sync: true)
{tokens} = editor.lineForScreenRow(0)
expect(tokens[2].value).toBe "http://github.com"
expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"]
describe "when the grammar is updated", ->
it "retokenizes existing buffers that contain tokens that match the injection selector", ->
editor = atom.project.openSync('sample.js')
editor.setText("// SELECT * FROM OCTOCATS")
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.syntax.addGrammar(new TextMateGrammar(
name: "test"
scopeName: "source.test"
repository: {}
injectionSelector: "comment"
patterns: [ { include: "source.sql" } ]
))
{tokens} = editor.lineForScreenRow(0)
expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS"
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
atom.packages.activatePackage('language-sql', sync: true)
{tokens} = editor.lineForScreenRow(0)
expect(tokens[2].value).toBe "SELECT"
expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "keyword.other.DML.sql"]
describe "when the position doesn't advance and rule includes $self and matches itself", ->
it "tokenizes the entire line using the rule", ->
grammar = new TextMateGrammar
name: "test"
scopeName: "source"
repository: {}
patterns: [
{
name: "text"
begin: "(?=forever)"
end: "whatevs"
patterns: [
include: "$self"
]
}
]
{tokens} = grammar.tokenizeLine("forever and ever")
expect(tokens.length).toBe 1
expect(tokens[0].value).toBe "forever and ever"
expect(tokens[0].scopes).toEqual ["source", "text"]
describe "${capture:/command} style pattern names", ->
lines = null
beforeEach ->
atom.packages.activatePackage('language-todo', sync: true)
grammar = atom.syntax.selectGrammar('main.rb')
lines = grammar.tokenizeLines "# TODO be nicer"
it "replaces the number with the capture group and translates the text", ->
tokens = lines[0]
expect(tokens[2].value).toEqual "TODO"
expect(tokens[2].scopes).toEqual ["source.ruby", "comment.line.number-sign.ruby", "storage.type.class.todo"]
describe "language-specific integration tests", ->
lines = null
describe "Git commit messages", ->
beforeEach ->
atom.packages.activatePackage('language-git', sync: true)
grammar = atom.syntax.selectGrammar('COMMIT_EDITMSG')
lines = grammar.tokenizeLines """
longggggggggggggggggggggggggggggggggggggggggggggggg
# Please enter the commit message for your changes. Lines starting
"""
it "correctly parses a long line", ->
tokens = lines[0]
expect(tokens[0].value).toBe "longggggggggggggggggggggggggggggggggggggggggggggggg"
expect(tokens[0].scopes).toEqual ["text.git-commit", "meta.scope.message.git-commit", "invalid.deprecated.line-too-long.git-commit"]
it "correctly parses the number sign of the first comment line", ->
tokens = lines[1]
expect(tokens[0].value).toBe "#"
expect(tokens[0].scopes).toEqual ["text.git-commit", "meta.scope.metadata.git-commit", "comment.line.number-sign.git-commit", "punctuation.definition.comment.git-commit"]
describe "C++", ->
beforeEach ->
atom.packages.activatePackage('language-c', sync: true)
grammar = atom.syntax.selectGrammar('includes.cc')
lines = grammar.tokenizeLines """
#include "a.h"
#include "b.h"
"""
it "correctly parses the first include line", ->
tokens = lines[0]
expect(tokens[0].value).toBe "#"
expect(tokens[0].scopes).toEqual ["source.c++", "meta.preprocessor.c.include"]
expect(tokens[1].value).toBe 'include'
expect(tokens[1].scopes).toEqual ["source.c++", "meta.preprocessor.c.include", "keyword.control.import.include.c"]
it "correctly parses the second include line", ->
tokens = lines[1]
expect(tokens[0].value).toBe "#"
expect(tokens[0].scopes).toEqual ["source.c++", "meta.preprocessor.c.include"]
expect(tokens[1].value).toBe 'include'
expect(tokens[1].scopes).toEqual ["source.c++", "meta.preprocessor.c.include", "keyword.control.import.include.c"]
describe "Ruby", ->
beforeEach ->
grammar = atom.syntax.selectGrammar('hello.rb')
lines = grammar.tokenizeLines """
a = {
"b" => "c",
}
"""
it "doesn't loop infinitely (regression)", ->
expect(_.pluck(lines[0], 'value').join('')).toBe 'a = {'
expect(_.pluck(lines[1], 'value').join('')).toBe ' "b" => "c",'
expect(_.pluck(lines[2], 'value').join('')).toBe '}'
expect(_.pluck(lines[3], 'value').join('')).toBe ''
describe "Objective-C", ->
beforeEach ->
atom.packages.activatePackage('language-c', sync: true)
atom.packages.activatePackage('language-objective-c', sync: true)
grammar = atom.syntax.selectGrammar('function.mm')
lines = grammar.tokenizeLines """
void test() {
NSString *a = @"a\\nb";
}
"""
it "correctly parses variable type when it is a built-in Cocoa class", ->
tokens = lines[1]
expect(tokens[0].value).toBe "NSString"
expect(tokens[0].scopes).toEqual ["source.objc++", "meta.function.c", "meta.block.c", "support.class.cocoa"]
it "correctly parses the semicolon at the end of the line", ->
tokens = lines[1]
lastToken = _.last(tokens)
expect(lastToken.value).toBe ";"
expect(lastToken.scopes).toEqual ["source.objc++", "meta.function.c", "meta.block.c"]
it "correctly parses the string characters before the escaped character", ->
tokens = lines[1]
expect(tokens[2].value).toBe '@"'
expect(tokens[2].scopes).toEqual ["source.objc++", "meta.function.c", "meta.block.c", "string.quoted.double.objc", "punctuation.definition.string.begin.objc"]
describe "Java", ->
beforeEach ->
atom.packages.activatePackage('language-java', sync: true)
grammar = atom.syntax.selectGrammar('Function.java')
it "correctly parses single line comments", ->
lines = grammar.tokenizeLines """
public void test() {
//comment
}
"""
tokens = lines[1]
expect(tokens[0].scopes).toEqual ["source.java", "comment.line.double-slash.java", "punctuation.definition.comment.java"]
expect(tokens[0].value).toEqual '//'
expect(tokens[1].scopes).toEqual ["source.java", "comment.line.double-slash.java"]
expect(tokens[1].value).toEqual 'comment'
it "correctly parses nested method calls", ->
tokens = grammar.tokenizeLines('a(b(new Object[0]));')[0]
lastToken = _.last(tokens)
expect(lastToken.scopes).toEqual ['source.java', 'punctuation.terminator.java']
expect(lastToken.value).toEqual ';'
describe "HTML (Ruby - ERB)", ->
it "correctly parses strings inside tags", ->
grammar = atom.syntax.selectGrammar('page.erb')
lines = grammar.tokenizeLines '<% page_title "My Page" %>'
tokens = lines[0]
expect(tokens[2].value).toEqual '"'
expect(tokens[2].scopes).toEqual ["text.html.erb", "meta.embedded.line.erb", "string.quoted.double.ruby", "punctuation.definition.string.begin.ruby"]
expect(tokens[3].value).toEqual 'My Page'
expect(tokens[3].scopes).toEqual ["text.html.erb", "meta.embedded.line.erb", "string.quoted.double.ruby"]
expect(tokens[4].value).toEqual '"'
expect(tokens[4].scopes).toEqual ["text.html.erb", "meta.embedded.line.erb", "string.quoted.double.ruby", "punctuation.definition.string.end.ruby"]
it "does not loop infinitely on <%>", ->
atom.packages.activatePackage('language-html', sync: true)
atom.packages.activatePackage('language-ruby-on-rails', sync: true)
grammar = atom.syntax.selectGrammar('foo.html.erb')
[tokens] = grammar.tokenizeLines '<%>'
expect(tokens.length).toBe 1
expect(tokens[0].value).toEqual '<%>'
expect(tokens[0].scopes).toEqual ["text.html.erb"]
describe "Unicode support", ->
describe "Surrogate pair characters", ->
beforeEach ->
grammar = atom.syntax.selectGrammar('main.js')
lines = grammar.tokenizeLines "'\uD835\uDF97'"
it "correctly parses JavaScript strings containing surrogate pair characters", ->
tokens = lines[0]
expect(tokens.length).toBe 3
expect(tokens[0].value).toBe "'"
expect(tokens[1].value).toBe "\uD835\uDF97"
expect(tokens[2].value).toBe "'"
describe "when the line contains unicode characters", ->
it "correctly parses tokens starting after them", ->
atom.packages.activatePackage('language-json', sync: true)
grammar = atom.syntax.selectGrammar('package.json')
{tokens} = grammar.tokenizeLine '{"\u2026": 1}'
expect(tokens.length).toBe 8
expect(tokens[6].value).toBe '1'
expect(tokens[6].scopes).toEqual ["source.json", "meta.structure.dictionary.json", "meta.structure.dictionary.value.json", "constant.numeric.json"]
describe "python", ->
it "parses import blocks correctly", ->
grammar = atom.syntax.selectGrammar("file.py")
lines = grammar.tokenizeLines "import a\nimport b"
line1 = lines[0]
expect(line1.length).toBe 3
expect(line1[0].value).toEqual "import"
expect(line1[0].scopes).toEqual ["source.python", "keyword.control.import.python"]
expect(line1[1].value).toEqual " "
expect(line1[1].scopes).toEqual ["source.python"]
expect(line1[2].value).toEqual "a"
expect(line1[2].scopes).toEqual ["source.python"]
line2 = lines[1]
expect(line2.length).toBe 3
expect(line2[0].value).toEqual "import"
expect(line2[0].scopes).toEqual ["source.python", "keyword.control.import.python"]
expect(line2[1].value).toEqual " "
expect(line2[1].scopes).toEqual ["source.python"]
expect(line2[2].value).toEqual "b"
expect(line2[2].scopes).toEqual ["source.python"]
+33 -5
Ver Arquivo
@@ -1,5 +1,7 @@
path = require 'path'
{$, $$, fs, WorkspaceView} = require 'atom'
temp = require 'temp'
ThemeManager = require '../src/theme-manager'
AtomPackage = require '../src/atom-package'
@@ -32,14 +34,14 @@ describe "ThemeManager", ->
describe "getImportPaths()", ->
it "returns the theme directories before the themes are loaded", ->
atom.config.set('core.themes', ['atom-dark-syntax', 'atom-dark-ui', 'atom-light-ui'])
atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui', 'atom-light-ui'])
paths = themeManager.getImportPaths()
# syntax theme is not a dir at this time, so only two.
expect(paths.length).toBe 2
expect(paths[0]).toContain 'atom-dark-ui'
expect(paths[1]).toContain 'atom-light-ui'
expect(paths[0]).toContain 'atom-light-ui'
expect(paths[1]).toContain 'atom-dark-ui'
it "ignores themes that cannot be resolved to a directory", ->
atom.config.set('core.themes', ['definitely-not-a-theme'])
@@ -67,8 +69,8 @@ describe "ThemeManager", ->
atom.config.set('core.themes', [])
expect($('style.theme').length).toBe 0
# atom-dark-ui has an directory path, the syntax ones dont.
atom.config.set('core.themes', ['atom-light-syntax', 'atom-dark-ui', 'atom-dark-syntax'])
# atom-dark-ui has an directory path, the syntax one doesn't
atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui'])
importPaths = themeManager.getImportPaths()
expect(importPaths.length).toBe 1
expect(importPaths[0]).toContain 'atom-dark-ui'
@@ -155,3 +157,29 @@ describe "ThemeManager", ->
expect($(".editor").css("padding-top")).toBe "150px"
expect($(".editor").css("padding-right")).toBe "150px"
expect($(".editor").css("padding-bottom")).toBe "150px"
describe "when the user stylesheet changes", ->
it "reloads it", ->
userStylesheetPath = path.join(temp.mkdirSync("atom"), 'styles.css')
fs.writeFileSync(userStylesheetPath, 'body {border-style: dotted !important;}')
spyOn(themeManager, 'getUserStylesheetPath').andReturn userStylesheetPath
themeManager.activateThemes()
expect($(document.body).css('border-style')).toBe 'dotted'
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
waitsFor ->
themeManager.loadUserStylesheet.callCount is 1
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
fs.removeSync(userStylesheetPath)
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
runs ->
expect($(document.body).css('border-style')).toBe 'none'
+10 -8
Ver Arquivo
@@ -18,14 +18,6 @@ describe "TokenizedBuffer", ->
advanceClock() while tokenizedBuffer.firstInvalidRow()?
changeHandler?.reset()
describe "@deserialize(state)", ->
it "constructs a tokenized buffer with the same buffer and tabLength setting", ->
buffer = atom.project.bufferForPathSync('sample.js')
tokenizedBuffer1 = new TokenizedBuffer(buffer: buffer, tabLength: 4)
tokenizedBuffer2 = atom.deserializers.deserialize(tokenizedBuffer1.serialize())
expect(tokenizedBuffer2.buffer).toBe tokenizedBuffer1.buffer
expect(tokenizedBuffer2.getTabLength()).toBe tokenizedBuffer1.getTabLength()
describe "when the buffer is destroyed", ->
beforeEach ->
buffer = atom.project.bufferForPathSync('sample.js')
@@ -434,3 +426,13 @@ describe "TokenizedBuffer", ->
describe "when the selector matches a run of multiple tokens at the position", ->
it "returns the range covered by all contigous tokens (within a single line)", ->
expect(tokenizedBuffer.bufferRangeForScopeAtPosition('.function', [1, 18])).toEqual [[1, 6], [1, 28]]
describe "when the editor.tabLength config value changes", ->
it "updates the tab length of the tokenized lines", ->
buffer = atom.project.bufferForPathSync('sample.js')
buffer.setText('\ttest')
tokenizedBuffer = new TokenizedBuffer({buffer})
fullyTokenize(tokenizedBuffer)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
atom.config.set('editor.tabLength', 6)
expect(tokenizedBuffer.tokenForPosition([0,0]).value).toBe ' '
+11 -6
Ver Arquivo
@@ -1,5 +1,6 @@
{$, $$, fs} = require 'atom'
path = require 'path'
Editor = require '../src/editor'
WindowEventHandler = require '../src/window-event-handler'
describe "Window", ->
@@ -7,8 +8,11 @@ describe "Window", ->
beforeEach ->
spyOn(atom, 'hide')
atom.getLoadSettings() # Causes atom.loadSettings to be initialized
atom.loadSettings.initialPath = atom.project.getPath()
initialPath = atom.project.getPath()
spyOn(atom, 'getLoadSettings').andCallFake ->
loadSettings = atom.getLoadSettings.originalValue.call(atom)
loadSettings.initialPath = initialPath
loadSettings
atom.project.destroy()
windowEventHandler = new WindowEventHandler()
atom.deserializeEditorWindow()
@@ -55,6 +59,7 @@ describe "Window", ->
[beforeUnloadEvent] = []
beforeEach ->
jasmine.unspy(Editor.prototype, "shouldPromptToSave")
beforeUnloadEvent = $.Event(new Event('beforeunload'))
describe "when pane items are are modified", ->
@@ -83,14 +88,14 @@ describe "Window", ->
describe ".unloadEditorWindow()", ->
it "saves the serialized state of the window so it can be deserialized after reload", ->
workspaceViewState = atom.workspaceView.serialize()
workspaceState = atom.workspace.serialize()
syntaxState = atom.syntax.serialize()
atom.unloadEditorWindow()
expect(atom.getWindowState().getObject('workspaceView')).toEqual workspaceViewState.toObject()
expect(atom.getWindowState().getObject('syntax')).toEqual syntaxState
expect(atom.saveWindowState).toHaveBeenCalled()
expect(atom.state.workspace).toEqual workspaceState
expect(atom.state.syntax).toEqual syntaxState
expect(atom.saveSync).toHaveBeenCalled()
it "unsubscribes from all buffers", ->
atom.workspaceView.openSync('sample.js')
+195
Ver Arquivo
@@ -0,0 +1,195 @@
Workspace = require '../src/workspace'
describe "Workspace", ->
workspace = null
beforeEach ->
atom.project.setPath(atom.project.resolve('dir'))
workspace = new Workspace
describe "::open(uri)", ->
beforeEach ->
spyOn(workspace.activePane, 'activate')
describe "when called without a uri", ->
it "adds and activates an empty editor on the active pane", ->
editor = null
waitsForPromise ->
workspace.open().then (o) -> editor = o
runs ->
expect(editor.getPath()).toBeUndefined()
expect(workspace.activePane.items).toEqual [editor]
expect(workspace.activePaneItem).toBe editor
expect(workspace.activePane.activate).toHaveBeenCalled()
describe "when called with a uri", ->
describe "when the active pane already has an editor for the given uri", ->
it "activates the existing editor on the active pane", ->
editor1 = workspace.openSync('a')
editor2 = workspace.openSync('b')
editor = null
waitsForPromise ->
workspace.open('a').then (o) -> editor = o
runs ->
expect(editor).toBe editor1
expect(workspace.activePaneItem).toBe editor
expect(workspace.activePane.activate).toHaveBeenCalled()
describe "when the active pane does not have an editor for the given uri", ->
it "adds and activates a new editor for the given path on the active pane", ->
editor = null
waitsForPromise ->
workspace.open('a').then (o) -> editor = o
runs ->
expect(editor.getUri()).toBe 'a'
expect(workspace.activePaneItem).toBe editor
expect(workspace.activePane.items).toEqual [editor]
expect(workspace.activePane.activate).toHaveBeenCalled()
describe "::openSync(uri, options)", ->
[activePane, initialItemCount] = []
beforeEach ->
activePane = workspace.activePane
spyOn(activePane, 'activate')
initialItemCount = activePane.items.length
describe "when called without a uri", ->
it "adds and activates an empty editor on the active pane", ->
editor = workspace.openSync()
expect(activePane.items.length).toBe initialItemCount + 1
expect(activePane.activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(activePane.activate).toHaveBeenCalled()
describe "when called with a uri", ->
describe "when the active pane already has an editor for the given uri", ->
it "activates the existing editor on the active pane", ->
editor1 = workspace.openSync('a')
editor2 = workspace.openSync('b')
expect(activePane.activeItem).toBe editor2
expect(activePane.items.length).toBe 2
editor = workspace.openSync(editor1.getPath())
expect(editor).toBe editor1
expect(activePane.activeItem).toBe editor
expect(activePane.activate).toHaveBeenCalled()
expect(activePane.items.length).toBe 2
describe "when the active pane does not have an editor for the given uri", ->
it "adds and activates a new editor for the given path on the active pane", ->
editor = workspace.openSync('a')
expect(activePane.items.length).toBe 1
expect(activePane.activeItem).toBe editor
expect(activePane.activate).toHaveBeenCalled()
describe "when the 'activatePane' option is false", ->
it "does not activate the active pane", ->
workspace.openSync('b', activatePane: false)
expect(activePane.activate).not.toHaveBeenCalled()
describe "::openSingletonSync(uri, options)", ->
describe "when an editor for the given uri is already open on the active pane", ->
it "activates the existing editor", ->
editor1 = workspace.openSync('a')
editor2 = workspace.openSync('b')
expect(workspace.activePaneItem).toBe editor2
workspace.openSingletonSync('a')
expect(workspace.activePaneItem).toBe editor1
describe "when an editor for the given uri is already open on an inactive pane", ->
it "activates the existing editor on the inactive pane, then activates that pane", ->
editor1 = workspace.openSync('a')
pane1 = workspace.activePane
pane2 = workspace.activePane.splitRight()
editor2 = workspace.openSync('b')
expect(workspace.activePaneItem).toBe editor2
workspace.openSingletonSync('a')
expect(workspace.activePane).toBe pane1
expect(workspace.activePaneItem).toBe editor1
describe "when no editor for the given uri is open in any pane", ->
it "opens an editor for the given uri in the active pane", ->
editor1 = workspace.openSingletonSync('a')
expect(workspace.activePaneItem).toBe editor1
describe "when the 'split' option is 'left'", ->
it "opens the editor in the leftmost pane of the current pane axis", ->
pane1 = workspace.activePane
pane2 = pane1.splitRight()
expect(workspace.activePane).toBe pane2
editor1 = workspace.openSingletonSync('a', split: 'left')
expect(workspace.activePane).toBe pane1
expect(pane1.items).toEqual [editor1]
expect(pane2.items).toEqual []
describe "when the 'split' option is 'right'", ->
describe "when the active pane is in a horizontal pane axis", ->
it "activates the editor on the rightmost pane of the current pane axis", ->
pane1 = workspace.activePane
pane2 = pane1.splitRight()
pane1.activate()
editor1 = workspace.openSingletonSync('a', split: 'right')
expect(workspace.activePane).toBe pane2
expect(pane2.items).toEqual [editor1]
expect(pane1.items).toEqual []
describe "when the active pane is not in a horizontal pane axis", ->
it "splits the current pane to the right, then activates the editor on the right pane", ->
pane1 = workspace.activePane
editor1 = workspace.openSingletonSync('a', split: 'right')
pane2 = workspace.activePane
expect(workspace.paneContainer.root.children).toEqual [pane1, pane2]
expect(pane2.items).toEqual [editor1]
expect(pane1.items).toEqual []
describe "::reopenItemSync()", ->
it "opens the uri associated with the last closed pane that isn't currently open", ->
pane = workspace.activePane
workspace.openSync('a')
workspace.openSync('b')
workspace.openSync('file1')
workspace.openSync()
# does not reopen items with no uri
expect(workspace.activePaneItem.getUri()).toBeUndefined()
pane.destroyActiveItem()
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).not.toBeUndefined()
# destroy all items
expect(workspace.activePaneItem.getUri()).toBe 'file1'
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe 'b'
pane.destroyActiveItem()
expect(workspace.activePaneItem.getUri()).toBe 'a'
pane.destroyActiveItem()
# reopens items with uris
expect(workspace.activePaneItem).toBeUndefined()
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).toBe 'a'
# does not reopen items that are already open
workspace.openSync('b')
expect(workspace.activePaneItem.getUri()).toBe 'b'
workspace.reopenItemSync()
expect(workspace.activePaneItem.getUri()).toBe 'file1'
describe "::increase/decreaseFontSize()", ->
it "increases/decreases the font size without going below 1", ->
atom.config.set('editor.fontSize', 1)
workspace.increaseFontSize()
expect(atom.config.get('editor.fontSize')).toBe 2
workspace.increaseFontSize()
expect(atom.config.get('editor.fontSize')).toBe 3
workspace.decreaseFontSize()
expect(atom.config.get('editor.fontSize')).toBe 2
workspace.decreaseFontSize()
expect(atom.config.get('editor.fontSize')).toBe 1
workspace.decreaseFontSize()
expect(atom.config.get('editor.fontSize')).toBe 1
+70 -355
Ver Arquivo
@@ -2,7 +2,8 @@
Q = require 'q'
path = require 'path'
temp = require 'temp'
Pane = require '../src/pane'
PaneView = require '../src/pane-view'
Workspace = require '../src/workspace'
describe "WorkspaceView", ->
pathToOpen = null
@@ -10,7 +11,8 @@ describe "WorkspaceView", ->
beforeEach ->
atom.project.setPath(atom.project.resolve('dir'))
pathToOpen = atom.project.resolve('a')
atom.workspaceView = new WorkspaceView
atom.workspace = new Workspace
atom.workspaceView = new WorkspaceView(atom.workspace)
atom.workspaceView.enableKeymap()
atom.workspaceView.openSync(pathToOpen)
atom.workspaceView.focus()
@@ -18,29 +20,28 @@ describe "WorkspaceView", ->
describe "@deserialize()", ->
viewState = null
refreshWorkspaceViewAndProject = ->
workspaceViewState = atom.workspaceView.serialize()
atom.project.getState().serializeForPersistence()
project2 = atom.replicate().get('project')
simulateReload = ->
workspaceState = atom.workspace.serialize()
projectState = atom.project.serialize()
atom.workspaceView.remove()
atom.project.destroy()
atom.project = project2
atom.workspaceView = atom.deserializers.deserialize(workspaceViewState)
atom.project = atom.deserializers.deserialize(projectState)
atom.workspace = Workspace.deserialize(workspaceState)
atom.workspaceView = new WorkspaceView(atom.workspace)
atom.workspaceView.attachToDom()
describe "when the serialized WorkspaceView has an unsaved buffer", ->
it "constructs the view with the same panes", ->
atom.workspaceView.attachToDom()
atom.workspaceView.openSync()
editor1 = atom.workspaceView.getActiveView()
buffer = editor1.getBuffer()
editor1.splitRight()
expect(atom.workspaceView.getActiveView()).toBe atom.workspaceView.getEditorViews()[2]
editorView1 = atom.workspaceView.getActiveView()
buffer = editorView1.getEditor().getBuffer()
editorView1.splitRight()
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
refreshWorkspaceViewAndProject()
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 2
expect(atom.workspaceView.getActiveView()).toBe atom.workspaceView.getEditorViews()[1]
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
expect(atom.workspaceView.title).toBe "untitled - #{atom.project.getPath()}"
describe "when there are open editors", ->
@@ -50,86 +51,59 @@ describe "WorkspaceView", ->
pane2 = pane1.splitRight()
pane3 = pane2.splitRight()
pane4 = pane2.splitDown()
pane2.showItem(atom.project.openSync('b'))
pane3.showItem(atom.project.openSync('../sample.js'))
pane2.activateItem(atom.project.openSync('b'))
pane3.activateItem(atom.project.openSync('../sample.js'))
pane3.activeItem.setCursorScreenPosition([2, 4])
pane4.showItem(atom.project.openSync('../sample.txt'))
pane4.activateItem(atom.project.openSync('../sample.txt'))
pane4.activeItem.setCursorScreenPosition([0, 2])
pane2.focus()
refreshWorkspaceViewAndProject()
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 4
editor1 = atom.workspaceView.panes.find('.row > .pane .editor:eq(0)').view()
editor3 = atom.workspaceView.panes.find('.row > .pane .editor:eq(1)').view()
editor2 = atom.workspaceView.panes.find('.row > .column > .pane .editor:eq(0)').view()
editor4 = atom.workspaceView.panes.find('.row > .column > .pane .editor:eq(1)').view()
editorView1 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(0)').view()
editorView3 = atom.workspaceView.panes.find('.pane-row > .pane .editor:eq(1)').view()
editorView2 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(0)').view()
editorView4 = atom.workspaceView.panes.find('.pane-row > .pane-column > .pane .editor:eq(1)').view()
expect(editor1.getPath()).toBe atom.project.resolve('a')
expect(editor2.getPath()).toBe atom.project.resolve('b')
expect(editor3.getPath()).toBe atom.project.resolve('../sample.js')
expect(editor3.getCursorScreenPosition()).toEqual [2, 4]
expect(editor4.getPath()).toBe atom.project.resolve('../sample.txt')
expect(editor4.getCursorScreenPosition()).toEqual [0, 2]
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
# ensure adjust pane dimensions is called
expect(editor1.width()).toBeGreaterThan 0
expect(editor2.width()).toBeGreaterThan 0
expect(editor3.width()).toBeGreaterThan 0
expect(editor4.width()).toBeGreaterThan 0
expect(editorView1.width()).toBeGreaterThan 0
expect(editorView2.width()).toBeGreaterThan 0
expect(editorView3.width()).toBeGreaterThan 0
expect(editorView4.width()).toBeGreaterThan 0
# ensure correct editor is focused again
expect(editor2.isFocused).toBeTruthy()
expect(editor1.isFocused).toBeFalsy()
expect(editor3.isFocused).toBeFalsy()
expect(editor4.isFocused).toBeFalsy()
# ensure correct editorView is focused again
expect(editorView2.isFocused).toBeTruthy()
expect(editorView1.isFocused).toBeFalsy()
expect(editorView3.isFocused).toBeFalsy()
expect(editorView4.isFocused).toBeFalsy()
expect(atom.workspaceView.title).toBe "#{path.basename(editor2.getPath())} - #{atom.project.getPath()}"
expect(atom.workspaceView.title).toBe "#{path.basename(editorView2.getEditor().getPath())} - #{atom.project.getPath()}"
describe "where there are no open editors", ->
it "constructs the view with no open editors", ->
atom.workspaceView.getActivePane().remove()
expect(atom.workspaceView.getEditorViews().length).toBe 0
refreshWorkspaceViewAndProject()
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 0
describe "focus", ->
beforeEach ->
atom.workspaceView.attachToDom()
describe "when there is an active view", ->
it "hands off focus to the active view", ->
editorView = atom.workspaceView.getActiveView()
editorView.isFocused = false
atom.workspaceView.focus()
expect(editorView.isFocused).toBeTruthy()
describe "when there is no active view", ->
beforeEach ->
atom.workspaceView.getActivePane().remove()
expect(atom.workspaceView.getActiveView()).toBeUndefined()
atom.workspaceView.attachToDom()
expect(document.activeElement).toBe document.body
describe "when are visible focusable elements (with a -1 tabindex)", ->
it "passes focus to the first focusable element", ->
focusable1 = $$ -> @div "One", id: 'one', tabindex: -1
focusable2 = $$ -> @div "Two", id: 'two', tabindex: -1
atom.workspaceView.horizontal.append(focusable1, focusable2)
expect(document.activeElement).toBe document.body
atom.workspaceView.focus()
expect(document.activeElement).toBe focusable1[0]
describe "when there are no visible focusable elements", ->
it "surrenders focus to the body", ->
focusable = $$ -> @div "One", id: 'one', tabindex: -1
atom.workspaceView.horizontal.append(focusable)
focusable.hide()
expect(document.activeElement).toBe document.body
atom.workspaceView.focus()
expect(document.activeElement).toBe document.body
it "hands off focus to the active pane", ->
activePane = atom.workspaceView.getActivePane()
$('body').focus()
expect(activePane.hasFocus()).toBe false
atom.workspaceView.focus()
expect(activePane.hasFocus()).toBe true
describe "keymap wiring", ->
commandHandler = null
@@ -189,303 +163,36 @@ describe "WorkspaceView", ->
describe "when the root view is deserialized", ->
it "updates the title to contain the project's path", ->
workspaceView2 = atom.deserializers.deserialize(atom.workspaceView.serialize())
workspaceView2 = new WorkspaceView(atom.workspace.testSerialization())
item = atom.workspaceView.getActivePaneItem()
expect(workspaceView2.title).toBe "#{item.getTitle()} - #{atom.project.getPath()}"
workspaceView2.remove()
describe "font size adjustment", ->
it "increases/decreases font size when increase/decrease-font-size events are triggered", ->
fontSizeBefore = atom.config.get('editor.fontSize')
atom.workspaceView.trigger 'window:increase-font-size'
expect(atom.config.get('editor.fontSize')).toBe fontSizeBefore + 1
atom.workspaceView.trigger 'window:increase-font-size'
expect(atom.config.get('editor.fontSize')).toBe fontSizeBefore + 2
atom.workspaceView.trigger 'window:decrease-font-size'
expect(atom.config.get('editor.fontSize')).toBe fontSizeBefore + 1
atom.workspaceView.trigger 'window:decrease-font-size'
expect(atom.config.get('editor.fontSize')).toBe fontSizeBefore
it "does not allow the font size to be less than 1", ->
atom.config.set("editor.fontSize", 1)
atom.workspaceView.trigger 'window:decrease-font-size'
expect(atom.config.get('editor.fontSize')).toBe 1
describe ".openSync(filePath, options)", ->
describe "when there is no active pane", ->
beforeEach ->
spyOn(Pane.prototype, 'focus')
atom.workspaceView.getActivePane().remove()
expect(atom.workspaceView.getActivePane()).toBeUndefined()
describe "when called with no path", ->
it "creates a empty edit session as an item on a new pane, and focuses the pane", ->
editor = atom.workspaceView.openSync()
expect(atom.workspaceView.getActivePane().activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(atom.workspaceView.getActivePane().focus).toHaveBeenCalled()
it "can create multiple empty edit sessions as an item on a new pane", ->
editor = atom.workspaceView.openSync()
editor2 = atom.workspaceView.openSync()
expect(atom.workspaceView.getActivePane().getItems().length).toBe 2
expect(editor).not.toBe editor2
describe "when called with a path", ->
it "creates an edit session for the given path as an item on a new pane, and focuses the pane", ->
editor = atom.workspaceView.openSync('b')
expect(atom.workspaceView.getActivePane().activeItem).toBe editor
expect(editor.getPath()).toBe require.resolve('./fixtures/dir/b')
expect(atom.workspaceView.getActivePane().focus).toHaveBeenCalled()
describe "when the changeFocus option is false", ->
it "does not focus the new pane", ->
editor = atom.workspaceView.openSync('b', changeFocus: false)
expect(atom.workspaceView.getActivePane().focus).not.toHaveBeenCalled()
describe "when the split option is 'right'", ->
it "creates a new pane and opens the file in said pane", ->
editor = atom.workspaceView.openSync('b', split: 'right')
expect(atom.workspaceView.getActivePane().activeItem).toBe editor
expect(editor.getPath()).toBe require.resolve('./fixtures/dir/b')
describe "when there is an active pane", ->
[activePane, initialItemCount] = []
beforeEach ->
activePane = atom.workspaceView.getActivePane()
spyOn(activePane, 'focus')
initialItemCount = activePane.getItems().length
describe "when called with no path", ->
it "opens an edit session with an empty buffer as an item in the active pane and focuses it", ->
editor = atom.workspaceView.openSync()
expect(activePane.getItems().length).toBe initialItemCount + 1
expect(activePane.activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(activePane.focus).toHaveBeenCalled()
describe "when called with a path", ->
describe "when the active pane already has an edit session item for the path being opened", ->
it "shows the existing edit session in the pane", ->
previousEditor = activePane.activeItem
editor = atom.workspaceView.openSync('b')
expect(activePane.activeItem).toBe editor
expect(editor).not.toBe previousEditor
editor = atom.workspaceView.openSync(previousEditor.getPath())
expect(editor).toBe previousEditor
expect(activePane.activeItem).toBe editor
expect(activePane.focus).toHaveBeenCalled()
describe "when the active pane does not have an edit session item for the path being opened", ->
it "creates a new edit session for the given path in the active editor", ->
editor = atom.workspaceView.openSync('b')
expect(activePane.items.length).toBe 2
expect(activePane.activeItem).toBe editor
expect(activePane.focus).toHaveBeenCalled()
describe "when the changeFocus option is false", ->
it "does not focus the active pane", ->
editor = atom.workspaceView.openSync('b', changeFocus: false)
expect(activePane.focus).not.toHaveBeenCalled()
describe "when the split option is 'right'", ->
it "creates a new pane and opens the file in said pane", ->
pane1 = atom.workspaceView.getActivePane()
editor = atom.workspaceView.openSync('b', split: 'right')
pane2 = atom.workspaceView.getActivePane()
expect(pane2[0]).not.toBe pane1[0]
expect(editor.getPath()).toBe require.resolve('./fixtures/dir/b')
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
editor = atom.workspaceView.openSync('file1', split: 'right')
pane3 = atom.workspaceView.getActivePane()
expect(pane3[0]).toBe pane2[0]
expect(editor.getPath()).toBe require.resolve('./fixtures/dir/file1')
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
describe ".openSingletonSync(filePath, options)", ->
describe "when there is an active pane", ->
[pane1] = []
beforeEach ->
spyOn(Pane.prototype, 'focus').andCallFake -> @makeActive()
pane1 = atom.workspaceView.getActivePane()
it "creates a new pane and reuses the file when already open", ->
atom.workspaceView.openSingletonSync('b', split: 'right')
pane2 = atom.workspaceView.getActivePane()
expect(pane2[0]).not.toBe pane1[0]
expect(pane1.itemForUri('b')).toBeFalsy()
expect(pane2.itemForUri('b')).not.toBeFalsy()
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
pane1.focus()
expect(atom.workspaceView.getActivePane()[0]).toBe pane1[0]
atom.workspaceView.openSingletonSync('b', split: 'right')
pane3 = atom.workspaceView.getActivePane()
expect(pane3[0]).toBe pane2[0]
expect(pane1.itemForUri('b')).toBeFalsy()
expect(pane2.itemForUri('b')).not.toBeFalsy()
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
it "handles split: left by opening to the left pane when necessary", ->
atom.workspaceView.openSingletonSync('b', split: 'right')
pane2 = atom.workspaceView.getActivePane()
expect(pane2[0]).not.toBe pane1[0]
atom.workspaceView.openSingletonSync('file1', split: 'left')
activePane = atom.workspaceView.getActivePane()
expect(activePane[0]).toBe pane1[0]
expect(pane1.itemForUri('file1')).toBeTruthy()
expect(pane2.itemForUri('file1')).toBeFalsy()
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
pane2.focus()
expect(atom.workspaceView.getActivePane()[0]).toBe pane2[0]
atom.workspaceView.openSingletonSync('file1', split: 'left')
activePane = atom.workspaceView.getActivePane()
expect(activePane[0]).toBe pane1[0]
expect(atom.workspaceView.panes.find('.row .pane').toArray()).toEqual [pane1[0], pane2[0]]
it "reuses the file when already open", ->
atom.workspaceView.openSync('b')
atom.workspaceView.openSingletonSync('b', split: 'right')
expect(atom.workspaceView.panes.find('.pane').toArray()).toEqual [pane1[0]]
describe ".open(filePath)", ->
beforeEach ->
spyOn(Pane.prototype, 'focus')
describe "when there is no active pane", ->
beforeEach ->
atom.workspaceView.getActivePane().remove()
expect(atom.workspaceView.getActivePane()).toBeUndefined()
describe "when called with no path", ->
it "creates a empty edit session as an item on a new pane, and focuses the pane", ->
editor = null
waitsForPromise ->
atom.workspaceView.open().then (o) -> editor = o
runs ->
expect(atom.workspaceView.getActivePane().activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(atom.workspaceView.getActivePane().focus).toHaveBeenCalled()
it "can create multiple empty edit sessions as items on a pane", ->
editor1 = null
editor2 = null
waitsForPromise ->
atom.workspaceView.open()
.then (o) ->
editor1 = o
atom.workspaceView.open()
.then (o) ->
editor2 = o
runs ->
expect(atom.workspaceView.getActivePane().getItems().length).toBe 2
expect(editor1).not.toBe editor2
describe "when called with a path", ->
it "creates an edit session for the given path as an item on a new pane, and focuses the pane", ->
editor = null
waitsForPromise ->
atom.workspaceView.open('b').then (o) -> editor = o
runs ->
expect(atom.workspaceView.getActivePane().activeItem).toBe editor
expect(editor.getPath()).toBe require.resolve('./fixtures/dir/b')
expect(atom.workspaceView.getActivePane().focus).toHaveBeenCalled()
describe "when there is an active pane", ->
[activePane] = []
beforeEach ->
activePane = atom.workspaceView.getActivePane()
describe "when called with no path", ->
it "opens an edit session with an empty buffer as an item in the active pane and focuses it", ->
editor = null
waitsForPromise ->
atom.workspaceView.open().then (o) -> editor = o
runs ->
expect(activePane.getItems().length).toBe 2
expect(activePane.activeItem).toBe editor
expect(editor.getPath()).toBeUndefined()
expect(activePane.focus).toHaveBeenCalled()
describe "when called with a path", ->
describe "when the active pane already has an item for the given path", ->
it "shows the existing edit session in the pane", ->
previousEditor = activePane.activeItem
editor = null
waitsForPromise ->
atom.workspaceView.open('b').then (o) -> editor = o
runs ->
expect(activePane.activeItem).toBe editor
expect(editor).not.toBe previousEditor
waitsForPromise ->
atom.workspaceView.open(previousEditor.getPath()).then (o) -> editor = o
runs ->
expect(editor).toBe previousEditor
expect(activePane.activeItem).toBe editor
expect(activePane.focus).toHaveBeenCalled()
describe "when the active pane does not have an existing item for the given path", ->
it "creates a new edit session for the given path in the active pane", ->
editor = null
waitsForPromise ->
atom.workspaceView.open('b').then (o) -> editor = o
runs ->
expect(activePane.activeItem).toBe editor
expect(activePane.getItems().length).toBe 2
expect(activePane.focus).toHaveBeenCalled()
describe "window:toggle-invisibles event", ->
it "shows/hides invisibles in all open and future editors", ->
atom.workspaceView.height(200)
atom.workspaceView.attachToDom()
rightEditor = atom.workspaceView.getActiveView()
rightEditor.setText(" \t ")
leftEditor = rightEditor.splitLeft()
expect(rightEditor.find(".line:first").text()).toBe " "
expect(leftEditor.find(".line:first").text()).toBe " "
rightEditorView = atom.workspaceView.getActiveView()
rightEditorView.getEditor().setText(" \t ")
leftEditorView = rightEditorView.splitLeft()
expect(rightEditorView.find(".line:first").text()).toBe " "
expect(leftEditorView.find(".line:first").text()).toBe " "
withInvisiblesShowing = "#{rightEditor.invisibles.space}#{rightEditor.invisibles.tab} #{rightEditor.invisibles.space}#{rightEditor.invisibles.eol}"
withInvisiblesShowing = "#{rightEditorView.invisibles.space}#{rightEditorView.invisibles.tab} #{rightEditorView.invisibles.space}#{rightEditorView.invisibles.eol}"
atom.workspaceView.trigger "window:toggle-invisibles"
expect(rightEditor.find(".line:first").text()).toBe withInvisiblesShowing
expect(leftEditor.find(".line:first").text()).toBe withInvisiblesShowing
expect(rightEditorView.find(".line:first").text()).toBe withInvisiblesShowing
expect(leftEditorView.find(".line:first").text()).toBe withInvisiblesShowing
lowerLeftEditor = leftEditor.splitDown()
expect(lowerLeftEditor.find(".line:first").text()).toBe withInvisiblesShowing
lowerLeftEditorView = leftEditorView.splitDown()
expect(lowerLeftEditorView.find(".line:first").text()).toBe withInvisiblesShowing
atom.workspaceView.trigger "window:toggle-invisibles"
expect(rightEditor.find(".line:first").text()).toBe " "
expect(leftEditor.find(".line:first").text()).toBe " "
expect(rightEditorView.find(".line:first").text()).toBe " "
expect(leftEditorView.find(".line:first").text()).toBe " "
lowerRightEditor = rightEditor.splitDown()
expect(lowerRightEditor.find(".line:first").text()).toBe " "
lowerRightEditorView = rightEditorView.splitDown()
expect(lowerRightEditorView.find(".line:first").text()).toBe " "
describe ".eachEditorView(callback)", ->
beforeEach ->
@@ -526,3 +233,11 @@ describe "WorkspaceView", ->
subscription.off()
atom.workspaceView.getActiveView().splitRight()
expect(count).toBe 2
describe "core:close", ->
it "closes the active pane item until all that remains is a single empty pane", ->
atom.config.set('core.destroyEmptyPanes', true)
atom.project.openSync('../sample.txt')
expect(atom.workspaceView.getActivePane().getItems()).toHaveLength 1
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePane().getItems()).toHaveLength 0
+3 -10
Ver Arquivo
@@ -1,4 +1,3 @@
TextMateGrammar = require './text-mate-grammar'
Package = require './package'
fs = require 'fs-plus'
path = require 'path'
@@ -53,12 +52,6 @@ class AtomPackage extends Package
console.warn "Failed to load package named '#{@name}'", e.stack ? e
this
enable: ->
atom.config.removeAtKeyPath('core.disabledPackages', @metadata.name)
disable: ->
atom.config.pushAtKeyPath('core.disabledPackages', @metadata.name)
reset: ->
@stylesheets = []
@keymaps = []
@@ -105,7 +98,7 @@ class AtomPackage extends Package
atom.keymap.add(keymapPath, map) for [keymapPath, map] in @keymaps
atom.contextMenu.add(menuPath, map['context-menu']) for [menuPath, map] in @menus
atom.menu.add(map.menu) for [menuPath, map] in @menus when map.menu
atom.syntax.addGrammar(grammar) for grammar in @grammars
grammar.activate() for grammar in @grammars
for [scopedPropertiesPath, selector, properties] in @scopedProperties
atom.syntax.addProperties(scopedPropertiesPath, selector, properties)
@@ -152,7 +145,7 @@ class AtomPackage extends Package
@grammars = []
grammarsDirPath = path.join(@path, 'grammars')
for grammarPath in fs.listSync(grammarsDirPath, ['.json', '.cson'])
@grammars.push(TextMateGrammar.loadSync(grammarPath))
@grammars.push(atom.syntax.readGrammarSync(grammarPath))
loadScopedProperties: ->
@scopedProperties = []
@@ -180,7 +173,7 @@ class AtomPackage extends Package
@configActivated = false
deactivateResources: ->
atom.syntax.removeGrammar(grammar) for grammar in @grammars
grammar.deactivate() for grammar in @grammars
atom.syntax.removeProperties(scopedPropertiesPath) for [scopedPropertiesPath] in @scopedProperties
atom.keymap.remove(keymapPath) for [keymapPath] in @keymaps
atom.themes.removeStylesheet(stylesheetPath) for [stylesheetPath] in @stylesheets

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