Nathan Sobo
d4517b1ab0
Add TextEditorPresenter::state.scrollingVertically
...
This is used by the view to defer measuring new lines until we stop
scrolling.
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
71a27de7ac
Add TextEditorPresenter::state.content.backgroundColor
2015-02-03 15:05:25 -07:00
Nathan Sobo
96ba4cc6bd
Remove unused React props and methods that build them
2015-02-03 15:05:25 -07:00
Nathan Sobo
9d7285d04a
Use presenter for rendering overlay decorations
...
We’re still doing some sync DOM reads and computation in the view that
should eventually be made async and moved into the presenter, but I’m
going to leave it alone for now.
2015-02-03 15:05:25 -07:00
Nathan Sobo
e4c95d8ac3
Add overlay decorations to TextEditorPresenter::state
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
c4b5a0f411
Honor the ‘onlyHead’ option for line and line-number decorations
2015-02-03 15:05:24 -07:00
Nathan Sobo
af8c38ad80
🎨
2015-02-03 15:05:24 -07:00
Nathan Sobo
0802b9bdd1
Don’t decorate soft-wrapped lines/line numbers unless spanned by marker
2015-02-03 15:05:24 -07:00
Nathan Sobo
b1fe567ce8
Build line numbers based on presenter state
2015-02-03 15:05:24 -07:00
Nathan Sobo
20838accc1
Key line numbers by buffer row and soft-wrap count
...
…instead of an array. This will make things simpler to diff in the
view.
2015-02-03 15:05:24 -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
Max Brunsfeld
f218e985cf
Update presenter scrollHeight when clientHeight changes
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:23 -07:00
Max Brunsfeld
33081cefda
Move .lineNumbers onto .gutter property of presenter state
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:23 -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
1ff0b20cea
Add ‘foldable’ to line number presenter state
2015-02-03 15:05:23 -07:00
Nathan Sobo
66c35d6e3e
Reflect changes to line number decorations in presenter state
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
5d2efc0469
Deprecate TextEditor::getGutterDecorations
...
Forgot to rename it when we renamed decorations of type ‘gutter’ to
‘line-number’. It’s not used in core or any packages at the time of
this commit.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
970936f96d
Start on TextEditorPresenter::state.lineNumbers
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -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
2f526c59c5
Add highlights state to TextEditorPresenter
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -07:00
Nathan Sobo
764139c25e
Fix spec organization
...
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -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
500f992d32
Remove shouldComponentUpdate hook
...
Will be replaced by manual update logic anyway.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -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
b412c2642d
Add TextEditorPresenter::onDidUpdateState
...
And ensure observers are invoked whenever the state changes in spec.
2015-02-03 15:05:20 -07:00
Nathan Sobo
3c6c385ec8
Add TextEditorPresenter::state.content.blinkCursorsOff
2015-02-03 15:05:20 -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
c8b58761ba
Add TextEditorPresenter::state.content.cursors
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
f479e9d029
Add ::state.content.scrollTop/Left to TextEditorPresenter
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
2c5888e25a
Add ::state.content.scrollHeight to TextEditorPresenter
2015-02-03 15:05:19 -07:00
Nathan Sobo
de0b5c4c62
Reorganize specs on TextEditorPresenter to mirror structure of state
2015-02-03 15:05:18 -07:00
Nathan Sobo
59b109654e
Fix spec
2015-02-03 15:05:18 -07:00
Nathan Sobo
e9d6e36b6a
Remove unused code
2015-02-03 15:05:18 -07:00
Nathan Sobo
fe5ee524a8
Show/hide line decorations when TextEditor::mini changes
2015-02-03 15:05:18 -07:00
Nathan Sobo
9a496e62cb
Don’t apply line decorations to mini editors
2015-02-03 15:05:18 -07:00
Nathan Sobo
a513cf260c
Don’t apply line decorations to last line if it ends at column 0
2015-02-03 15:05:17 -07:00
Nathan Sobo
62a1210604
Honor the ‘onlyEmpty’ and ‘onlyNonEmpty’ line decoration options
2015-02-03 15:05:17 -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
5d8f831136
Instantiate presenter with minimal parameters in specs
2015-02-03 15:05:17 -07:00
Nathan Sobo
9c1efb6ba0
Simplify assertions
2015-02-03 15:05:17 -07:00
Nathan Sobo
568b9f6999
Add lineStateForScreenRow helper
...
The access pattern is pretty noisy in the specs
2015-02-03 15:05:16 -07:00
Nathan Sobo
06ef0792ce
Add .decorationClasses to line state on initial render
2015-02-03 15:05:16 -07:00
Nathan Sobo
bf9428aa19
Read scrollWidth from the presenter state when rendering
2015-02-03 15:05:16 -07:00