Jess Lin
79b460a0ca
[Gutter] Add ::getDomNode method to all 'components'
2015-04-22 07:28:59 -07:00
Ben Ogle
db35022d0e
Remove OverlayManager from the LinesComponent
2015-04-01 17:40:59 -07:00
Kevin Sawicki
590a4b0fd5
Add explicit return after for loop
2015-03-19 11:48:40 -07:00
Antonio Scandurra
0dca5a5fcd
Encapsulate state update inside TextEditorPresenter#getState
2015-02-28 09:25:53 +01:00
Nathan Sobo
622caee446
Correctly store which lines we have already measured
2015-02-24 11:36:01 -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
8552acaec2
🐎 Optimize line node updates
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
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
da793e834a
Perform all LinesComponent DOM updates manually
2015-02-19 17:14:53 -07:00
Nathan Sobo
b0a29bdc2f
Make HighlightsComponent a plain object instead of using React
2015-02-19 17:14:53 -07:00
Nathan Sobo
b4ecb65fb9
Make CursorsComponent a plain object instead of using React
2015-02-19 17:14:53 -07:00
Nathan Sobo
6a36bdda25
Replace ::hasRequiredMeasurements() with specific criteria in presenter
...
Now each update method requires a list of specific variables to be
defined before running.
2015-02-12 19:48:06 -07:00
Nathan Sobo
48195851d4
Assign line and character measurements on model via presenter
2015-02-09 15:32:14 -07:00
Nathan Sobo
4f0e1997cf
💄 CharWidth -> CharacterWidth in presenter
2015-02-09 15:28:17 -07:00
Nathan Sobo
df01c8ab6f
Batch scoped character measurement in presenter
2015-02-09 14:33:18 -07:00
Nathan Sobo
6977660699
Store ‘isOnlyWhitespace’ in line presenter state
2015-02-04 07:59:34 -07:00
Nathan Sobo
ba6d11e24e
Merge branch 'master' into ns-editor-presenters
2015-02-04 07:57:04 -07:00
Nathan Sobo
75652e36d9
Remove ? guard from ::oldState and ::newState references
2015-02-03 15:05:44 -07:00
Nathan Sobo
9991cd73c7
Reference scrollingVertically in the proper location in presenter state
2015-02-03 15:05:44 -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
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
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
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
f5fa3b837e
Set content.indentGuidesVisible in presenter if editor is mini
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
d26e8a2df1
Move vertical scroll state to root of presenter state object
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2015-02-03 15:05:23 -07:00
Nathan Sobo
49bf3bb14e
Use presenter to render flashes
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2015-02-03 15:05:22 -07:00
Nathan Sobo
8ebd057b0c
Use presenter to render highlights
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2015-02-03 15:05:22 -07:00
Nathan Sobo
4b0536ab6a
Remove unused props
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2015-02-03 15:05:21 -07:00
Nathan Sobo
06b5eba17c
Fix 0-width cursors in presenter instead of view
2015-02-03 15:05:20 -07:00
Nathan Sobo
4ed07bb66d
Use presenter state in CursorsComponent
2015-02-03 15:05:20 -07:00
Nathan Sobo
b7b0ec067c
🎨
2015-02-03 15:05:19 -07:00
Nathan Sobo
add3972477
Use presenter’s scrollTop/scrollLeft in LinesComponent
2015-02-03 15:05:19 -07:00
Nathan Sobo
78d87d8f7c
Use presenter to supply scrollHeight to lines component
2015-02-03 15:05:19 -07:00
Nathan Sobo
e9d6e36b6a
Remove unused code
2015-02-03 15:05:18 -07:00
Nathan Sobo
773482467e
Handle updates to line decorations in TextEditorPresenter
...
This isn’t a super efficient approach, but it is simple and should be
correct. Once we move all state to the presenter we can perform a more
efficient synchronous update when markers change.
2015-02-03 15:05:17 -07:00
Nathan Sobo
bf9428aa19
Read scrollWidth from the presenter state when rendering
2015-02-03 15:05:16 -07:00
Nathan Sobo
64ef8add71
Remove unused argument
2015-02-03 15:05:16 -07:00
Nathan Sobo
32a1854b7c
Use TextEditorPresenter::state.content.indentGuidesVisible
2015-02-03 15:05:16 -07:00
Nathan Sobo
22942ae1bd
Remove unused local vars
2015-02-03 15:05:15 -07:00
Nathan Sobo
0a9f7586ae
Add top-level .content object to presenter state
...
It contains the .scrollWidth and then all the lines in a nested .lines
object. The .width has been removed from each line and replaced with
.content.scrollWidth.
2015-02-03 15:05:15 -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
Jason Woods
2e72790e72
🐛 Fix ident guides missing on whitespace only lines with invis chars
2015-02-01 18:13:39 +00: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