Commit Graph

96 Commits

Author SHA1 Message Date
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
Nathan Sobo
182531a010 Use presenter for gutter scrollHeight and scrollTop
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:23 -07:00
Nathan Sobo
3b93f3d71b Blink cursors based on presenter state
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -07:00
Nathan Sobo
add3972477 Use presenter’s scrollTop/scrollLeft in LinesComponent 2015-02-03 15:05:19 -07:00
Nathan Sobo
32a1854b7c Use TextEditorPresenter::state.content.indentGuidesVisible 2015-02-03 15:05:16 -07:00
Nathan Sobo
3ec4b632ba Update TextEditorPresenter with scoped character widths in component
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:15 -07:00
Nathan Sobo
20bb14da81 Start using TextEditorPresenter in LinesComponent
Removed shouldComponentUpdate because we will always update the
component manually once this is done, but I don’t want to accidentally
prevent the component from updating during the conversion process.

This commit has a failing spec due to the presenter not accounting for
individual character widths.
2015-02-03 15:05:14 -07:00
Nathan Sobo
2120c3c298 Instantiate presenter in TextEditorComponent and update measurements 2015-02-03 15:05:12 -07:00
Nathan Sobo
86d730a3a9 Always forceUpdate when editor component is visible
Fixes #5187. Giving up after 90 minutes on producing a failing test case
because this is all changing soon anyway and getting simpler. I’m
willing to risk this regressing to solve it now and move on.
2015-01-22 17:28:02 -07:00
Nathan Sobo
8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -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
Nathan Sobo
f00b0b7f7a Add TextEditor::set/isGutterVisible
Controls gutter visibility on individual editors.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07: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
30513cfde0 Rename ThemeManager methods for clarity/consistency
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:09 -08:00
Max Brunsfeld
90aca1c6ad 💄 fix lint errors
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-12-29 11:07:43 -08:00
Max Brunsfeld
a1b4820c04 Revert "Revert "Merge pull request #4631""
This reverts commit dc2a453986.

Conflicts:
	spec/config-spec.coffee
	src/config.coffee
2014-12-23 09:26:40 -08:00
Kevin Sawicki
f5ae96820a Update spec for new middle mouse paste behavior 2014-12-18 11:04:52 -08:00
Kevin Sawicki
435fee1433 Use skinny arrow 2014-12-18 10:40:44 -08:00
Kevin Sawicki
c96f976162 Write to selection clipboard from setTimeout
This is so that in progress transactions aren't written to the
selection clipboard.
2014-12-18 10:40:04 -08:00
Kevin Sawicki
5115540f8e Track middle button mouse down events on Linux 2014-12-18 09:51:32 -08:00
Kevin Sawicki
d642553351 Paste selection clipboard after finalizing selections 2014-12-18 09:26:14 -08:00
Max Brunsfeld
dc2a453986 Revert "Merge pull request #4631 from atom/mb-new-config-api"
This reverts commit 5147fb6a8b, reversing
changes made to 9bbbb58084.
2014-12-16 15:27:39 -08:00
Max Brunsfeld
5147fb6a8b Merge pull request #4631 from atom/mb-new-config-api
New config API
2014-12-16 15:22:15 -08:00
Ben Ogle
09a0773043 Handle editor destruction when dragging.
Closes #4622
2014-12-16 14:52:07 -08:00
Max Brunsfeld
4e4794f3fd Take 'scope' option in Config::observe
Deprecate using the scope as an optional first argument
2014-12-16 14:00:57 -08:00
Nathan Sobo
87efc7e1df Only respond to stylesheet changes for mounted components
Refs #4493
2014-12-11 14:55:00 -07:00
Nathan Sobo
b386b00bc0 Wait for next animation frame before measuring when stylesheets change
Fixes #4479
2014-12-09 14:56:33 -07:00