Commit Graph

4835 Commits

Author SHA1 Message Date
Ben Ogle
b54deccfae String type must be strict.
It makes sense to coerce from more general -> more specific data types.
eg. string -> int, etc. But coercing the other way is problematic
in the case of chaining because the more general type will swallow the
specific type. eg. Setting `false` on type: [‘string’, ‘boolean’] will 
coerce the boolean to a string, and will never allow the value to be
a boolean.
2014-09-29 16:09:49 -07:00
Ben Ogle
a7185a894f Fix specs 2014-09-29 16:09:49 -07:00
Ben Ogle
16c7fd3d70 Add spec for update event on load 2014-09-29 16:09:49 -07:00
Ben Ogle
08b138997d Change the onDidChange / observe arguments
Support passing no keypath
2014-09-29 16:09:48 -07:00
Ben Ogle
ef19e925e9 Strings accept numbers too 2014-09-29 16:09:48 -07:00
Ben Ogle
2c1fa19e27 Update spec strings 2014-09-29 16:09:48 -07:00
Ben Ogle
22fb5adda9 Remove deprecated calls for config.observe .. callNow: false in core 2014-09-29 16:09:47 -07:00
Ben Ogle
800dee09ba Make boolean schema validator a little tighter 2014-09-29 16:09:47 -07:00
Ben Ogle
6b4ce902ba Undefined in Config::set always unsets the value 2014-09-29 16:09:46 -07:00
Ben Ogle
03a9a67ba8 Move spec 2014-09-29 16:08:04 -07:00
Ben Ogle
ae76bd6c96 Do not allow infinity in number types 2014-09-29 16:08:04 -07:00
Ben Ogle
662fc443dc Fix specs 2014-09-29 16:08:04 -07:00
Ben Ogle
0fc773c1fc Warn when loading bogus values from the user's config 2014-09-29 16:08:03 -07:00
Ben Ogle
832b4ae4d8 Fix specs 2014-09-29 16:08:03 -07:00
Ben Ogle
af1bdaf901 Dont fail when there are thigns to set with array and object types 2014-09-29 16:08:03 -07:00
Ben Ogle
969ca048e8 Fix specs 2014-09-29 16:08:03 -07:00
Ben Ogle
0d2fdec326 Fix specs in config 2014-09-29 16:08:03 -07:00
Ben Ogle
fc3ba775c8 Support schemas in packages 2014-09-29 16:08:03 -07:00
Ben Ogle
0bb8821644 Editor config uses a schema 2014-09-29 16:08:03 -07:00
Ben Ogle
5fdf3f894c Load the config from Atom class so as not to duplicate 2014-09-29 16:07:02 -07:00
Ben Ogle
5bf09716ef convert the workspace config to use a schema 2014-09-29 16:06:27 -07:00
Ben Ogle
9fff544955 Fix specs 2014-09-29 16:05:24 -07:00
Ben Ogle
9fbbd1e59b Back to getSchema 2014-09-29 16:05:24 -07:00
Ben Ogle
2c1190b552 Validate enum keywords 2014-09-29 16:05:24 -07:00
Ben Ogle
5e9a269278 getSchema -> schemaForKeyPath 2014-09-29 16:05:24 -07:00
Ben Ogle
f7f28e7995 Handle minimum and maximum keywords on number types 2014-09-29 16:05:24 -07:00
Ben Ogle
ac67430926 Handle bad values in number type 2014-09-29 16:05:23 -07:00
Ben Ogle
409b5536e1 Support arrays 2014-09-29 16:05:23 -07:00
Ben Ogle
2526ba0efb Add an object filter 2014-09-29 16:05:23 -07:00
Ben Ogle
1a8c5ba551 Handle validation of schema types 2014-09-29 16:05:23 -07:00
Ben Ogle
f909d32826 Support more types 2014-09-29 16:05:23 -07:00
Ben Ogle
d0bb49dea0 Add type filter system to config 2014-09-29 16:05:23 -07:00
Ben Ogle
02e87555f4 Handle schema loading 2014-09-29 16:05:23 -07:00
Ben Ogle
a79c015774 Update ::observe and add ::onDidChange 2014-09-29 16:05:23 -07:00
Nathan Sobo
f6f891fa14 Construct test instance of MenuManager in spec 2014-09-29 11:45:01 -06:00
Nathan Sobo
be7d093a4a Merge remote-tracking branch 'origin/master' into ns-workspace-custom-elements
Conflicts:
	package.json
2014-09-29 11:13:45 -06:00
Nathan Sobo
2f93032a37 Don’t add duplicate items to the same menu 2014-09-29 11:11:36 -06:00
Nathan Sobo
c058b44a1b 💄 spec description 2014-09-29 11:11:10 -06:00
Nathan Sobo
bbeb0b5919 Return disposables from MenuManager which can be used to remove menus 2014-09-29 10:34:50 -06:00
Ben Ogle
b958286d22 Click to expand stack traces 2014-09-26 17:31:09 -07:00
Nathan Sobo
b5fc4aec84 Re-render component when EditorView is reattached
Fixes #3640
2014-09-26 15:15:23 -06:00
Nathan Sobo
0ebedeec3a Merge remote-tracking branch 'origin/master' into ns-workspace-custom-elements
Conflicts:
	package.json
	src/workspace.coffee
2014-09-26 14:49:28 -06:00
Ben Ogle
1f2fc4bf00 Merge pull request #3619 from lee-dohm/scroll-past-end
Add ability to scroll past the end of the file
2014-09-26 11:47:58 -07:00
Ben Ogle
3601d113ad Deactivate and unload all packages 2014-09-26 11:21:42 -07:00
Lee Dohm
00baedbdf9 Add specs for editor.scrollPastEnd behavior 2014-09-25 23:05:47 -07:00
Nathan Sobo
aa1eb94fa7 Ignore redundant calls to $::attachToDom 2014-09-25 22:17:26 -06:00
Nathan Sobo
5a72d12026 Don’t use jQuery to attach window listeners in spec-helper
This prevents the command palette spec from failing because it’s
explicitly asserting that no listener registered on the window without
a description should show up in the palette, but core:close is also
registered on the workspace.
2014-09-25 20:57:09 -06:00
Nathan Sobo
3442157e16 Fix command-installer-spec 2014-09-25 20:39:04 -06:00
Ben Ogle
c5fa8fdf11 Fix spec 2014-09-25 15:15:50 -07:00
Ben Ogle
e060e08f93 Deactivate and unload lang packages after use 2014-09-25 15:14:30 -07:00
Ben Ogle
039afff1de Unload the coffee grammar after using 2014-09-25 15:14:29 -07:00
Ben Ogle
d33bd291dd Deactivate / unload packages after use
This was messing with other specs!
2014-09-25 15:14:29 -07:00
Ben Ogle
0bc2b45200 Rename spec files 2014-09-25 15:14:29 -07:00
Ben Ogle
683d0d1b16 Editor -> TextEditor 2014-09-25 15:14:29 -07:00
Ben Ogle
82c53b539a editor.coffee -> text-editor.coffee 2014-09-25 15:14:29 -07:00
Ben Ogle
c2f44efe31 editor-view -> text-editor-view 2014-09-25 15:14:29 -07:00
Ben Ogle
b3038eb968 editor-component -> text-editor-component 2014-09-25 15:14:29 -07:00
Nathan Sobo
442223f97b 💄 spec language 2014-09-25 12:44:53 -06:00
Nathan Sobo
eaa90e6158 Clean up debugging 2014-09-25 12:33:05 -06:00
Nathan Sobo
670f3e4946 Add WorkspaceElement 2014-09-25 11:41:09 -06:00
Nathan Sobo
ae488fc7fe Update document edited status in workspace model
This also fixes a previous oversight where the status wasn’t updated
when switching between pane items with different modified status.
2014-09-24 17:00:25 -06:00
Nathan Sobo
28deb9dec5 Maintain document.title in the workspace model, not the view 2014-09-24 16:26:54 -06:00
Nathan Sobo
186335d619 Mock out document.title with Object.defineProperty
Previously the WorkspaceView::setTitle was mocked in specs to prevent
the title from changing. But I would like to move the title update logic
without breaking assertions, so now we can assert directly on
document.title.
2014-09-24 15:56:50 -06:00
Nathan Sobo
1c58438124 Move PaneContainerView::confirmClose to the model layer 2014-09-24 15:46:01 -06:00
Nathan Sobo
465d2afd95 Remove the old root view properly 2014-09-24 15:28:34 -06:00
Nathan Sobo
47f8f7eb11 Switch specs to use activationCommands instead of activationEvents
The activationEvents are converted to the same format as
activationCommands, and that property will be deprecated.
2014-09-24 14:34:29 -06:00
Nathan Sobo
63181a17c8 Support activationCommands field in package.json
This field mandates selectors in its structure and closely matches the
API of `atom.commands.add`. It will supplant `activationEvents` moving
forward.
2014-09-24 14:34:28 -06:00
Nathan Sobo
7d31b17273 Use the CommandRegistry to register activation event listeners
Commands registered with the command registry will always be handled
first, so as long as we disable any listeners in the registry that were
already invoked for the current command, we don’t need to disable jQuery
methods before replaying the command after activating the package.

This commit adds the ability to call .disableInvokedListeners on the
event passed to the command listeners. This returns a function which
can be called to reenable them.
2014-09-24 14:34:28 -06:00
Nathan Sobo
066f6bf03c Forward stop[Immediate]Propagation to original event in CommandRegistry
Previously, stopping propagation would work on the synthetic bubbling
phase of the command registry itself, but the original event would
continue to propagate which is counterintuitive.
2014-09-24 14:34:28 -06:00
Nathan Sobo
a492596f7f Allow atom.commands to participate in activationEvents
* Activation events can be handled via atom.commands
* Pre-existing listeners registered via atom.commands are disabled when
  replaying events for the activated package.
2014-09-24 14:34:28 -06:00
Nathan Sobo
2df5957f9b Restore commands after each spec
This commit adds the ability to get and restore snapshots of command
listeners. Whatever commands are installed before specs begin are
preserved, but commands added during specs are always cleared away.
2014-09-24 14:34:28 -06:00
Nathan Sobo
a7196ec906 Dispatch activation commands with native DOM apis in specs 2014-09-24 14:34:28 -06:00
Nathan Sobo
c094b7a0ef Extract package-manager-specs from atom-specs 2014-09-24 14:34:28 -06:00
Nathan Sobo
09b5ac887a Return whether a dispatched command matched a listener 2014-09-24 14:34:28 -06:00
Nathan Sobo
67ff8f4382 Don’t clear commands after specs
Commands are typically registered once at eval time. Clearing them
means that commands aren’t available except in the first spec.
2014-09-24 14:34:27 -06:00
Nathan Sobo
0c9fd46030 Add CommandRegistry::dispatch for tests 2014-09-24 14:34:27 -06:00
Nathan Sobo
3dbaa0679b Merge pull request #3587 from atom/ns-workspace-view-providers
Add view provider API to Workspace
2014-09-23 13:08:00 -06:00
Ben Ogle
3bc115a7a0 Merge pull request #3606 from atom/bo-model-placeholder-text
Model EditorView::setPlaceholderText
2014-09-23 11:20:23 -07:00
Ben Ogle
169a5de6a3 not.toBeDefined -> toBeUndefined 2014-09-23 10:38:38 -07:00
Ben Ogle
4606ce2d50 Model setPlaceholderText
Less dependence on the editorView!
2014-09-22 17:21:42 -07:00
Ben Ogle
c62fb26001 onDidChangeSelectionRange emits object with ranges + selection 2014-09-22 16:08:12 -07:00
Ben Ogle
5083c18c84 Add cursor to onDidChangeCursorPosition event object 2014-09-22 15:37:41 -07:00
Kevin Sawicki
dc3a3225b3 Remove logging from specs 2014-09-22 15:00:06 -07:00
Ben Ogle
6e8cfba440 nof 2014-09-22 11:07:53 -07:00
Ben Ogle
7a429b024e Use GitRepository rather than Git 2014-09-22 11:07:41 -07:00
Nathan Sobo
ddb85abe77 Don’t add the same editor to two different panes in spec 2014-09-19 16:30:37 -06:00
Nathan Sobo
55cce48af1 Throw an exception if the same pane item is added twice in the workspace 2014-09-19 16:24:13 -06:00
Nathan Sobo
d344adc21e Allow view providers to specify a createView factory method
If present, it will be called with the model object instead of
instantiating the view constructor directly and assigning a model on it.
This gives users more flexibility when constructing views.
2014-09-19 16:24:13 -06:00
Nathan Sobo
74d772f069 Rename view/modelClass to view/modelConstructor in view provider specs
It’s a more technically correct term. You use a class keyword to declare
these things, but the actual objects you pass around to talk about them
are constructor functions.
2014-09-19 16:24:13 -06:00
Nathan Sobo
e2e804483f Return disposable from ViewRegistry::addViewProvider 2014-09-19 16:24:13 -06:00
Nathan Sobo
b5499247b3 Use view providers to build views if a matching provider is available 2014-09-19 16:24:13 -06:00
Nathan Sobo
54378b11d4 Isolate ViewRegistry specs 2014-09-19 16:24:12 -06:00
Nathan Sobo
0877721ce9 Construct PaneAxisViews and PaneViews via ViewRegistry 2014-09-19 16:24:12 -06:00
Nathan Sobo
7f41be3103 Use atom.workspace.getView to construct WorkspaceViews
It returns the root DOM node of the workspace. Eventually this will
be a custom element but for now it’s just a DOM node with a
__spacePenView reference on it.
2014-09-19 16:24:12 -06:00
Nathan Sobo
7baa3b6f09 Start on Workspace::getView 2014-09-19 16:24:12 -06:00
Kevin Sawicki
ee093d1709 Merge pull request #3582 from atom/ks-dont-allow-focused-specs-on-ci
Fail focused specs on CI
2014-09-18 16:16:17 -07:00
Ben Ogle
155d4ce733 Merge pull request #3569 from atom/bo-proper-doc-marker
Rename DisplayBufferMarker to Marker
2014-09-18 16:14:35 -07:00
Kevin Sawicki
021278e902 Always auto indent at least one hard tab
Previously when the delta between the suggested and current indent level
was greater than zero but less than one, no text would be inserted since
Editor::buildIndentString returns an empty string for levels less than one
when using hard tabs.

Closes #3575
2014-09-18 15:36:31 -07:00
Kevin Sawicki
597942c4ac Fail focused specs on CI
This ensures focused specs never end up as green builds
2014-09-18 15:18:42 -07:00
Kevin Sawicki
7f3279e789 Unfocus spec 2014-09-18 14:50:36 -07:00
Ben Ogle
9af2325f17 Rename DisplayBufferMarker -> Marker
Gnar!! 😎
2014-09-18 13:53:12 -07:00
Ben Ogle
cef8b95ef3 Deprecate s|getAttributes for s|getProperties 2014-09-18 13:53:12 -07:00
Kevin Sawicki
31dd109343 Add Editor::onDidDestroy 2014-09-18 11:51:44 -07:00
Kevin Sawicki
c37e4649b5 Only call replace on string arguments
Prevents errors being thrown when trying to call replace on non-string
arguments.
2014-09-18 11:31:29 -07:00
Kevin Sawicki
3fb22f123a Don't throw errors when folding comments
Previously trying to fold single line comments at the start/end
of files would throw errors since the +1 and -1 used in the
index ranges would cause the loop to advance past the last row
or before the first row.
2014-09-18 11:06:25 -07:00
Ben Ogle
8448b265d5 Merge pull request #3549 from atom/bo-visibility-split
Add sections and split methods into essential / extended API
2014-09-17 16:51:50 -07:00
Nathan Sobo
d36c738b07 Merge pull request #3469 from atom/ns-command-registry
Add command registry
2014-09-17 14:55:19 -06:00
Kevin Sawicki
f1fd13b0b2 Return as soon as first paired character is found
Previously the character count of the entire string was taken even
though it was only checking for the presence of a paired character.

Now hasPairedCharacter returns as early as possible and the now
unused getCharacterCount has been removed.
2014-09-17 10:35:33 -07:00
Kevin Sawicki
e343b0e0fc Don't treat consecutive variation selectors as a sequence 2014-09-17 10:17:27 -07:00
Kevin Sawicki
3acddf3e71 📝 Drop text 2014-09-17 10:17:26 -07:00
Kevin Sawicki
df68ae26a2 Add specs for variation sequences 2014-09-17 10:17:26 -07:00
Kevin Sawicki
fb7061f500 📝 Mention variation sequence in specs 2014-09-17 10:17:26 -07:00
Kevin Sawicki
878da262d2 Add support for Unicode variation sequences
These are character pairs that should be treated as tokens with a
buffer delta of 2 and a screen delta of 1.
2014-09-17 10:17:26 -07:00
Kevin Sawicki
36f60c517e Assert other whitespace class is not present 2014-09-17 09:50:55 -07:00
Kevin Sawicki
348f865cab Add spec for all whitespace lines 2014-09-17 09:47:49 -07:00
Kevin Sawicki
18f54e6780 💄 Put leading spec first 2014-09-17 09:42:31 -07:00
Kevin Sawicki
b281737838 Add leading/trailing classes to hard tab tokens
Previously the leading-whitespace and trailing-whitespace classes
were never added to tokens that were hard tabs.
2014-09-17 09:42:31 -07:00
Ben Ogle
c0dd53104a Make a managing the atom window section
de-public the get/setWindowDimensions in favor of 
the (get|set)(Size|Position)
2014-09-16 11:37:11 -07:00
Ben Ogle
f12b70e3b7 Editor::onDidChangeScreenLines -> onDidChange 2014-09-16 10:51:32 -07:00
Nathan Sobo
eb97154c94 Merge remote-tracking branch 'origin/master' into ns-command-registry 2014-09-16 10:27:00 -06:00
Nathan Sobo
a069f34ad6 Fix CommandRegistry::findCommands spec
Don’t assert against commands registered on the window with jQuery
2014-09-16 09:23:52 -06:00
Nathan Sobo
a0edb92e16 Rename editor.softWrapped config option back to editor.softWrap 2014-09-15 14:34:35 -06:00
Kevin Sawicki
8c2bcf3943 Catch and log deactivate errors
Closes #3538
2014-09-15 08:34:54 -07:00
Kevin Sawicki
e6252546c4 Set initialLoadComplete to true in specs 2014-09-11 15:49:44 -07:00
Nathan Sobo
8f9cf3c790 Set the atom.commands root node to document.body in beforeEach 2014-09-11 14:17:45 -06:00
Nathan Sobo
99cf8fabc0 Clear atom.commands after each spec 2014-09-11 14:13:48 -06:00
Nathan Sobo
3e0e19d51b Add CommandRegistry::findCommands 2014-09-11 13:48:35 -06:00
Nathan Sobo
155fb675ec 💄 group dispatch specs 2014-09-11 13:48:35 -06:00
Nathan Sobo
43d3082d4e Allow multiple commands to be registered by passing an object 2014-09-11 13:48:35 -06:00
Nathan Sobo
aee33fc126 Pass selector first to CommandRegistry::add 2014-09-11 13:48:35 -06:00
Nathan Sobo
4de0865d28 Allow listeners to be removed via a Disposable returned from ::add 2014-09-11 13:48:34 -06:00
Nathan Sobo
fe27ebec1b Handle .stopImmediatePropagation() being called on command events 2014-09-11 13:48:34 -06:00
Nathan Sobo
fbaf956e1f Handle .stopPropagation() being called on command events 2014-09-11 13:48:34 -06:00
Nathan Sobo
5eb22520f1 Order multiple matching listeners by selector specificity 2014-09-11 13:48:34 -06:00
Nathan Sobo
a075aa2b07 Perform synthetic bubbling through event target ancestors 2014-09-11 13:48:34 -06:00
Nathan Sobo
decc983420 Start on CommandRegistry 2014-09-11 13:48:34 -06:00
Ben Ogle
04c0824822 Fix / clean up specs 2014-09-11 11:28:21 -07:00
Ben Ogle
f38fb2a924 nof 2014-09-11 11:11:15 -07:00
Ben Ogle
f39114a95c Subscribe to items via event methods.
Add deprecation warnings when they don’t return a disposable
2014-09-11 10:48:03 -07:00
Ben Ogle
c1f8065caf Use the new split*() methods on Pane model in WorkspaceView specs 2014-09-10 17:41:38 -07:00
Ben Ogle
6e3c945fa2 Use event methods for theme subscriptions 2014-09-10 17:26:08 -07:00
Nathan Sobo
d55f5cba78 Upgrade first-mate for event subscription methods 2014-09-10 17:24:55 -06:00
Ben Ogle
d3b3fdefc9 Merge pull request #3507 from atom/bo-rename-events
Rename the rest of the internal events to the onDid* pattern
2014-09-10 12:11:26 -07:00
Ben Ogle
40b32930cf Revert "Add Project::onDidCreateBuffer"
This reverts commit 4070e5fb25.
2014-09-10 11:55:41 -07:00
Ben Ogle
61fa1c4230 Revert "Add Project::observeBuffers"
This reverts commit b6fe72ef9e.

Conflicts:
	src/project.coffee
2014-09-10 11:55:26 -07:00
Kevin Sawicki
883f7e1f5a Use cross-platform path in specs 2014-09-10 10:22:48 -07:00
Ben Ogle
5ba5215f5d Add event subscription methods to ThemeManager 2014-09-09 15:35:00 -07:00
Ben Ogle
3bf348e51f Add ThemeManager::onDidReloadAll 2014-09-09 15:24:55 -07:00
Ben Ogle
0afd8a1392 Add Package::onDidDeactivate 2014-09-09 15:09:18 -07:00
Ben Ogle
ae4f92cc52 Add onDidChangeStatuses 2014-09-09 14:45:31 -07:00
Ben Ogle
05f54d427d Add Git::onDidChangeStatus 2014-09-09 14:28:30 -07:00
Ben Ogle
b6fe72ef9e Add Project::observeBuffers 2014-09-09 14:13:26 -07:00
Ben Ogle
4070e5fb25 Add Project::onDidCreateBuffer 2014-09-09 14:12:49 -07:00
Ben Ogle
f357f694b3 Merge pull request #3456 from atom/ns-editor-event-methods
Add event subscription methods for Editor and associated classes
2014-09-09 13:40:45 -07:00
Kevin Sawicki
7b1f8cc7da Set project path for window:open-path files
The project path will now be set to the parent directory if it isn't
already set when a file path is specified via the window:open-path
event.

Closes atom/tree-view#217
2014-09-09 09:55:31 -07:00
Ben Ogle
8aa1784c4a Add Editor::onDidChangeScreenLines 2014-09-08 16:04:43 -07:00
Kevin Sawicki
35a48f0cfb Update specs to expect an element 2014-09-08 09:33:51 -07:00
Ben Ogle
e6dbea09fe Add onDidCreateMarker and onDidUpdateMarkers 2014-09-05 17:26:14 -07:00
Ben Ogle
aeffef30c6 Directly subscribe to the decorations in EditorComponent 2014-09-05 16:49:30 -07:00
Ben Ogle
7ae25d34e7 Decoration Params -> Properties 2014-09-05 16:20:42 -07:00
Ben Ogle
e6e6028683 Deprecate decoration events 2014-09-05 15:14:27 -07:00
Ben Ogle
6e8a626de2 Add ::onDidChangeSoftWrapped to DisplayBuffer and Editor 2014-09-05 13:41:46 -07:00
Ben Ogle
21e4d8a064 Add DisplayBuffer::onDidChange 2014-09-05 13:30:59 -07:00
Ben Ogle
db84b7952c fix another linter error 2014-09-05 12:44:56 -07:00
Ben Ogle
289b22c782 Use event methods in TokenizedBuffer spec 2014-09-05 12:40:14 -07:00
Ben Ogle
a2adbff3e9 Add TokenizedBuffer::onDidTokenize 2014-09-05 12:33:28 -07:00
Ben Ogle
9435f852dd Use new decoration updated event method 2014-09-05 12:25:14 -07:00
Nathan Sobo
6ad9531e5c Add Selection::onDidChangeRange and ::onDidDestroy and deprecate ::on 2014-09-05 11:39:34 -07:00
Nathan Sobo
6bd8702421 Deprecate DisplayBufferMarker::on 2014-09-05 11:39:34 -07:00
Nathan Sobo
c69b5fc0a0 Remove specs for ::onDidMoveCursor, which was removed 2014-09-05 11:39:33 -07:00
Nathan Sobo
1131b33a83 Add DisplayBufferMarker::onDidChange and ::onDidDestroy 2014-09-05 11:39:33 -07:00
Nathan Sobo
161edfd15a Remove ‘cursors-moved’ event
It event was not document only being used in EditorComponent. Due to
our batching strategy, it’s fine to respond to individual
::onDidMoveCursor events.
2014-09-05 11:39:33 -07:00
Nathan Sobo
2a81687d38 Add Editor::onDidMoveCursor 2014-09-05 11:39:33 -07:00
Nathan Sobo
05ea381c0a Add Editor::onWill/DidInsertText 2014-09-05 11:39:33 -07:00
Nathan Sobo
965afc2c37 Rename softWrap to softWrapped
Our new pattern for booleans is to have ::set and ::is, and that means
the property name needs to be in passive voice for ::is to make sense.
This is in preparation for adding a new change observation method.

* ::setSoftWrapped
* ::isSoftWrapped
* ::toggleSoftWrapped
2014-09-05 11:39:33 -07:00
Nathan Sobo
133f3f45ab Add Editor::onDidChangePath 2014-09-05 11:36:40 -07:00
Nathan Sobo
b731f7cbdc Add Editor::onDidChangeTitle 2014-09-05 11:36:40 -07:00
Kevin Sawicki
f6bb7fc089 Merge pull request #3458 from atom/ks-store-injection-grammars
Include injection grammars in active list
2014-09-05 09:14:41 -07:00
Ben Ogle
336afc32c2 Add PaneView::getModel() 2014-09-04 16:48:04 -07:00
Ben Ogle
a81393320c Support a copyActiveItem param in Pane::split* methods 2014-09-04 16:41:20 -07:00
Kevin Sawicki
90592a70be Include injection grammars in active list
Prevents an immediate flicker when restarting Atom with editors
open that have injection matches.
2014-09-04 16:04:32 -07:00
Nathan Sobo
a50f62dc93 Merge remote-tracking branch 'origin/master' into ns-text-buffer-event-methods
Conflicts:
	package.json
2014-09-04 14:40:52 -06:00
Ivan Žužak
b5676adf8a Remove check for deprecated function calls 2014-09-04 21:52:00 +02:00
Nathan Sobo
a947a357f4 Upgrade text-buffer for event subscription methods 2014-09-04 12:44:53 -06:00
Ivan Zuzak
af2f155082 Merge branch 'master' into iz-gutter-click-select-line 2014-09-04 16:22:51 +02:00
Nathan Sobo
9de0ba17b2 Add Workspace::onDidOpen event subscription method 2014-09-04 06:57:59 -06:00
Nathan Sobo
57699e6245 Use Workspace::getActivePane instead of property in spec 2014-09-04 06:57:46 -06:00
Nathan Sobo
4946eec367 Merge remote-tracking branch 'origin/master' into ns-simplify-events
Conflicts:
	docs/your-first-package.md
2014-09-03 19:31:37 -06:00
Nathan Sobo
db571a2fbf Avoid deprecation by calling ::getActivePaneItem 2014-09-03 19:26:19 -06:00
Nathan Sobo
22c62b3107 Replace ‘editor-created’ event with ::onDidAddTextEditor 2014-09-03 19:26:07 -06:00
Nathan Sobo
83327eeabb Don’t test for editor-created events when editor is copied
We can handle this through ::onDidAddTextEditor when the copy is added
back to the pane.
2014-09-03 19:25:40 -06:00
Ben Ogle
691c7ee585 Considerably more elegant (and correct) moveLeft and moveRight 2014-09-03 17:19:06 -07:00
Ben Ogle
48b693c1c1 Add columnCounts to selection methods 2014-09-03 16:20:25 -07:00
Ben Ogle
f82c59d865 Add columnCount to moveRight 2014-09-03 16:10:33 -07:00
Ben Ogle
29f15d0f20 Make moveLeft() with huge values span multiple rows 2014-09-03 16:10:33 -07:00
Ben Ogle
99c07decf2 Add columnCount var to Editor::moveLeft and Cursor::moveLeft 2014-09-03 16:10:33 -07:00
Ben Ogle
851034c8d3 Failing test 2014-09-03 16:10:33 -07:00
Ben Ogle
b90670ff2d Gracefully handle the case when there is no screenline 2014-09-03 16:00:57 -07:00
Ben Ogle
523a255e48 Add Editor::lineTextForScreenRow()
Closes #3055
2014-09-03 14:42:46 -07:00
Ben Ogle
c0c941b8db lineForBufferRow -> lineTextForBufferRow 2014-09-03 14:42:46 -07:00
Ben Ogle
e3a0339fe3 Editor::lineForScreenRow -> ::tokenizedLineForScreenRow 2014-09-03 14:42:46 -07:00
Ben Ogle
ae49fd50b7 DisplayBuffer::linesForRows -> ::tokenizedLinesForScreenRows
Clarity!
2014-09-03 14:42:46 -07:00
Ben Ogle
99f899dc4a lineForScreenRow -> tokenizedLineForRow
The method was severely mislabeled
2014-09-03 14:42:45 -07:00
Ben Ogle
2b9b4a48ef tokenizedLineForRow -> tokenizedLineForScreenRow 2014-09-03 14:42:45 -07:00
Ben Ogle
05bbc480b0 displayBuffer::lineForRow -> tokenizedLineForRow 2014-09-03 14:42:45 -07:00
Nathan Sobo
d753a7f38d Merge pull request #3440 from atom/ns-exclusive-selection-intersection
Don’t merge adjacent non-empty selections
2014-09-03 09:24:05 -06:00
Ben Ogle
1e4fb5b4bc nof 2014-09-02 17:44:01 -07:00
Nathan Sobo
cfd2722348 Don’t merge adjacent non-empty selections
This improves the behavior of #3433
2014-09-02 18:10:05 -06:00
Ben Ogle
0b34e46a1a Merge pull request #3420 from atom/bo-update-cursor-selection-apis
Update cursor and selection APIs
2014-09-02 16:41:42 -07:00
Ben Ogle
dca36d1307 Reorder return values of getSelectedBufferRanges
The implementation does not depend on a specific order, just the test
2014-09-02 14:55:02 -07:00
Ben Ogle
a7db555030 Order the getting ranges / positions by their insertion order 2014-09-02 14:38:11 -07:00
Ben Ogle
659c05c825 Add selectToBufferPosition 2014-09-02 14:09:56 -07:00
Ben Ogle
5ea64f8b11 selectWord() -> selectWordsContainingCursors() 2014-09-02 14:03:57 -07:00
Ben Ogle
70af6198bd selectLine -> selectLinesContainingCursors 2014-09-02 14:02:26 -07:00
Kevin Sawicki
24add494ae Normalize project path in Project::setPath
This will remove consecutive slashes as well as . and ..
characters and make path comparisons accurate.

Closes atom/tree-view#191
2014-09-02 10:49:02 -07:00
Ivan Zuzak
7f14965ca8 Support selecting multiple rows with meta-click 2014-09-01 17:42:55 +02:00
Ivan Zuzak
8c36d2673b Select row when clicking the gutter 2014-08-30 20:20:09 +02:00
Kevin Sawicki
a8a251c457 💄 2014-08-29 09:36:55 -07:00
Ben Ogle
08388d87c0 Remove getSelectionAtIndex
We’re going to eventually get rid of the clone in 
getSelections / getCursors freeze those properties 
and return them directly. Then they can operate 
on the list garbage free.
2014-08-28 18:16:33 -07:00
Ben Ogle
9c53d6f014 Deprecate getCursor() 2014-08-28 18:10:18 -07:00
Ben Ogle
2fced0c1bc Deprecate getSelection 2014-08-28 17:51:16 -07:00
Ben Ogle
271af5dd99 Add Editor::setSelectedScreenRanges() 2014-08-28 17:28:24 -07:00
Nathan Sobo
6c2bb26e77 Add Workspace::observeTextEditors and ::onDidAddTextEditor 2014-08-28 18:28:10 -06:00
Nathan Sobo
a33706ddbc Add PaneContainer::onDidAddPaneItem and ::observePaneItems 2014-08-28 17:42:12 -06:00
Nathan Sobo
877fa40a49 Activate next pane on before invoking onDidDestroy observers 2014-08-28 17:23:49 -06:00
Nathan Sobo
cee7539e35 Add PaneContainer::observePanes and ::onDidAddPane 2014-08-28 17:22:28 -06:00
Ben Ogle
7ca5ece68a Add methods to be symmetrical with selections
* getCursorsOrderedByBufferPosition
* getCursorBufferPositions
* getCursorScreenPositions
2014-08-28 16:06:44 -07:00
Nathan Sobo
b60b9f3e3a Add Pane::observeItems 2014-08-28 16:40:54 -06:00
Ben Ogle
370ad23f7c Remove Cursor from ::moveCursor* methods 2014-08-28 15:25:12 -07:00
Nathan Sobo
b34367ad44 💄 pane-container-spec 2014-08-28 14:42:12 -06:00
Nathan Sobo
74b2f26540 Add PaneContainer::onDidChangeActivePaneItem 2014-08-28 14:41:56 -06:00
Nathan Sobo
9487609f0c 💄 pane-container-spec 2014-08-28 14:41:56 -06:00
Nathan Sobo
1d365db9df Use getActiveItem getter in pane-view-spec 2014-08-28 11:43:08 -06:00
Nathan Sobo
44d70aaa5b Add Pane::onDidChangeActive() 2014-08-28 11:43:07 -06:00
Nathan Sobo
2b63f8a4ee Add PaneContainer::onDidChangeActivePane 2014-08-28 11:43:07 -06:00
Nathan Sobo
8225f759bf Add Pane::onWillDestroyItem() 2014-08-28 11:43:07 -06:00
Nathan Sobo
2d58d9c8b5 Add Pane::onDidActivate 2014-08-28 11:43:07 -06:00
Nathan Sobo
548018e9b2 Add spec for onDidRemoveItem observers when moving items to other panes 2014-08-28 11:43:07 -06:00
Nathan Sobo
9bd2eec4bc Add Pane::onDidMoveItem() 2014-08-28 11:43:07 -06:00
Nathan Sobo
b8fcbe9451 Start adding event subscription methods to pane
This branch uses EventKit, an ultra-simple library for implementing
events. The object implementing the methods maintains its own emitter
object rather than doing a mixin like Emissary encourages. This will
make it easier for us to deprecate ::on on the object itself. Unlike
emissary, the EventKit Emitter implements a super minimalistic API that
only allows one value to be emitted and always returns a Disposable
from subscriptions.
2014-08-28 11:43:06 -06:00
Ivan Zuzak
861dff107a 💄 simplify assignment using coffeescript magic 2014-08-28 19:42:59 +02:00
Nathan Sobo
ebb02bcd37 Use public getters instead of properties in pane-spec 2014-08-28 11:42:42 -06:00
Ivan Zuzak
096255f283 Support built-in context menu items 2014-08-27 13:54:55 +02:00
Kevin Sawicki
e8cd59eaef Waits for reloaded event from ThemeManager
Previously disabling a theme wouldn't wait for the full reload
to finish since and the spec would intermittently fail because
the promise was fulfilled after the spec completed and the
subscription was leaked.
2014-08-26 14:23:20 -07:00
Nathan Sobo
3371ceadf3 Add regression coverage for remeasuring characters w/ requested update
The problem here is that the lines in the editor no longer reflect the
lines on screen, but we're looking for line nodes corresponding to the
editor's current contents.
2014-08-25 18:16:38 -06:00
Ben Ogle
cef24a3979 Remove the react editor options 2014-08-25 12:15:34 -07:00
Ben Ogle
3d2d8c491f rename react-editor-view -> editor-view 2014-08-25 12:07:48 -07:00
Ben Ogle
97bcdcc9b0 Rename ReactEditorView -> EditorView 2014-08-25 12:05:55 -07:00
Ben Ogle
431fab1a43 Remove the editor-view 2014-08-25 12:05:10 -07:00
Ben Ogle
f8026bb005 Require the react-editor-view where we require the editor-view 2014-08-25 12:02:38 -07:00
Ben Ogle
c3c91ae6c3 Only emit the marker-created event when the marker exists
This caused problems in the case of find-and-replace:select-all with 
multiple editors into the same file. 

* a marker is created on the TextBuffer capturing the selection
* DisplayBuffer:create-marker is fired from the first DisplayBuffer. 
The marker is turned into a selection which is merged into the current 
selection, deleting the marker that was created.
* DisplayBuffer::handleBufferMarkerCreated is called on the second
DisplayBuffer. The marker has been destroyed at this point, so it emits 
DisplayBuffer:create-marker with undefined. 
* ERROR>

Closes #3364
2014-08-25 11:42:44 -07:00
Kevin Sawicki
ecf237697b Add react editor view spec for data grammar attrs 2014-08-25 10:22:44 -07:00
Thomas Johansen
4dc89f1b1e 🐛 Fix incorrect assertions 2014-08-24 14:14:26 +02:00
Thomas Johansen
dc55d42491 Add test to verify implementation 2014-08-24 10:17:26 +02:00
Nathan Sobo
a71a524ec7 Rework DOM measurement to try to prevent measurement errors
* Simplify scrollbar refresh and measurement by using imperative DOM
  manipulation instead of React to hide/show scrollbars.
* Rename `::performInitialMeasurement` to `::becameVisible`
* Break `::checkForVisibilityChange` out of `::pollDOM` and use it in
  to check for the element becoming visible in `componentWillUpdate`.
* Don't rely on stored visibility state anywhere. Always check again.
  This could potentially be cached for an update cycle but being wrong
  about this is disastrous so I'm being conservative.
2014-08-21 17:50:46 -06:00
Ben Ogle
26d696a93d Add classes to the workspace for themes
Fixes #3097
2014-08-21 11:53:10 -07:00
Ben Ogle
30aa47026d Do not move cursor when interacting with horiz scrollbar
Fix #3284
2014-08-21 10:40:16 -07:00
Nathan Sobo
5cb084d568 Fix editor:move-to-first-character-of-line with leading hard tabs
Fixes #3314
2014-08-19 11:50:04 -06:00
Kevin Sawicki
0eaec57f7b Merge pull request #3116 from maschs/ms-srcLint
coffeelint!
2014-08-15 13:52:15 -07:00
Nathan Sobo
6c52bcf20c Assign ::firstNonWhitespace/TrailingWhitespaceIndex in Token::split
Fixes #3277
2014-08-15 12:58:27 -06:00
Ben Ogle
919f541685 Merge pull request #3261 from atom/bo-default-react-mini
Default to the react mini editors
2014-08-15 11:16:28 -07:00
Nathan Sobo
2bd8456923 Preserve invisibles in editor model across serialization
Fixes #3281
2014-08-15 08:18:53 -06:00
Maximilian Schüßler
cbe5593381 Do not use "-> return" to mark empty function 2014-08-14 19:42:50 +02:00
Maximilian Schüßler
32e59ce238 Cleanup code according to coffeelint 2014-08-14 19:41:49 +02:00
Kevin Sawicki
776e431cc5 confirmCheckoutHead -> confirmCheckoutHeadRevision 2014-08-13 19:02:09 -07:00
Kevin Sawicki
00170804e5 Remove spec now covered in git spec 2014-08-13 18:51:19 -07:00
Kevin Sawicki
3ce641f53b Move checkout head editor specs to git spec 2014-08-13 18:51:19 -07:00
Nathan Sobo
20daed176b Don't show invisibles in mini editors
This moves observation of the config keys to Editor, which assigns the
invisibles hash or null on the TokenizedBuffer via the DisplayBuffer to
control whether we render invisibles or not.
2014-08-13 16:32:14 -06:00
Nathan Sobo
d37cfb9042 Assign default invisible character glyphs via config defaults
This commit also extends config.get to merge default values into the
returned object if both the assigned and default values are objects.
This allows 'atom.invisibles' to be treated as an object that always has
the default values filled in.
2014-08-13 16:32:13 -06:00
Nathan Sobo
986753981d Use config defaults to assign default invisible characters 2014-08-13 16:32:13 -06:00
Nathan Sobo
970bde9361 Run animation frame after toggling invisibles in EditorComponent spec 2014-08-13 16:31:40 -06:00
Nathan Sobo
7b55946abf Make Editor::moveCursorToFirstCharacterOfLine work with invisible chars 2014-08-13 16:31:40 -06:00
Nathan Sobo
c74f6bb615 Remove handling of invisibles from EditorComponent 2014-08-13 16:31:40 -06:00
Nathan Sobo
63f2ab3088 Render end-of-line invisibles based on state of TokenizedLine 2014-08-13 16:31:39 -06:00
Nathan Sobo
742ec6df0d Determine the endOfLineInvisibles for each TokenizedLine 2014-08-13 16:31:39 -06:00
Nathan Sobo
864f9bc2b4 Preserve hasLeading/TrailingWhitespace when copying lines w/ invisibles
This fixes the styling of the leading whitespace of folded lines
2014-08-13 16:31:39 -06:00
Nathan Sobo
73896d100e Add specs for firstNonWhitespaceIndex and firstTrailingWhitespaceIndex 2014-08-13 16:31:39 -06:00
Nathan Sobo
193001d793 Assign invisibles via config in editor-view-spec 2014-08-13 16:31:39 -06:00
Nathan Sobo
052f9580f2 Render correct classes on leading/trailing whitespace spans 2014-08-13 16:31:39 -06:00
Nathan Sobo
2daf70f0e5 Handle invisibles at the token level to fix char width measurement
Fixes #3188
2014-08-13 16:31:39 -06:00
Kevin Sawicki
fca9ed07e6 Merge pull request #3169 from lee-dohm/ld-checkout-head
Add confirmation dialog to checkoutHead
2014-08-13 15:24:06 -07:00
Ben Ogle
e725a8ffeb Default to on in the specs 2014-08-13 14:51:05 -07:00
Ben Ogle
449da91216 Add toShow matcher 2014-08-13 13:42:46 -07:00
Ben Ogle
96804096e9 Fix specs 2014-08-12 15:44:58 -07:00
Ben Ogle
722d8cb48b Need to return a range when the text is inserted 2014-08-12 15:30:19 -07:00
Ben Ogle
b037395551 Add will-insert-text and did-insert-text to insertText() 2014-08-12 15:28:26 -07:00
Ben Ogle
7de2ad34aa Remove opaque backgrounds on mini editors
Fixes #3239
2014-08-12 14:53:09 -07:00
Kevin Sawicki
59d62d48db Remove views and destroy project during unload 2014-08-12 08:49:28 -07:00
Kevin Sawicki
16d2e41309 Use beforeunload instead of unload
unload is asynchronous in Chrome 36 and so saving the state while
reloading may not happen before the state is read on the new render
process.
2014-08-12 08:49:28 -07:00
Lee Dohm
d6a8217e94 Add config option for checkoutHead confirmation
Per the discussion with @kevinsawicki in #3168, I have added a config
option `editor.confirmCheckoutHead` that defaults to `true`. When the
`editor:checkout-head-revision` command is executed, a confirmation
dialog now shows that states which file is to be reverted and asks the
user to "Revert" or "Cancel". If the config option is set to `false`,
the old behavior, simply reverting without prompting, is used.

I also added tests to ensure that the confirmation dialog is displayed
or not in the right configurations.
2014-08-12 00:19:47 -07:00
Kevin Sawicki
f447781e01 Allow any bundled theme when in safe mode
Check enabled names against the bundled names and ensure
one bundled UI and one bundled syntax theme are enabled,
defaulting to the dark themes when necessary.
2014-08-11 15:24:49 -07:00
Maximilian Schüßler
c2304e1124 Fix indentation 2014-08-08 19:59:45 +02:00
Maximilian Schüßler
b463d9d876 Load the default themes in safe mode 2014-08-05 13:32:16 +02:00
Nathan Sobo
7e45ffa4c3 Center around the cursor in Editor::scrollToCursorPosition by default
Fixes #3131
2014-08-04 11:58:07 -06:00
Kevin Sawicki
f7187f1d5a Spy on atom.inDevMode() 2014-07-31 08:42:31 -07:00
Nathan Sobo
a9bd061144 Un-f 2014-07-29 16:52:21 -06:00
Nathan Sobo
837eaccd16 Remove extra nextAnimationFrame call 2014-07-28 21:53:18 -06:00
Nathan Sobo
bd77a02207 Measure DOM in EditorComponent when a stylesheet is updated 2014-07-28 21:00:15 -06:00
Nathan Sobo
eebbb99fc8 Handle editor font config options with a global stylesheet
Previously, each editor observed font-related config values on its own
and applied inline styles to honor them. This made it difficult to style
the editor like a normal element with CSS.

Moving this to a global stylesheet that targets editors via the .editor
selector means that the font size setting can be overridden in specific
contexts, such as when using mini editors.
2014-07-28 21:00:15 -06:00
Nathan Sobo
393552a4b6 Take cursors off the GPU and position them on the lines layer
The compositor overhead is not worth it.
2014-07-27 11:47:33 -06:00
Nathan Sobo
444c18be34 Stop polling when an update is pending 2014-07-27 11:46:22 -06:00
Nathan Sobo
dca096b8e3 Use requestAnimationFrame to batch updates in Chrome 35
In Chrome 31, setImmediate was yielding better behavior. But now Chrome
35 seems to behave more smoothly when we use requestAnimationFrame, and
the delay for keystrokes is non-existent.
2014-07-27 11:46:22 -06:00
Kevin Sawicki
d47348e8f9 Cache incompatible modules in local storage 2014-07-25 15:34:03 -07:00
Kevin Sawicki
56df7bdbe3 Add version to package 2014-07-25 15:23:36 -07:00
Kevin Sawicki
1ea909d4db Check installed packages for working native modules
Test require each native module in each installed package to make sure
it can be required successfully in Atom.
2014-07-25 15:19:16 -07:00
Nathan Sobo
7515fd94ba Merge branch 'master' into chrome35
Conflicts:
	package.json
2014-07-24 17:40:37 -07:00
Nathan Sobo
7738eeeacc Give the line-numbers div an opaque background for better GPU perf
We sample both the background color of the editor and the gutter. If the
gutter has an actual background color, we use it. Otherwise we fall back
to the same background as the editor.
2014-07-24 17:23:04 -07:00
Nathan Sobo
c6116468e4 Apply background color of root editor node to lines as an inline style
This ensures lines have an opaque background that matches whatever the
editor is styled as, but avoids the need to apply the .editor-colors
class to the .lines div. That approach fell down when people were
setting the background color via means other than .editor-colors, such
as styling mini editors via the .editor.mini selector in the settings
view.
2014-07-24 16:54:01 -07:00
Nathan Sobo
2a2d0b60f7 💄 2014-07-24 16:41:25 -07:00
Cheng Zhao
dcbf730129 Merge branch 'master' into chrome35
Conflicts:
	apm/package.json
	package.json
2014-07-24 17:17:35 +08:00
Ben Ogle
00275d95ec Merge pull request #3044 from atom/bo-h-scrollbar
Horizontal scrollbar no longer covers the gutter
2014-07-23 16:35:02 -07:00
Ben Ogle
242df788e6 Remove unnecessary scrollbar specs 2014-07-23 16:25:24 -07:00
Ben Ogle
3295b9b0dd Romove runSetImmediateCallbacks() in many cases
This is because of the removal of the gutter measurement. When there 
was measurement, every load of the editor would measure and request at 
least one render based on the reset of the gutter width. These 
specs don’t need to call runSetImmediateCallbacks() as they either 
don’t do anything to cause a render or they render immediately
(in the case of updated options).

In some cases, we need to make sure nothing happened, so I added a
hasSetImmediateCallbacks() function, which is used in specs where 
nothing should have happened.
2014-07-23 16:25:10 -07:00
Kevin Sawicki
adaee84933 Remove unused fixtures 2014-07-23 10:11:02 -07:00
Kevin Sawicki
84ff28ee69 Remove unused package fixtures 2014-07-23 10:11:01 -07:00
Kevin Sawicki
cfb1501720 Remove unused replication fixture 2014-07-23 10:11:01 -07:00
Ben Ogle
ffb041a160 Only render an nbsp on empty lines when no eol character defined
Fixes #3053
2014-07-23 09:30:52 -07:00
Ben Ogle
361f8ec770 Add specs for toggling the gutter when the editor is hidden 2014-07-22 18:26:58 -07:00
Ben Ogle
48a5123202 💄 Move logic into measureGutterIfNeeded 2014-07-22 18:26:58 -07:00
Ben Ogle
0f1d155685 Move gutterWidth into state; add specs for scrollbar position 2014-07-22 18:26:58 -07:00
Kevin Sawicki
5f7f5b5367 Merge branch 'master' into chrome35 2014-07-22 17:56:24 -07:00
Kevin Sawicki
bc4173f856 Remove logging of screen lines in spec 2014-07-22 14:51:13 -07:00
probablycorey
a3f046b948 Fix getVersion spec 2014-07-22 14:10:29 -07:00
Ben Ogle
17364cd528 Take the scrollbar width into account in specs 2014-07-22 11:54:26 -07:00
Nathan Sobo
5871bee791 Make spec assertions insensitive to scrollbars on Windows 2014-07-22 10:16:43 -07:00
Nathan Sobo
43c9e21f1d Make setEditorHeightInLines/WidthInChars spec helpers work with React
Fixes #3019
2014-07-21 15:04:44 -07:00
Nathan Sobo
ca1220a682 Delay initial measurement until the editor becomes visible
Previously, these measurements were always performed when the editor
component was mounted. This didn't work in situations where the
component was mounted in a non-visible state. This commit includes a
visibility check in the resize polling we were already doing, kicking
off the measurement process as soon as the editor is visible.
2014-07-21 13:40:10 -07:00
Nathan Sobo
0346e5809a Only prevent default on mousewheel events if editor actually scrolls
This prevents mini editors from capturing scroll events.
2014-07-21 10:43:31 -07:00
Nathan Sobo
99704517bb Remove animation frame batching of mousewheel events
This doesn't seem to adversely affect the scroll experience, and it's
much simpler. I want to avoid preventing the default action of
mousewheel events if they don't actually lead to scrolling, and making
the behavior synchronous will make that a lot easier.
2014-07-21 10:43:31 -07:00
Nathan Sobo
783ef730e2 Rename EditorComponent::measureScrollView to ::measureHeightAndWidth
Since we also check if we're auto-height in this method, this name seems
like a better description of the objectives of this method.
2014-07-21 10:43:31 -07:00
Nathan Sobo
e81db5d706 Pull out EditorComponent::pollDOM method
This makes the actions that we perform in the poll loop explicit, and
will prevent the accumulation of polling-related behavior in the
::measureScrollView method.
2014-07-21 10:43:31 -07:00
Nathan Sobo
d0893ccdaf Add placeholderText to React editors 2014-07-21 10:43:31 -07:00
Nathan Sobo
a9c7842a50 Don't render line decorations on mini editors 2014-07-21 10:43:31 -07:00
Nathan Sobo
544c759fd1 Don't set an explicit line height on mini editors
This allows the line height to be styled via CSS. I would actually
like to allow all these properties to be assigned via CSS rather than
explicitly via the settings view, but that can be deferred until the
old editor is removed.
2014-07-21 10:43:31 -07:00
Nathan Sobo
759dbc061d Don't render invisible characters in React mini editors 2014-07-21 10:43:31 -07:00
Nathan Sobo
56c9f75e8c Add the 'mini' class to the React wrapper view for mini editors 2014-07-21 10:43:30 -07:00
Nathan Sobo
635f288050 Explicitly assign height of editor-contents when height is auto 2014-07-21 10:43:30 -07:00
Nathan Sobo
cc8b7b13b3 Don't show the gutter when 'mini' is true on React editors 2014-07-21 10:43:30 -07:00
Nathan Sobo
e999ef00e7 Base editor dimensions on the wrapper view
The goal is to make the editor behave like a standard block-level
element.

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

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

This prepares us to support mini editors, which need to be 1-line tall
without an explicit height assignment.
2014-07-21 10:43:30 -07:00
Nathan Sobo
f16ea63a95 Export ReactEditorView as EditorView from 'atom' module
Also, remove a few early requires of 'exports/atom.coffee' in the spec
suite that were causing failures.
2014-07-21 10:43:30 -07:00
Nathan Sobo
cdb5fe15d2 Render nbsp on empty lines to ensure they have a non-zero height
Fixes #2958
2014-07-16 00:56:14 -07:00
Ivan Žužak
608c2b5354 Merge pull request #2977 from atom/iz-multiple-separators
Support multiple separators in context menu
2014-07-15 15:22:37 -07:00
Ben Ogle
cce49da18c Fix spec 2014-07-15 08:44:58 -07:00
Ben Ogle
29e883cf36 Add specs 2014-07-15 08:44:21 -07:00
Ivan Zuzak
cd1a17fb0a Support multiple separators in context menu 2014-07-14 17:10:13 -07:00
Lee Dohm
b100310764 Add failing test for #2274
Tested first on a branch off of `master` to ensure that it would
actually fail 😀
2014-07-13 13:27:32 -07:00
Ben Ogle
e620121953 Add spec for loading theme with incomplete variable file 2014-07-11 14:04:54 -07:00
Ben Ogle
9976166902 Render the line numbers after gutter mount
Fixes #2916
2014-07-10 17:25:58 -07:00
Nathan Sobo
7155ec4b73 Fix autoscroll specs for addSelectionForBufferRange 2014-07-09 08:06:14 -06:00
Nathan Sobo
e170b9f56b Render line-ending invisibles on empty lines
Fixes #2857

Including correct interleaving with indent guides.
2014-07-08 16:53:06 -06:00