Commit Graph

122 Commits

Author SHA1 Message Date
Antonio Scandurra
bf16287b16 🎨 Avoid entering/exiting from the outside 2015-02-27 16:59:59 +01:00
Antonio Scandurra
2f00d3e361 Batch on @requestUpdate 2015-02-27 15:10:17 +01:00
Antonio Scandurra
af65849880 Move batching management down into presentation layer 2015-02-27 12:17:34 +01:00
Nathan Sobo
1d84d74e50 Centralize text editor DOM interaction through atom.views
This ensures that DOM writing, reading, and polling properly interleaves
with DOM interactions from other text editors and any other code that
coordinates via atom.views. Not sure about the location of it though.
2015-02-19 17:14:58 -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
c9a6c32752 Replace cursor blink React props with normal properties 2015-02-19 17:14:57 -07:00
Nathan Sobo
1e8b0acbd0 Remove redundant update requests in editor view 2015-02-19 17:14:57 -07:00
Nathan Sobo
0d109d69f0 Use CompositeDisposable instead of SubscriberMixin in editor view 2015-02-19 17:14:57 -07:00
Nathan Sobo
dae15eafc9 Remove unused prototype properties 2015-02-19 17:14:57 -07:00
Nathan Sobo
ccdc4eb24b Update TextEditorComponent DOM node manually 2015-02-19 17:14:56 -07:00
Nathan Sobo
d89ec25b28 Remove showIndentGuide subscription from view 2015-02-19 17:14:56 -07:00
Nathan Sobo
1845234775 Remove unnecessary ::mini subscription on model in TextEditorComponent 2015-02-19 17:14:56 -07:00
Nathan Sobo
2fba4979f9 Use presenter to determine gutter visibility 2015-02-19 17:14:56 -07:00
Nathan Sobo
fd603a0cbc Move new character measurement to end of full update to avoid reflow 2015-02-19 17:14:55 -07:00
Nathan Sobo
bf29a020e1 Use presenter for focused state in EditorComponent 2015-02-19 17:14:55 -07:00
Nathan Sobo
5c7e0c387a Use plain JS object for ScrollbarCornerComponent instead of React
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-19 17:14:55 -07:00
Nathan Sobo
6b3d29a5e4 Manually update DOM in ScrollbarCornerComponent
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-19 17:14:55 -07:00
Nathan Sobo
da6bd3664d Use plain JS object for ScrollbarComponent instead of React 2015-02-19 17:14:54 -07:00
Nathan Sobo
8784d48236 Use plain JS object for InputComponent instead of React 2015-02-19 17:14:54 -07:00
Nathan Sobo
ea49fc6d5f Construct LinesComponent with visibility param to avoid redundant update 2015-02-19 17:14:54 -07:00
Nathan Sobo
52a9a76b2a Use presenter state in InputComponent 2015-02-19 17:14:54 -07:00
Nathan Sobo
168df987d7 Make GutterComponent a plain JS object instead of a React component 2015-02-19 17:14:53 -07:00
Nathan Sobo
c06e100fae Make LinesComponent a normal object instead of a React component
Also, remove ability to disable hardware acceleration since there’s
no longer a need for it and it complicated this conversion.
2015-02-19 17:14:53 -07:00
Nathan Sobo
009d945e1e Destroy TextEditorPresenter when unmounting TextEditorComponent
Fixes atom/find-and-replace#348
2015-02-11 09:02:33 -07:00
Nathan Sobo
746950a347 Default overdrawMargin to 15 even when passed as null from outside 2015-02-10 12:39:34 -07:00
Nathan Sobo
bdfca8b902 Coalesce handling style sheet changes in editor with nextAnimationFrame
Previously, we were delaying handling, but still requesting redundant
handling by requesting multiple frames. Now we don’t request a new
update if there is already one outstanding.
2015-02-09 14:36:30 -07:00
Nathan Sobo
d14d4aaae1 Remove subscriptions in editor view that are handled in presenter 2015-02-04 15:12:21 -07:00
Nathan Sobo
77599c799c Rename TextEditorPresenter::height to ::explicitHeight
This clarifies that the height is being assigned externally rather than
derived from the content.
2015-02-04 15:10:58 -07:00
Nathan Sobo
b94576dc09 Pass view measurements to model via presenter
Someday, we won’t need to pass measurements to the model anymore.
2015-02-04 14:48:17 -07:00
Nathan Sobo
59d96c9f1a Measure scrollbars immediately when editor becomes visible
This ensures all required measurements are present so assignment of
subsequent measurements such as backgroundColor have an effect.
2015-02-04 11:48:47 -07:00
Nathan Sobo
78b8039384 Don’t require sync update before measuring when autoHeight changes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:45 -07:00
Nathan Sobo
b521e8dc97 Handle auto-height in TextEditorPresenter 2015-02-03 15:05:32 -07:00
Nathan Sobo
bbc1a264b5 Make each section of presenter state self-contained
This means we have some duplicated values in different parts of the
tree, but it’s cleaner in the view since each component only consumes
a single object. Seems like the presenter should convey the correct
data to the correct locations and minimize the logic in the view. A
few duplicated integers is a reasonable trade-off.
2015-02-03 15:05:31 -07:00
Nathan Sobo
da4b3a47ef Don’t observe decorations in text editor view 2015-02-03 15:05:31 -07:00
Nathan Sobo
0e27bebbb3 Fix indentation 2015-02-03 15:05:31 -07:00
Nathan Sobo
efdba9fc24 Use presenter state for scrollbars and scrollbar corner 2015-02-03 15:05:31 -07:00
Nathan Sobo
42ab02d7d2 Rename ::clientHeight/Width to ::height and ::contentFrameWidth
The term “client” was actually a misnomer here because it typically
means the height excluding the scrollbars, which wasn’t how we were
using it here.
2015-02-03 15:05:30 -07:00
Nathan Sobo
9de8ab949f Drop TextEditorComponent::getRenderedRowRange 2015-02-03 15:05:30 -07:00
Nathan Sobo
d8cafb1fc6 Don’t observe screen line changes in editor component 2015-02-03 15:05:29 -07:00
Nathan Sobo
76241fb779 Handle line and line number preservation in presenter
The target of mousewheel events needs to be preserved when scrolling.
It used to be dealt with in the view, but now we can do it in the
presenter for a simpler view implementation.
2015-02-03 15:05:29 -07:00
Nathan Sobo
a88486e950 Use maxLineNumberDigits from presenter state in GutterComponent 2015-02-03 15:05:28 -07:00
Nathan Sobo
1a22952eda Only store backgroundColor and gutterBackgroundColor on presenter 2015-02-03 15:05:28 -07:00
Nathan Sobo
fd50a0db6c Construct TextEditorPresenter before component mounts
This allows us to use the presenter for all stages of the component
lifecycle rather than needing to wait until it is created.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:28 -07:00
Max Brunsfeld
60fca8d8b2 Use presenter state for gutter background color
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:27 -07:00
Max Brunsfeld
fd4f28911d Use presenter state for placeholder text
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:27 -07:00
Nathan Sobo
1a61133def Remove unused local var
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:26 -07:00
Nathan Sobo
b21b9c3402 Use presenter’s scrollingVertically property to defer line measurement 2015-02-03 15:05:26 -07:00
Nathan Sobo
837b9eefbb Use backgroundColor from presenter in LinesComponent 2015-02-03 15:05:26 -07:00
Nathan Sobo
96ba4cc6bd Remove unused React props and methods that build them 2015-02-03 15:05:25 -07:00
Nathan Sobo
a5580a704d Remove unused properties in EditorComponent and children 2015-02-03 15:05:25 -07:00