70 Commits

Author SHA1 Message Date
CaptSaltyJack
a8283c3c9b Added delete-to-next/previous-word-boundary
This is better behavior for alt-del/backspace operations, is less
"greedy" and doesn't eat up excess characters.
Also set default key mappings to these, feel free to trash my changes
to keymaps/darwin.cson. Though I do feel this should be default
behavior, personally.
2015-04-29 16:31:07 -07:00
Jess Lin
79b460a0ca [Gutter] Add ::getDomNode method to all 'components' 2015-04-22 07:28:59 -07:00
Jess Lin
fccc9ebee4 [Gutter] Rename current references to 'Gutter' -> 'LineNumberGutter' 2015-04-22 07:28:56 -07:00
Michael Bolin
bf9999d07a core:select-up/down should work in mini editor as well as main editor.
Fixes #6445.
2015-04-21 12:50:20 -07:00
Kevin Sawicki
7d592c8b78 includeDeprecations -> includeDeprecatedAPIs 2015-04-03 11:29:16 -07:00
Kevin Sawicki
63072bf8ae Check deprecations flag for space pen shim inclusion 2015-04-03 11:29:14 -07:00
Max Brunsfeld
88c2cef91f Make :checkout-head-revision command work w/ multiple repos 2015-02-24 15:30:04 -08:00
Nathan Sobo
7033b27207 Make EditorComponent a plain JS object rather than a React component 2015-02-19 17:14:57 -07:00
Nathan Sobo
884556c200 Revert "Don’t override lineOverdrawMargin with null"
This reverts commit 04cb43d657.
2015-02-10 12:39:34 -07:00
Nathan Sobo
04cb43d657 Don’t override lineOverdrawMargin with null 2015-02-10 10:15:44 -07:00
Nathan Sobo
5a4cf01083 Move getFirst/LastVisibleScreenRow to the view 2015-01-14 20:02:49 -07:00
Nathan Sobo
dd80226c23 Revert "Handle addition/removal of ‘gutter-hidden’ attribute"
This reverts commit 6926236268.

There seems to be some bug or timing issue that prevents the
attachedCallback from being called in all cases when the
attributeChangedCallback is defined. We can figure this out at
a later time.
2015-01-12 17:39:07 -07:00
Nathan Sobo
6926236268 Handle addition/removal of ‘gutter-hidden’ attribute
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo
43f57347d7 Add ‘gutter-hidden’ attribute to TextEditorElement
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo
002918049d 🐎 Cache gutterVisible state in React component
This avoids a config read on every render.
2015-01-12 16:21:31 -07:00
Max Brunsfeld
f9bde050b4 Handle TextEditorElement::focus() while parent is being attached
Fixes atom/autocomplete#61
2015-01-09 15:00:35 -08:00
Nathan Sobo
7f9d06f55b Move TextEditor::pixelPositionForScreen/BufferPosition to view layer
It doesn’t make sense to talk about pixels at the model layer long-term,
even though we currently store view dimension information in the model
so we don’t have to read from the DOM for optimization purposes. This
information is only available if the view is attached, however, making
these methods a liability on the model layer.
2015-01-09 08:22:45 -08:00
Nathan Sobo
180725799a Unmount TextEditorComponent when TextEditorElement is detached
Fixes #4381
Fixes #4700
2015-01-06 11:35:26 -07:00
Ben Ogle
0829da53b0 Properly unmount the component when the shadow DOM is enabled. 2014-12-16 14:36:51 -08:00
Max Brunsfeld
5c37d208f5 Don't throw when ::getDefaultCharacterWidth is called while detached 2014-12-08 16:56:46 -08:00
Max Brunsfeld
d03cfda6c4 📝 new TextEditorElement methods 2014-12-08 16:38:57 -08:00
Max Brunsfeld
8f02b21d08 Add TextEditorElement::onDidAttach, ::onDidDetach 2014-12-08 16:21:59 -08:00
Max Brunsfeld
953f2c61f7 Add TextEditorElement::getDefaultCharacterWidth 2014-12-08 16:14:26 -08:00
Max Brunsfeld
631bca6c89 Don't use a transaction in cursor/selection movement commands
Previously, a transaction was used to set an undo grouping interval
for every editor command except `undo` and `redo`. The problem is
that currently, moving a marker inside of a transaction causes the
buffer's redo stack to be cleared. For now, just don't use
transactions for commands that don't modify the buffer's contents."
2014-12-08 13:06:59 -08:00
Max Brunsfeld
4afe133f85 Allow setting editor text content in HTML 2014-12-05 09:30:33 -08:00
Max Brunsfeld
e4bcb96dcc Change ::setModel to ::initialize on all element classes 2014-12-01 17:52:19 -08:00
Kevin Sawicki
be2d49a410 Remove unused subscriptions ivar
Closes #4343
2014-12-01 08:37:51 -08:00
Nathan Sobo
b341749d54 Add TextEditorElement::setUpdatedSynchronously
To allow testing of async editor rendering in packages. This is helpful
for overlay decorations which behave differently when rendering is
async.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-26 18:13:12 -07:00
Nathan Sobo
e62ecbab6b Work around chromium bug where focus gets stolen from shadow DOM
Fixes #4255
2014-11-21 11:04:42 -07:00
Nathan Sobo
95ec0d8162 Replaces usages of .mini selector with [mini] 2014-11-13 16:04:57 -08:00
Nathan Sobo
b6b6b6d12b Add ‘mini’ attribute to TextEditorElement if .isMini() is true on model 2014-11-13 16:04:57 -08:00
Nathan Sobo
ed6ca9cd06 Remove .editor class to force themes to style background via :host
The goal is to allow the editor’s styling to be overridden as follows:

atom-text-editor {
  background: black;
  color: white;
}

If we retain these classes, themes will continue to style the root
element of the editor and destroy the ability to style the editor in
this way. You would instead have to do the following:

atom-text-editor::shadow .editor {
  background: black;
  color: white;
}

This is way less intuitive and confusing for people.
2014-11-13 16:04:57 -08:00
Nathan Sobo
08971562cd Store useShadowDOM setting when TextEditorElement is created
Rather than reading it repeatedly, since the value could potentially
change over time.
2014-11-13 16:04:56 -08:00
Nathan Sobo
99b08826dd Style non-shadow DOM editor with it’s own style sheet
Trying to style both modes of the text editor with the same style sheet
is proving to be more trouble than it’s worth. This prepares the shadow
DOM style sheet to diverge more radically to enable the background color
to be overridden from the outside more easily.
2014-11-13 16:04:24 -08:00
Max Brunsfeld
003c101f14 W/o shadow-dom, don't add global atom-styles element for text editor
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-11-07 13:05:46 -08:00
Max Brunsfeld
d97c81bf6a Make undo grouping interval configurable 2014-11-06 09:25:10 -08:00
Max Brunsfeld
d85c07e7e2 Don't wrap undo/redo calls in transactions 2014-11-05 16:59:06 -08:00
Max Brunsfeld
4077e791c9 Update signature of calls to TextBuffer::transact 2014-11-05 15:58:13 -08:00
Max Brunsfeld
e7eef89fa5 Remove TextEditor::withGroupingInterval
Just use ::transact
2014-11-05 15:58:13 -08:00
Max Brunsfeld
5437236304 Use undo grouping in editor command listeners 2014-11-05 15:58:13 -08:00
Nathan Sobo
670b44f250 Only set both height and width of editor when shadow DOM is used
These work inside a shadow root, but break the flexbox behavior when
the shadow DOM is disabled.
2014-11-05 11:21:29 -07:00
Nathan Sobo
39cc463e24 Add .editor and .editor-colors classes regardless of shadow DOM setting 2014-11-05 09:57:13 -07:00
Nathan Sobo
badf1725fa Handle focus on hidden input when shadow DOM is disabled
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:29 -07:00
Nathan Sobo
100af7d27d Fix corner cases related to lifecycle state of EditorComponent on events
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:28 -07:00
Nathan Sobo
9b70cf2044 Make blur event on text editor element work with shadow DOM disabled
When the shadow DOM is enabled, this happens organically because the
focus is abstracted across the shadow boundary. Without that abstraction
boundary, we need to pretend that a blur of the hidden input is actually
a blur of the entire editor.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:28 -07:00
Nathan Sobo
7fe9c14772 💄 2014-11-04 16:37:28 -07:00
Nathan Sobo
9690e44ffe Correctly handle focus when shadow DOM is disabled
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:27 -07:00
Nathan Sobo
0e57ede712 Only create a shadow root if editor.useShadowDOM config setting is true
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:27 -07:00
Nathan Sobo
dd7335c30b Simplify focus/blur handling
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:27 -07:00
Nathan Sobo
160bb29034 Null-guard component in blur handler 2014-11-04 16:37:27 -07:00