Commit Graph

30 Commits

Author SHA1 Message Date
Fabian Stiewitz
eca4ed170e Add specs for TextEditor::setMini in TextEditorElement 2015-07-01 12:36:10 +02:00
Machiste Quintana
d5bcc0433d WIP: 👕 Fix linter errors 2015-05-22 16:29:12 -04:00
Jess Lin
5e766b6eee [Gutter] Clear custom gutter decorations from previous usages of a custom gutter element 2015-04-29 08:53:04 -07:00
Nathan Sobo
192997c8cf Clear line numbers from previous usages of the gutter element
In adding custom gutter APIs, I suggested to @jssln that we associate
the gutter model objects with DOM nodes in the view registry to make
it easy for package authors to get at the view layer for a particular
gutter. She also applied this treatment to the line numbers gutter,
which makes sense.

However, using the view registry opened up an unexpected wrinkle…

When you detach an editor, we need to tear down all the associated view
logic because at that point, we don’t know whether the element is about
to be reattached or whether it’s going to get garbage collected. In the
case where we reattach, we end up constructing a new TextEditorComponent
for the element. When this happens, the gutter component requests a DOM
node for the gutter from the view registry. Except in this case the
DOM element isn’t empty because it was already used by a different
component for the same element before it was detached. The fix is simply
to always clear out the line numbers to ensure we start in a clean
state.

@jssln: You should apply this same fix to custom gutters or we’ll see
the same issues.
2015-04-28 20:05:25 -06:00
Jess Lin
fccc9ebee4 [Gutter] Rename current references to 'Gutter' -> 'LineNumberGutter' 2015-04-22 07:28:56 -07: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
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
c0b78db159 💄
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
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
30513cfde0 Rename ThemeManager methods for clarity/consistency
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:09 -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
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
4afe133f85 Allow setting editor text content in HTML 2014-12-05 09:30:33 -08:00
Nathan Sobo
625b95a6d9 Test TextEditorElement::setUpdatedSynchronously without waiting
Another attempt to fix flakiness.
2014-12-02 11:37:28 -07:00
Nathan Sobo
38e6aee46d Un-f 2014-12-02 11:14:59 -07:00
Nathan Sobo
93bf9357b0 Remove waitsForAnimationFrame spec helper
It doesn’t work reliably on CI.
2014-12-02 11:14:02 -07:00
Kevin Sawicki
7e16e42b3f x out flaky spec 2014-12-02 08:39:52 -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
b6b6b6d12b Add ‘mini’ attribute to TextEditorElement if .isMini() is true on model 2014-11-13 16:04:57 -08:00
Max Brunsfeld
3c800b00f5 Always re-render scrollbars after themes load/reload
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-11-10 17:59:41 -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
Nathan Sobo
670a710753 Test editor focus/blur handling with shadow DOM enabled/disabled
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:28 -07:00
Nathan Sobo
58744f6b7b Account for shadow DOM when asserting on focus 2014-11-04 16:37:24 -07:00
Nathan Sobo
1eb3d8bf99 Use ‘atom-text-editor’ custom tag name for TextEditorElement 2014-10-09 07:39:14 -07:00
Nathan Sobo
eaa3a27328 Add text-editor-element-spec and fix handling of focus and attributes 2014-10-08 12:13:13 -07:00