Nathan Sobo
b99ddfd3bf
Remove unused var
2017-05-05 09:29:28 +02:00
Nathan Sobo
060a884ba9
Include more properties in LinesTileComponent.shouldUpdate
2017-05-05 09:29:28 +02:00
Nathan Sobo
99e3c62e69
Clear highlight nodes when recycling line tiles
2017-05-05 09:29:28 +02:00
Nathan Sobo
3fce3ebe17
Fix test
2017-05-05 09:29:28 +02:00
Nathan Sobo
6e6dce21ee
Don't re-measure if editor has become invisible
2017-05-05 09:29:28 +02:00
Nathan Sobo
7aec696bb5
Remove stray logging
2017-05-05 09:29:28 +02:00
Nathan Sobo
2c6490c2e0
Don't update editor component if we know we are not visible
2017-05-05 09:29:28 +02:00
Nathan Sobo
95c8950004
Re-measure and update rendered content when editor styles change
2017-05-05 09:29:28 +02:00
Nathan Sobo
b6cd473c16
Fix typo
2017-05-05 09:29:28 +02:00
Antonio Scandurra
054c133ed4
Remeasure block decorations when editor width changes
...
Signed-off-by: Nathan Sobo <nathan@github.com >
2017-05-05 09:29:28 +02:00
Antonio Scandurra
8103bd687c
Update line number gutter when invalidating a visible block decoration
...
When two or more decorations in the same tile were invalidated but the
sum of their height didn't change, we were previously failing to
recognize that the line numbers gutter needed to be re-rendered. With
this commit, whenever a block decoration is visible and gets
invalidated, we will force the line number gutter to always update.
2017-05-05 09:29:28 +02:00
Nathan Sobo
8aae3ab1ae
Hide cursors with non-empty selection if showCursorsOnSelection is false
...
Also, remove some barely used public APIs around cursor visibility that
don't make much sense and are not ideal for performance. We don't want
to subscribe to the visibility of each cursor.
2017-05-05 09:29:28 +02:00
Antonio Scandurra
bc8b548d1a
Add TextEditorElement.prototype.invalidateBlockDecorationDimensions
2017-05-05 09:29:28 +02:00
Antonio Scandurra
b264d4764a
Align line number nodes with line nodes
2017-05-05 09:29:28 +02:00
Antonio Scandurra
7474b4b678
Integrate block decorations in the custom lines rendering routine
2017-05-05 09:29:28 +02:00
Antonio Scandurra
919c5a022b
Don't use etch for lines rendering
2017-05-05 09:29:28 +02:00
Antonio Scandurra
316df28bbd
Splice LineTopIndex when a textual change occurs
2017-05-05 09:29:28 +02:00
Antonio Scandurra
4cd9a36594
Handle inserting and updating block decorations
2017-05-05 09:29:28 +02:00
Antonio Scandurra
015f196f2f
Test scrolling down with block decorations
2017-05-05 09:29:28 +02:00
Antonio Scandurra
e289283205
Render block decorations between lines
2017-05-05 09:29:28 +02:00
Antonio Scandurra
7a0a41a7df
Use Array.push instead of array[i] = when adding line components
...
Albeit (potentially) slower, this will allow to add a dynamic number of
block decoration nodes before and after a given line.
2017-05-05 09:29:28 +02:00
Antonio Scandurra
f7632a9095
Add fast path when no block decorations need to be measured
2017-05-05 09:29:28 +02:00
Nathan Sobo
5a6935a01c
Use LineTopIndex to convert from/to rows to/from pixel positions
2017-05-05 09:29:28 +02:00
Nathan Sobo
b32b760ee4
WIP: Start on block decorations
2017-05-05 09:29:28 +02:00
Nathan Sobo
171e4e88ca
Cache prefixed scope names
2017-05-05 09:29:28 +02:00
Nathan Sobo
eb588d4c7c
Test and fix the center option to autoscroll
2017-05-05 09:29:28 +02:00
Nathan Sobo
8652222b22
Add setInputEnabled and don't handle textInput if it is disabled
2017-05-05 09:29:28 +02:00
Nathan Sobo
acf996fc14
Speed up cursor blink test
2017-05-05 09:29:28 +02:00
Nathan Sobo
7da588c3ee
Ensure nextUpdateOnlyBlinksCursor argument is true, not just truthy
...
We pass the bound scheduleUpdate method as an event handler to a variety
of subscription methods, some of which supply arguments.
2017-05-05 09:29:28 +02:00
Nathan Sobo
3b7112889a
Correctly assign gutter container vnode
2017-05-05 09:29:28 +02:00
Nathan Sobo
eb22b58756
Add smoke test for cursor blink
2017-05-05 09:29:28 +02:00
Nathan Sobo
0cc19aa66b
Implement a fast path for cursor blink to minimize battery impact
2017-05-05 09:29:28 +02:00
Nathan Sobo
76b834e043
Blink cursors; still needs tests
2017-05-05 09:29:28 +02:00
Nathan Sobo
b66a2bafae
⬆️ etch
2017-05-05 09:29:28 +02:00
Nathan Sobo
4da579ceff
Unfocus test
2017-05-05 09:29:28 +02:00
Nathan Sobo
2faec0b142
Avoid using += with let variables to avoid let compound assigment deopt
...
See https://jsperf.com/let-compound-assignment
2017-05-05 09:29:28 +02:00
Nathan Sobo
162020443b
Cache subtrees to avoid duplicating work within a single frame
2017-05-05 09:29:28 +02:00
Nathan Sobo
2880534ba6
Store line, line number decorations in arrays and avoid slicing
2017-05-05 09:29:28 +02:00
Nathan Sobo
61583462cf
Set the height of the line number gutter explicitly
2017-05-05 09:29:28 +02:00
Nathan Sobo
4e834da3e3
WIP: Render gutters before initial measurement
...
The shouldUpdate method is just returning true for now. We probably need
to find a new approach to representing line number decorations that's
easier to diff, perhaps a sparse array?
2017-05-05 09:29:28 +02:00
Nathan Sobo
d5d3cfc5a9
Adjust left position of scroll container when gutter container resizes
2017-05-05 09:29:28 +02:00
Nathan Sobo
1b1cffb32d
⬆️ etch to allow arbitrary objects as keys
2017-05-05 09:29:28 +02:00
Nathan Sobo
d8b22fb3bd
Associate gutters with their elements and support showing/hiding gutters
2017-05-05 09:29:28 +02:00
Nathan Sobo
16694a2166
Start on custom gutters
2017-05-05 09:29:28 +02:00
Nathan Sobo
6fefef0509
Only update scrollTop/Left when they change
...
This avoids forcing a reflows in some circumnstances.
2017-05-05 09:29:28 +02:00
Nathan Sobo
fadde63ec4
Integrate properly with Atom scheduler
2017-05-05 09:29:28 +02:00
Nathan Sobo
90452836fe
Fix wrong variable name
2017-05-05 09:29:28 +02:00
Nathan Sobo
251078da10
Factor editor component update into high-level phases
2017-05-05 09:29:28 +02:00
Nathan Sobo
555273f997
Refactor
2017-05-05 09:29:28 +02:00
Nathan Sobo
4707803416
Use the atom.views scheduler in TextEditorComponent
...
This ensures smooth scheduling interactions with autocomplete-plus
overlays so they measure their dimensions at the right time.
2017-05-05 09:29:28 +02:00