Commit Graph

3130 Commits

Author SHA1 Message Date
Kevin Sawicki
5852238cd8 Reload instead of unload in afterEach
This ensures the stylesheets with the fixtures variables
are unloaded and the default ones are reloaded.
2013-09-04 13:32:55 -07:00
Kevin Sawicki
3a5ad9b48d Unload base stylesheets in an after each
This prevents the blue background from bleeding over into other specs.
2013-09-04 12:56:54 -07:00
Kevin Sawicki
7b2429851c Load bootstrap stylsheets in spec helper 2013-09-04 12:48:58 -07:00
Kevin Sawicki
26ee4a065c Use space-ben to create editor div 2013-09-04 12:25:29 -07:00
Kevin Sawicki
d48df331b0 Use attachToDom instead of appending directly to #jasmine-content 2013-09-04 12:25:28 -07:00
Ben Ogle
c0ef23bc7d 💄 Update spec description 2013-09-04 12:25:28 -07:00
Ben Ogle
1d7f5845d0 remove duplicate spec 2013-09-04 12:25:28 -07:00
Ben Ogle
d1c1ecc9a4 Add ability to override ui-variables in theme
This required moving the importable less files to a `less-imports` 
directory and adding that directory to the less path. Otherwise, 
atom.less would import ui-variables from its current directory 
(/static/ui-variables) as less searches the current directory before 
any other directories on the path.
2013-09-04 12:25:27 -07:00
Ben Ogle
9c5c05ff41 Get the proper directories before themeManage load 2013-09-04 12:25:27 -07:00
Corey Johnson
653eaf4186 Rename spec 2013-09-03 14:48:42 -07:00
Corey Johnson
49e6e82d67 Add spec for when the active pane is changed 2013-09-03 14:48:42 -07:00
Corey Johnson
fc8a3f5e78 Rename pane-container:active-item-changed
To pane-container:active-pane-item-changed
2013-09-03 14:48:42 -07:00
Corey Johnson
915159d7a0 Fix pane:became-inactive and pane:became-active events 2013-09-03 14:48:42 -07:00
Corey Johnson
7fd0d934ef Add pane-container:active-item-changed event 2013-09-03 14:48:42 -07:00
Kevin Sawicki
68a50b196a Update spec counts when runner completes
This ensures 0/0 is displayed even when no specs were ran.
2013-09-03 14:25:42 -07:00
Kevin Sawicki
f9e95c273f Only run core specs when resource path is the Atom repo 2013-09-03 14:25:42 -07:00
Kevin Sawicki
aaea8bdb31 Trigger buffer-created from Project::addBufferAtIndex
This ensures that any listeners for this event will be notified when
a buffer is add via deserialization from a telepath document.
2013-09-02 11:46:32 -07:00
Kevin Sawicki
63a3d9de94 Pass project to Git.open in the options hash
Previously the project global was unavailable in the Git constructor
since it had not been set as a global yet and so the Git instance was never
configured to watch the project's buffers for save/reload events.  This caused
the status to be out of sync in places like the gutter and status bar.
2013-09-02 11:34:20 -07:00
Kevin Sawicki
fe725ec909 Display time in seconds instead of milliseconds 2013-08-29 21:33:21 -07:00
Kevin Sawicki
8fb10e35a9 🚱 Destroy current project in beforeEach
Previously the window specs were calling window::deserializeEditorWindow
without first destroying the spec project causing the global to be
reassigned over and leaking the initial project and repo.
2013-08-29 18:41:27 -07:00
Kevin Sawicki
2687fafca4 🚱 Destroy environments in an afterEach
These were leaking projects and therefore repos.
2013-08-29 18:37:03 -07:00
Kevin Sawicki
40860a59f5 Destroy deserialized project in an afterEach 2013-08-29 18:24:51 -07:00
Kevin Sawicki
fd9f3d6543 Don't serialize packages unless the main module was activated
The settings-view activates the config for each package before it renders
causing the main module to be required in order to call activateConfig().
This was causing serialize to be called when the window state was being
saved which was incorrect since activate hadn't actually been called even
though the main module was required.
2013-08-29 14:48:42 -07:00
Kevin Sawicki
57132f57bd Suppress deserialization warning during window spec 2013-08-29 09:18:52 -07:00
Kevin Sawicki
de5b2c5cf1 Suppress deserialization warning during pane spec 2013-08-29 09:15:31 -07:00
Kevin Sawicki
d12eed3f68 Don't build description string unless actually logging it 2013-08-28 22:19:18 -07:00
Kevin Sawicki
951b3253da Remove unused name field from tracked specs 2013-08-28 22:12:34 -07:00
Kevin Sawicki
e40d837b40 Log longest specs/suites during grunt test 2013-08-28 22:07:57 -07:00
Kevin Sawicki
3e626f28c4 Only require AtomReporter if actually being used 2013-08-28 21:20:31 -07:00
Kevin Sawicki
e0ccfc4788 Use terminal reporter from jasmine-node
This gives the same filtered stack traces and text output
as all our node modules that already use jasmine-node indirectly
through jasmine-focused.
2013-08-28 20:57:43 -07:00
Kevin Sawicki & Nathan Sobo
2bd4386090 Destroy unretained buffers when serializing project
Previously buffers could linger indefinitely if an error occurred
during startup between the deserialization of the project and the
original retaining edit session.
2013-08-28 18:37:40 -07:00
Kevin Sawicki
c8b7040144 🐎 Find elements by id in spec reporter
Previously classes containing the spec/suite id were used which
caused major amounts of time finding DOM nodes using class selectors
instead of id selectors.

This decreases the Editor spec from ~90s to ~30s.
2013-08-28 14:56:52 -07:00
Kevin Sawicki
6261124464 Update spec to use atom::close instead of window::close 2013-08-28 10:43:12 -07:00
Kevin Sawicki
b22e45b8a9 Call PaneContainer::itemAdded from PaneContainer::reopenItem
This ensures the active item in the new root is filtered out of
the reopen stack, preventing a duplicate item from being opened.
2013-08-26 13:36:55 -07:00
Kevin Sawicki
325d534d91 💄 spec description 2013-08-23 18:29:12 -07:00
Kevin Sawicki
eaf80a0194 Rename softWrapColumn to editorWidthInChars 2013-08-23 18:09:17 -07:00
Kevin Sawicki
3f848606ee Use setEditorWidthInChars to resize editor
This makes the comparisons for the soft wrap column more sane.
2013-08-23 18:09:17 -07:00
Kevin Sawicki
32396a2a8b Update soft wrapped lines when config changes
DisplayBuffer now observes for config changes to the preferred line length
and the preference to soft wrap at the preferred line length to update
any wrapped screen lines.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
a45b93614e Add editor.softWrapAtPreferredLineLength config setting
This is used by the DisplayBuffer to use `editor.preferredLineLength`
as the soft wrap column instead of the editor size.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
8f193e4fb5 Remove default edit session options from Project
Instead read the config values directly where they are actually
used such as in EditSession, TokenizedBuffer, and DisplayBuffer.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
cbd4fab8f2 Emit event from display buffer when soft wrap changes
This allows the editor to be reactive to the edit session
and always respect the edit session's current value when
initially opened.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
8b3b033b09 Add explicit call to setSoftWrap in specs
This is now required now that setting the soft wrap
column does not cause wrapping unless soft wrap is enabled.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
e675fe73c8 Set soft wrap explicitly on the display buffer
This is required now that soft wrap column only takes affect
when soft wrap is enabled.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
5001c6e84e Enable soft wrap explicitly in specs
This is required now that the soft wrap setting and soft wrap
column are decoupled.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
a4411ab2ca Update specs for resize handler changes 2013-08-23 18:09:16 -07:00
Kevin Sawicki
5ea8c6c27b Don't store soft wrap column on EditSession
This removes duplicate state between the edit session and
display buffer.
2013-08-23 18:09:16 -07:00
Kevin Sawicki
da1e5f5c10 Always update the soft wrap column when the window resizes
This allows the edit session and display buffer to always be
notified of soft wrap column changes regardless of their initial
soft wrap state.
2013-08-23 18:09:16 -07:00
probablycorey
78b9a99f86 Add window:run-package-specs command
This will only run specs found in the current projects spec directory
2013-08-23 09:02:22 -07:00
Kevin Sawicki
f32a289193 Store relative buffer path instead of id
This allows the tokenized buffer to be deserialized during reopening
from the pane container.

Closes #744
2013-08-22 14:42:08 -07:00
Kevin Sawicki
92a80208d3 Update the relative path when the buffer's file moves 2013-08-22 13:59:46 -07:00
Kevin Sawicki
a0db412140 Use editor.softTabs config value when creating edit sessions
This replaces the internal softWrap state and removes the previous
getter and setter for this value that was on Project.
2013-08-21 18:12:26 -07:00
Kevin Sawicki
147e75ad95 Use editor.softWrap config value when creating edit sessions
Closes #666
2013-08-21 17:17:06 -07:00
Kevin Sawicki
2f4db45320 Use editor.tabLength config value when creating edit sessions
Closes #708
2013-08-21 17:12:04 -07:00
Nathan Sobo
0192c57f46 Fix corner case in RowMap::mapBufferRowRange w/ 0-buffer-row regions
Fixes #688

The DisplayBuffer applies buffer and screen deltas to the row map as
rows are inserted/removed from the buffer/screen. This can leave some
of the regions in a weird state, such as mapping multiple screen rows
to zero buffer rows. But next the DisplayBuffer applies any new mappings
based on the replaced lines over the top of existing regions. These
weirdly shaped regions should be overwritten by newly inserted regions,
so at the end of the operation the row map makes sense again.

This fixes a corner case where regions spanning 0 buffer rows at the
very beginning of the row range were not being included in the set of
regions to replace. This was in turn causing the RowMap to get into a
bad state in certain situations involving soft-wrapped lines.
2013-08-20 19:30:29 -06:00
Kevin Sawicki
6e2fd18f62 Add back ability to open an arbitrary window
atom.open now takes an options has that can contain either pathsToOpen
or the complete settings of a new window.

This will be used by the collaboration package to open the window when a
session is being joined.
2013-08-20 15:30:53 -07:00
Corey Johnson & Nathan Sobo
0c9a1fdc80 Rename Keymap::toObject to Keymap::keystrokesByCommand
Also add spec for passing a selector
2013-08-20 12:23:15 -07:00
probablycorey
068e656627 Remove unused atom.getVersion method 2013-08-20 12:23:13 -07:00
probablycorey
37c17075ea Add keymap.toObject() 2013-08-20 12:23:12 -07:00
probablycorey
efb70e0562 Remove specs and methods that are no longer used 2013-08-20 12:23:12 -07:00
Kevin Sawicki
27cee3e19c Don't terminate tokenization if stack size changes
Previously Python import blocks were not tokenizing correctly since
the loop was prematurely terminating when a match at the end of the line
was reached and no tokens were generated for it.

This approach was incorrect since the tokenizer may have just popped a rule
and another loop could possibly pop more rules.

Now this early termination is only performed if the stack size hasn't changed.
2013-08-20 11:38:06 -07:00
Kevin Sawicki
77ed5324b1 Move specs from spec/app to spec/ 2013-08-19 21:23:00 -07:00
Kevin Sawicki
a7a1244599 Flatten spec directory 2013-08-19 20:13:58 -07:00
Kevin Sawicki
b6785d78e8 Reset themes in afterEach
This ensures they don't bleed over into other specs.
2013-08-19 19:49:52 -07:00
Ben Ogle
15085384b9 change name of event to reloaded 2013-08-19 15:55:16 -07:00
Ben Ogle
b89e58e551 ThemeManager emits a reload event when reloaded 2013-08-19 15:55:15 -07:00
Ben Ogle
8730638ade Add directory and ImportPaths paths to themes 2013-08-19 15:55:15 -07:00
Kevin Sawicki & Nathan Sobo
347801b074 Merge branch 'summit'
Conflicts:
	src/app/config.coffee
	src/atom-application.coffee
	src/main.coffee
2013-08-19 14:01:24 -07:00
Kevin Sawicki
7f9b057c52 💄 2013-08-16 21:20:47 -07:00
Kevin Sawicki
647b5881a8 Remove TextBuffer::lineEndingForRow spec covered in telepath 2013-08-16 21:16:34 -07:00
Kevin Sawicki
9c76214fe9 Expect undefined instead of null for invalid buffer rows 2013-08-16 21:03:04 -07:00
Kevin Sawicki
3d5516fad9 Default to empty arrays for user and bundled package paths 2013-08-16 20:52:20 -07:00
Kevin Sawicki & Nathan Sobo
fe2baa18ca Use atom.getAvailablePackageNames() to load package specs 2013-08-16 11:35:43 -07:00
Kevin Sawicki & Nathan Sobo
a147dc01d7 Clear undo stack after setting initial buffer text 2013-08-16 11:30:37 -07:00
Kevin Sawicki & Nathan Sobo
2f4555a16f Add config.userPackageDirPaths which includes dev packages in dev mode 2013-08-16 11:18:08 -07:00
Ben Ogle
eea38a696f add a pane:became-inactive event 2013-08-15 17:28:14 -07:00
Kevin Sawicki & Nathan Sobo
f00bb58932 TokenizedBuffer constructor now takes an object 2013-08-14 16:35:10 -07:00
Kevin Sawicki & Nathan Sobo
ad36b2c6a6 Allow user package specs to override bundled package specs 2013-08-14 15:36:45 -07:00
Kevin Sawicki
c6d1409151 Merge branch 'master' into summit
Conflicts:
	.pairs
	package.json
	spec/app/tokenized-buffer-spec.coffee
	src/app/edit-session.coffee
	src/app/project.coffee
	src/app/window.coffee
	src/atom-application.coffee
	static/root-view.less
2013-08-14 14:05:35 -07:00
Kevin Sawicki
5235114eed Use fs.readdirSync() for listing package directories
Previously fsUtils.listTreeSync() was used which returns every path
in the tree, not just paths directly underneath the root path.

This speeds up the spec suite require time by not stat'ing the entire
node_modules directory.
2013-08-14 11:29:48 -07:00
Kevin Sawicki
b7a8e22d82 Set spec type after all specs in the category are required 2013-08-14 10:58:56 -07:00
Nathan Sobo
c6a0e385f7 Always include text in serialized buffer state; also include isModified
Previously, we were not including the text when serializing an
unmodified buffer. We would use the absence of the text field to
determine that the buffer was previously unmodified when deserializing.
The problem is that text now stores the markers associated with the
buffer, and we want to retain those across serialization regardless of
the modified status. So now I include the text always, along with an
isModified flag which if true, will tell to reload the buffer if it
has changed since we last serialized it. Reloading a buffer should
probably do a diff-and-patch in the future rather than replacing the
contents outright, so that we always preserve markers as best as we can.
2013-08-14 11:31:17 -06:00
Kevin Sawicki
41268c67d7 Remove internal packages section from spec reporter 2013-08-14 08:48:12 -07:00
Corey Johnson & Nathan Sobo
3c166edd26 Start switch to Telepath for undo/redo
Also, TextBuffer spec passes!
2013-08-13 17:34:31 -07:00
Kevin Sawicki
063d48c4ab Use ScopeSelector class from first-mate
Begin migrating TextMate helpers out of src/ and into the first-mate
package.
2013-08-12 16:22:18 -07:00
Kevin Sawicki
599a2ad021 Group specs into four sections
1. Core specs located in spec/
2. Internal package specs in src/packages
3. Bundled package specs in node_modules
4. User package specs in ~/.atom/packages
2013-08-09 17:24:07 -07:00
Kevin Sawicki
db649798ef Ignore missing symlinks in fsUtils.traverseTreeSync()
These were previously throwing an error from the call to
statSync().

Now statSync() is wrapped in a try block and only performed when
lstatSync() reports a symbolic link.
2013-08-09 17:23:29 -07:00
Kevin Sawicki
7e04d85e1e Log a warning when a theme fails to load
Previously Atom would fail to launch if a theme referenced in
the config was not found.
2013-08-09 11:25:07 -07:00
Nathan Sobo
0f14dd9420 Disable pane-splitting spec for now
We'll get it working once this branch gets merged to master.
2013-08-08 11:01:01 -06:00
Kevin Sawicki
de4e24582d Comma separate left and right matcher in or matcher 2013-08-07 18:20:41 -07:00
probablycorey
4629905b65 Remove all references to TextMate themes.
Let's not ship with TextMate theme support. Our .less theme files are
easier to read and write than TextMate themes. If we want to use
TextMate themes we should write a script that converts them to the 
Atom .less version.

Closes #629
2013-08-07 15:21:47 -07:00
Nathan Sobo
5f323cc67c Add TokenizedBuffer.bufferRangeForScopeAtPosition(selector, position)
You can call this method with a selector and a position and get the range
of any matching scope containing the given position, or a falsy value
if the scope does not match at that position.
2013-08-07 12:53:03 -06:00
Jason Rudolph & Nathan Sobo
39d15d6087 Add _.isSubset 2013-08-07 12:37:03 -06:00
Jason Rudolph & Nathan Sobo
6cc4cf87b9 💄 Add intention-revealing helper method 2013-08-07 12:36:05 -06:00
Kevin Sawicki
2698925d10 Reload stylesheets when core.themes config changes
Extracted a new ThemeManager class to encapsulate all the theme
work previously done directly in atom global.

Closes #642
2013-08-07 10:51:25 -07:00
Kevin Sawicki
def07344e9 Visually separate core and package specs in reporter 2013-08-07 09:32:29 -07:00
Kevin Sawicki
633306e6bf Fire edit-session-created event when deserializing
This event was previously not being fired when splitting panes
since the constructor pushing the edit session directly to the
project's array.

Closes #684
2013-08-06 19:07:24 -07:00
Kevin Sawicki
7d58008ed3 Show completions for current scope in autocomplete
Add the TextMate "completions" preferences available as "editor.completions"
and add all completions matching the current scope of the cursor position
when building the autocomplete word list.

Closes #676
2013-08-06 18:18:22 -07:00
Kevin Sawicki
a98791ebd0 Add filter support to selector grammar
Currently these are unimplemented but they can now be parsed
successfully since they are used by certain snippets.
2013-08-06 17:06:22 -07:00
Kevin Sawicki
a72e1813e9 Support stand-alone negation in selector grammar
Previously negation was only supported as the right hand side
of an composite.
2013-08-06 16:54:32 -07:00
Kevin Sawicki
fe9ffbeb12 Support selectors with a trailing comma 2013-08-06 15:55:50 -07:00
Kevin Sawicki
e61992c1f6 Allow _ characters in selector segments 2013-08-06 15:21:31 -07:00
Kevin Sawicki
612332cd9f Allow + characters in selector segments 2013-08-06 15:12:24 -07:00
Kevin Sawicki
faf02460f5 Add TextMateScopeSelector.toCssSelector() 2013-08-06 15:09:10 -07:00
probablycorey
712e9c7203 Add spec to test cutToEndOfLine when soft wrap is enabled 2013-08-06 14:02:30 -07:00
probablycorey
128a030880 Moving to the start or end of a line treats screen lines as real lines 2013-08-06 14:02:30 -07:00
Kevin Sawicki
da7cbeddc7 Support scope selectors with dashes in segments
Previously dashes were only interpreted as negation which
wasn't correct.

Segments should be able to contain a dash as long as it isn't at
the very beginning of the segment.
2013-08-06 12:18:36 -07:00
Kevin Sawicki
8b55c4981d Add assert for multi-segment prefix 2013-08-06 11:35:37 -07:00
probablycorey
c38edbfe0b Cursor.moveCursorToBeginningOfNextWord() behaves correctly on whitespace
Closes #669
2013-08-05 16:47:29 -07:00
probablycorey
8cc47a2069 Add _.deepExtend 2013-08-05 13:54:37 -07:00
probablycorey
69eace6292 Remove references to windowed config panel 2013-08-05 13:54:37 -07:00
probablycorey
2284435551 Move config view to a package 2013-08-05 13:54:37 -07:00
Kevin Sawicki
684dec4b24 Always suggest non-negative indent levels
Close #668
2013-07-31 18:01:38 -07:00
Kevin Sawicki
c723dd5406 Exclude remote markers from TextBuffer.serialize() 2013-07-27 10:31:11 -07:00
Kevin Sawicki & Nathan Sobo
a9edaaba51 Add failing spec for splitting edit sessions 2013-07-26 08:45:13 -07:00
Ben Ogle & Corey Johnson
16cce1efb1 nof 2013-07-24 14:55:43 -07:00
Ben Ogle
b3025a4dfc rename rowRangeForCommentFoldAtBufferRow -> rowRangeForCommentAtBufferRow 2013-07-24 13:09:00 -07:00
Ben Ogle
e76fe439ba Fix tests. Indent oops. 2013-07-24 12:18:27 -07:00
Ben Ogle
f7bb8aab9e Move rowRangeForParagraphAtBufferRow into LanguageMode 2013-07-24 12:18:27 -07:00
Ben Ogle
0a075c6934 remove fdescribe 2013-07-24 12:05:16 -07:00
Ben Ogle
cef3b7d634 move folding tests from EditSession -> LanguageMode 2013-07-24 12:05:16 -07:00
Ben Ogle
d4d3426b4e Add foldAllAtIndentLevel() 2013-07-24 12:05:16 -07:00
Ben Ogle
c2326d096b Fold comments in foldAll() 2013-07-24 12:05:15 -07:00
Ben Ogle
18146346f6 add failing comment fold tests 2013-07-24 12:05:15 -07:00
Ben Ogle
519c514092 add a new sample with some comments 2013-07-24 12:05:15 -07:00
Ben Ogle
4187615fa7 Fix test 2013-07-24 11:53:33 -07:00
Ben Ogle
d98ea0180c Proper handling of cursor up and down behavior when selection range 2013-07-24 11:53:33 -07:00
Ben Ogle
226a4bf391 Add tests for moving to end of selection 2013-07-24 11:53:33 -07:00
Kevin Sawicki
40d76d2db9 Replace git global with project.getRepo() 2013-07-23 19:31:32 -07:00
Kevin Sawicki & Nathan Sobo
1bd9a6bef3 Display cursors from all replicas 2013-07-23 17:49:19 -07:00
Kevin Sawicki & Nathan Sobo
1bf6307480 Display selections from all replicas 2013-07-23 17:49:19 -07:00
Kevin Sawicki & Nathan Sobo
b8b9653fc0 💄 2013-07-23 17:49:19 -07:00
Kevin Sawicki & Nathan Sobo
636f81703c Distinguish remote and local selections in EditSession
Also: Add an Environment spec helper class that swaps out global
variables to simulate running code in different environments for the
replication specs.
2013-07-23 17:49:14 -07:00
Ben Ogle
1465736974 Merge branch 'master' into bo-move-word-behavior
Conflicts:
	src/app/editor.coffee
2013-07-23 15:34:20 -07:00
Kevin Sawicki & Nathan Sobo
9c67aa105b Replace createSite with new Site 2013-07-23 11:58:41 -07:00
Kevin Sawicki & Nathan Sobo
73adc40c4e 💄 use array-shorthand instead of new Range 2013-07-22 18:39:46 -06:00
Kevin Sawicki & Nathan Sobo
fa59aafffb Relativize buffer paths for replication
TextBuffers now maintain a reference to their containing project to
make it easier to test replication of buffers between environments
without worrying about the value of the `project` global.

We're also starting the process of moving the `git` global into Project
as the `Project.repository` property.
2013-07-22 18:13:01 -06:00
Kevin Sawicki & Nathan Sobo
642df0924d Merge branch 'master' into shared-buffers
Conflicts:
	vendor/apm
2013-07-22 11:54:51 -07:00
Kevin Sawicki
56a2c79fe1 Merge branch 'collaboration-presence' into shared-buffers
Conflicts:
	src/app/edit-session.coffee
	src/app/project.coffee
	src/app/text-buffer.coffee
	src/app/window.coffee
	src/packages/collaboration/lib/bootstrap.coffee
	src/packages/collaboration/lib/session-utils.coffee
	vendor/telepath
2013-07-22 10:12:45 -07:00
Kevin Sawicki
0bb7d3ba09 Default save as dialog to directory of active item 2013-07-22 09:11:57 -07:00
Ben Ogle
fe4c4e9751 Add selectToFirstCharacterOfLine to editSession 2013-07-22 09:02:05 -07:00
Nathan Sobo
50ade54c3c Also serialize project in pane specs that remove the pane from the DOM
The project contains the only reference to the buffer that belongs to
the edit session in the serialized pane. If we tear down the pane then
the edit session is destroyed and the buffer is removed. So we have to
serialize and restore the project to its previous state once we finish
tearing down the view.
2013-07-21 16:55:44 -06:00
Nathan Sobo
383985d331 Ensure there is clean serialization of RootView state
Everything from RootView to Pane needs to return a serialized clone of
its state, so we don't accidentally further mutate the serialized state
in tests.
2013-07-20 22:40:40 -06:00
Nathan Sobo
5246d4cd72 Add Project.getState() and make Project.serialize clone state 2013-07-20 21:24:32 -06:00
Nathan Sobo
ff9acb50ff Deserialize display buffer when deserializing edit sessions
Previously, we kept display buffer attributes in the edit session's
serialized state, then recreated a fresh display buffer each time when
deserializing edit sessions. Now that DisplayBuffer and TokenizedBuffer
are serializable, we can just include them directly when serializing
the edit session.
2013-07-20 18:21:44 -06:00
Nathan Sobo
ca0832e58e Include folds in DisplayBuffer deserialization 2013-07-20 16:41:46 -07:00
Nathan Sobo
eeeb453cf9 Back DisplayBuffer with a telepath document 2013-07-20 16:22:26 -07:00
Nathan Sobo
e1f795a352 Back TokenizedBuffer with a telepath document 2013-07-20 15:42:13 -07:00
Nathan Sobo
c85932d46b Preserve folds and all selection attributes when copying EditSessions 2013-07-20 02:23:12 -07:00
Nathan Sobo
75cf1acce1 Honor preserveFolds option when creating a new selection 2013-07-20 02:23:12 -07:00
Nathan Sobo
74347ea874 Upgrade telepath to allow marker attributes to be updated 2013-07-20 02:23:06 -07:00
Ben Ogle
4ccbd03daf I can't spell. Boundary. 2013-07-19 12:17:17 -07:00
Ben Ogle
3df33a7367 Add selection counterparts to move next/prev word boundary 2013-07-19 12:07:30 -07:00
Ben Ogle
13b592d1f3 Add Cursor::moveToNextWordBoundry()
Plumb up to editor as well.
2013-07-19 11:37:47 -07:00
Ben Ogle
ab8df8dcde Add moveToPreviousWordBoundry to cursor.
Plumb it up to a command in the editor.
2013-07-19 11:16:14 -07:00
Nathan Sobo
de1b69dbc9 Add DisplayBuffer.copy 2013-07-18 11:34:39 -07:00
Nathan Sobo
8b53b4d749 Add ability to copy display buffer markers 2013-07-18 10:25:03 -07:00
Nathan Sobo
c54bb792b2 Make EditSession.copy return a copy with a unique id and markers
We want to be able to use the copy independently, which means we
should not use EditSession@deserialize to create it because that will
tie us to the same selection markers.
2013-07-18 06:23:43 -07:00
Ben Ogle
e43e8d156e Combat against empty range; fixes tests 2013-07-17 18:22:41 -07:00
Ben Ogle
2aca31988f Fix tests in EditSession 2013-07-17 17:56:52 -07:00
Ben Ogle
c52cf836cd remove the f on the describe 2013-07-17 17:42:33 -07:00
Ben Ogle
3f8c120ad0 update tests to be more clear 2013-07-17 17:37:45 -07:00
Ben Ogle
365e5e8413 calcMinIndent -> minIndentLevelForRowRange 2013-07-17 17:35:05 -07:00
Ben Ogle
90e53ad3e2 Add proper indents on auto comments 2013-07-17 16:04:53 -07:00
Nathan Sobo
a724ef3b40 Tag selection markers with a disambiguating EditSession id
This prevents selection markers created by different edit sessions
from being shared. Otherwise every edit session for a buffer would be
forced to have the same selection/cursor state.
2013-07-17 15:29:21 -07:00
Ben Ogle & Nathan Sobo
bb695ec53f Replicate the destruction of selections 2013-07-17 11:53:39 -07:00
Ben Ogle & Nathan Sobo
47bfac22c2 Replicate the addition of new selections 2013-07-17 11:12:42 -07:00
Ben Ogle & Nathan Sobo
f32e1fc643 Replicate initial EditSession selection state 2013-07-17 10:25:28 -07:00
Corey Johnson & Matt Colyer
4a67bfcf15 Remove editor.autoIndentOnPaste config option
Normalize paste on indent covers most use cases of autoindent when pasting.

Closes #584
2013-07-16 17:08:12 -07:00
Kevin Sawicki
9ccf9365c3 Make all edit session uri's relative
This allows them to be collaborated without having absolute paths
in the shared document.
2013-07-16 09:49:46 -07:00
Kevin Sawicki
17cecda23e Use atom-shell 23dd5b4da8
The release past this build is causing issues with async callbacks
not firing.
2013-07-16 09:48:15 -07:00
Kevin Sawicki & Nathan Sobo
abc20b3a05 Update text buffer to use telepath markers 2013-07-15 17:07:06 -07:00
Kevin Sawicki
9d733a2da9 Don't grab native window focus
Call $(window) instead of atom.focus() so the native window
doesn't regain focus on each spec run preventing it from running
in the background.
2013-07-15 13:56:21 -07:00
Kevin Sawicki
6bbcc58542 Call atom.focus() in the root beforeEach
Async events are not currently firing in specs and this
appears to cause them fire.
2013-07-15 13:40:53 -07:00
Kevin Sawicki
12580bce83 Guard against missing file path in getScore() 2013-07-10 08:54:15 -07:00
Kevin Sawicki
e34d8e4c42 Display CoffeeScript line numbers in stack traces
Use coffeestack to convert stack traces to have CoffeeScript
line and column numbers in the output instead of JavaScript line
and column numbers.
2013-07-06 14:27:16 -07:00
Kevin Sawicki
adebae6c47 Remove jasmine.js lines from displayed stack trace
This removes the noise from the setup and compare lines that occur in
jasmine.js and only displays the lines that are generated from within
the failing spec.
2013-07-06 14:03:13 -07:00
Kevin Sawicki
010fa219aa Move Point and Range specs to telepath 2013-07-05 12:53:51 -07:00
Kevin Sawicki & Nathan Sobo
85cc81851f Replicate insertion and removal of project buffers
Buffers are now destroyed when removed from the project if they
haven't been destroyed already.
2013-07-05 12:53:50 -07:00
Kevin Sawicki
f766bbbb38 Remove Point and Range classes now provided by telepath 2013-07-05 12:53:50 -07:00
Kevin Sawicki
e5ef23dc5a Expect null instead of undefined for invalid line rows 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
05a3f35512 Normalize line endings in TextBuffer.change() 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
72f9af4d00 Replicate buffer changes
Still some failures due to line endings
2013-07-05 12:53:49 -07:00
Kevin Sawicki & Nathan Sobo
dd0f7a032f Start basing Buffer's text on a replicable string 2013-07-05 12:53:49 -07:00
Kevin Sawicki & Nathan Sobo
da3a89fc27 Don't show pane items that can't be deserialized 2013-07-05 12:53:49 -07:00
Nathan Sobo
30e4531a8f Store buffer paths instead of serialized buffers in EditSession state
Since there can be multiple edit sessions per buffer, it doesn't make
sense to serialize the buffer multiple times. Previously, we were
de-duplicating buffers in the deserialize method itself, but this won't
work now that we want to replicate buffers.
2013-07-05 12:53:49 -07:00
Kevin Sawicki
651bbaa3ce Create an empty ~/.atom/config.cson when missing
Closes #614
2013-07-05 09:17:44 -07:00
Kevin Sawicki
b786bcc774 Store views that don't implement setModel() by their item
Previously viewForItem() would create a new view each time it was called
with an item whose view did not implement setModel() even if a view for that
item already existed in the pane.

Now a WeakMap is used to map items to their view so they can be reused
and cleaned up even when the view does not implement setModel().
2013-07-02 09:41:46 -07:00
Kevin Sawicki
7e76721712 Don't call realpathSync for non-existent directory 2013-07-01 13:23:47 -07:00
Kevin Sawicki
cde9ae02fe Prevent clash between path require and variable name 2013-07-01 13:07:35 -07:00
Kevin Sawicki
77017c2cd3 Compare against realpath of HOME 2013-07-01 12:59:31 -07:00
Kevin Sawicki
7615d54337 Support calling fsUtils.absolute() with a '~' path 2013-07-01 12:46:50 -07:00
Kevin Sawicki & Nathan Sobo
268edf16d8 Make setModel optional in pane item view classes 2013-07-01 10:53:34 -07:00
Kevin Sawicki
01f220fb1b Support non-English keyboard languages
Use event.which if it is lower than the parsed key identifier.
This is the case when a non-English keyboard language is selected and
a physical English keyboard is being used.

This allows keybindings to still work even when the physical key pressed
is different than the key it maps to for the currently selected language.

Closes #585
2013-06-28 16:36:55 -07:00
Nathan Sobo
b66431e3a6 Delete atom.windowState in global afterEach
It seems like the windowState was getting saved to disk, causing weird
window state to be loaded on the next test run and a spec to fail.
2013-06-28 04:39:31 -06:00
Kevin Sawicki
8561bb34a8 Save and restore spec window dimensions
Closes #597
2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
d55c09c9d3 Nuke documentation threshold specs
We're going to make it a lint task that's run via grunt.
2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
f4300b8cab Fix specs due to scrollTop/Left becoming methods on EditSession 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
c596514d11 Accept documents in EditSession and replicate scroll position 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
390b03647e Don't clear #jasmine-content when window.debugContent is true 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
95e69ad858 Use .getState() instead of .serialize() in replication specs 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
ef0363e8ff Use jasmine-focused npm instead of spec/jasmine-focused.coffee 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
a62cd0f16a Replicate active pane item 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
f340828506 Use .getState() instead of .serialize() when mutating panes 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
8b0a68dd4a Return this from $.fn.attachToDom spec helper 2013-06-28 04:39:29 -06:00
Kevin Sawicki
1049a677bf Set dimension of spec window 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
0851b4d011 Replicate pane splitting and removal
We're using Peer.js to stream changes to shared telepath documents
between participants.

We're replacing the rootView of joiners in a somewhat hacky way,
but replication of pane splits and items is fully tested.
2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
8a7c57994d Remove parens from require 2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
6480e956af Keep resident window state object 2013-06-28 04:39:26 -06:00
Cheng Zhao
e1c2aa0da1 Fix specs regarding beforeunload event. 2013-06-27 21:31:07 +08:00
Cheng Zhao
bdbec54f24 Make PaneContainer.confirmClose() synchronous. 2013-06-27 16:21:14 +08:00
Cheng Zhao
1df48d1725 Fix spec of confirmSync in 'window:close'. 2013-06-27 15:07:38 +08:00
Cheng Zhao
6c0f4c09d9 Make Pane.promptToSaveItem synchronous. 2013-06-27 12:40:36 +08:00
Kevin Sawicki
e67676b01c Use deleteSelectedText() instead of delete()
Selection.delete() adds to the selection if it is empty which
we don't want to do when replacing selected text.

Closes #603
2013-06-26 19:03:45 -07:00
Kevin Sawicki
86c8343107 Score grammar matches using longest fileType match
Previously the score for two grammars matching on path
was equal and so the first one would be selected.

Now the longer match will have a higher score and will be selected
over other grammars with shorter fileType match lengths.

Closes #602
2013-06-24 18:23:54 -07:00
probablycorey
e72c48607b Fix doc specs 2013-06-20 17:15:52 -07:00
probablycorey
3e91334c82 Bundle themes are no longer copied 2013-06-20 17:15:52 -07:00
Corey Johnson & Nathan Sobo
b9accadb70 When normalizing indent, ignore leading spaces of first line
Fixes #594
2013-06-19 12:21:05 -06:00
Kevin Sawicki
1764677b7d Unsubscribe markers when destroying display buffer
Previously the display buffer markers would still fire events
even after a display buffer was destroyed since they were not
being unsubscribed from their underlying buffer marker which
could still fire events in the case of an editor split on the
same buffer.

Closes #593
2013-06-19 09:56:55 -07:00
Kevin Sawicki
1178d844d0 Look before and after empty lines for max indent level
Previously the indentation guide level for empty lines was
derived by only looking after the empty line which caused gaps
in certain cases.

Now the indentation for an empty line is the higher value of the
previous non-empty line indentation and the following non-empty
line indentation.

Closes #588
2013-06-18 09:56:31 -07:00
Kevin Sawicki
bc2d0ff0cc Only check ending rules when stack size increases
Previously on zero length matches the last two rules were compared
and if they had the same scope name then the last rule was popped
and the remaining line was tokenized using the current scope stack
to prevent infinite parsing loops.

This caused nested method calls in Java to not tokenize correctly
since method rules were sequential in the stack but did not constitute
an infinite loop of zero matches since the stack was currently decreasing.

Now the last two rules are only compared when the stack size is increasing
to prevent this false positive.

Closes #587
2013-06-17 13:08:10 -07:00
Kevin Sawicki
2826d50cbb Remove logging of pid 2013-06-17 12:11:26 -07:00
Corey Johnson & Kevin Sawicki
8c4bddac9f Add spec for Task.once() 2013-06-17 12:11:26 -07:00
Corey Johnson & Kevin Sawicki
2a7d35cc39 Remove spec that was renamed to task-spec.coffee 2013-06-17 12:11:26 -07:00
Corey Johnson & Kevin Sawicki
8389698958 Drop suffix from handler path 2013-06-17 12:11:26 -07:00
Kevin Sawicki
8280b3a3ff Update repository status to use new task style 2013-06-17 12:11:25 -07:00
Kevin Sawicki
e8bf433c68 Remove unused class 2013-06-17 12:11:25 -07:00
Kevin Sawicki
b42cc6f683 Update spell check view to use new task 2013-06-17 12:11:25 -07:00
Kevin Sawicki
a1d6ae010e 💄 2013-06-17 12:11:25 -07:00
Kevin Sawicki
e8c0f46afb Relativize exact path matches to the empty string 2013-06-14 09:20:28 -07:00
Kevin Sawicki
f408406ef0 Support symlinks in .relativize() and .contains() 2013-06-14 08:29:21 -07:00
Kevin Sawicki
ff7c639b64 Don't use error class in select list
Use a subtler error message that displays in the same place as the
loading message but does not change the entire background of the
view.

Also, extending classes can now customize the message displayed
when there are no items and also no filtered items to allow for
different messages for these two cases.
2013-06-13 11:31:09 -07:00
Kevin Sawicki
0f562330cf Remove unused functions and specs 2013-06-13 10:02:13 -07:00
Kevin Sawicki
4f65cb099a Remove unused fsUtils.split() 2013-06-12 20:44:15 -07:00
Kevin Sawicki
ed3a4a33e2 Rename .write() to writeSync() 2013-06-12 20:38:26 -07:00
Kevin Sawicki
d77705a039 Rename listTree() to listTreeSync() 2013-06-12 18:26:44 -07:00
Kevin Sawicki
27d9da15dc Rename list() to listSync() 2013-06-12 18:25:42 -07:00
Kevin Sawicki
a192842dc0 Rename isExecutable() to isExecutableSync() 2013-06-12 18:22:43 -07:00
Kevin Sawicki
400aa93bf3 Rename isFile() to isFileSync() 2013-06-12 18:21:57 -07:00
Kevin Sawicki
86952ff85e Rename isDirectory() to isDirectorySync() 2013-06-12 18:16:31 -07:00
Kevin Sawicki
15f6a33c4b Rename path variables to prevent collisions 2013-06-12 17:27:23 -07:00
Kevin Sawicki
10f92836e6 Rename path variables to prevent collisions 2013-06-12 17:19:16 -07:00
Kevin Sawicki
54558c863d Remove unused path 2013-06-12 17:10:19 -07:00
Kevin Sawicki
d112089152 Use filePath variable instead of path 2013-06-12 16:57:47 -07:00
Kevin Sawicki
6c91d8bea6 Add missing require for path 2013-06-12 16:51:53 -07:00
Kevin Sawicki
82013b1970 Use path.join() instead of fsUtils.join() 2013-06-12 16:20:40 -07:00
Kevin Sawicki
7cf4063d9e Use path.dirname() instead of fsUtils.directory() 2013-06-12 15:54:34 -07:00
Kevin Sawicki
bdb641ec94 Use path.extname() instead of fsUtils.extension() 2013-06-12 15:43:58 -07:00
Kevin Sawicki
eede4a386f Use path.basename() instead of fsUtils.base() 2013-06-12 15:26:09 -07:00
Kevin Sawicki
04c5e9fa42 Return subscription from RootView.eachEditor() 2013-06-12 11:38:05 -07:00
Kevin Sawicki
6d0f303cd5 Set initialPath on load settings 2013-06-11 15:48:22 -07:00