Commit Graph

15666 Commits

Author SHA1 Message Date
Nathan Sobo
57e6419d1d Restore conditional loading of react editor renderer 2014-05-16 15:31:16 -06:00
Nathan Sobo
9b7547cbe0 Get indent guide specs passing again 2014-05-16 15:31:16 -06:00
Nathan Sobo
e74dfe3438 Fix gutter specs and update lines when digit counts change 2014-05-16 15:31:16 -06:00
Nathan Sobo
fe82e3e30f Only clear screen row caches on lines component if lineHeight changes 2014-05-16 15:31:16 -06:00
Nathan Sobo
b000e8e4a2 Get selection specs passing again 2014-05-16 15:31:16 -06:00
Nathan Sobo
64c82f1c87 Update cursor positioning text for simplified token markup 2014-05-16 15:31:15 -06:00
Nathan Sobo
0ad2730353 Update specs for new line node rendering approach
Lines are no longer translated on the GPU, and they aren't inserted into
the DOM in an order that reflects their order in the buffer.
2014-05-16 15:31:15 -06:00
Nathan Sobo
6017b73acf Add ability to look up line nodes by screen row 2014-05-16 15:31:15 -06:00
Nathan Sobo
0334177696 Make lineOverdrawMargin a property 2014-05-16 15:31:15 -06:00
Nathan Sobo
54cec0a5ff Hold the gutter's width with a dummy line number 2014-05-16 15:31:15 -06:00
Nathan Sobo
c5fa2bf12d Attach views to .lines instead of defunct .scroll-view-content 2014-05-16 15:31:15 -06:00
Nathan Sobo
bc8a1756f3 Use the .selections layer as the underlayer 2014-05-16 15:31:15 -06:00
Corey Johnson & Nathan Sobo
3f01e2f748 Implement shouldComponentUpdate for SelectionsComponent 2014-05-16 15:31:15 -06:00
Nathan Sobo
7dfe829fc8 Style lines with inline styles for performance 2014-05-16 15:31:15 -06:00
Nathan Sobo
c87bc57f9e Don't update top positions of lines/lineNodes unless they have changed 2014-05-16 15:31:15 -06:00
Nathan Sobo
89bd241a78 Always run react in dev mode for now 2014-05-16 15:31:14 -06:00
Nathan Sobo
d15fd34f7a Render selections on lines layer; don't put each line number on GPU 2014-05-16 15:31:14 -06:00
Nathan Sobo
a118cdd32b Put selections and lines on the GPU together in sibling divs 2014-05-16 15:31:14 -06:00
Nathan Sobo
3a2de9c698 Don't render every line on the GPU
Opaque lines are turning out to be a total pain, plus they ruin absolute
positioning on the lines div. The slight speed boost isn't seeming worth
it anymore.
2014-05-16 15:31:14 -06:00
Nathan Sobo
c60e5d90fd 💄 2014-05-16 15:31:14 -06:00
Nathan Sobo
e9bff37e06 Render line numbers manually 2014-05-16 15:31:14 -06:00
Nathan Sobo
695f8da3c3 💄 extract buildLineInnerHTML method 2014-05-16 15:31:14 -06:00
Nathan Sobo
ea5c5c9e84 Move line HTML generation into lines component 2014-05-16 15:31:14 -06:00
Nathan Sobo
4f9108980f WIP: Manually update line nodes when scrolling 2014-05-16 15:31:14 -06:00
Nathan Sobo
8148e4e50d Skip selection restoration on our fork of react 2014-05-16 15:31:14 -06:00
Nathan Sobo
f07a832c83 Sync cursor animations when cursors are added 2014-05-16 15:31:14 -06:00
Nathan Sobo
070d239f41 Blink cursors with a CSS animation
Now that they're on their own layer, I don't think it affects the
repaint timing when typing on lines (if it ever did).
2014-05-16 15:31:13 -06:00
Nathan Sobo
9b02055db9 Move selection background region calculation into React component 2014-05-16 15:31:13 -06:00
Nathan Sobo
0162247bd7 Precompute selection regions for all lines
This is easer to reason about and probably more efficient than computing
everything on a per-line basis.
2014-05-16 15:31:13 -06:00
Nathan Sobo
9001d34ddf Change selection specs to match new rendering scheme 2014-05-16 15:31:13 -06:00
Nathan Sobo
cbcc30b384 Don't render empty selections 2014-05-16 15:31:13 -06:00
Nathan Sobo
ce9fe90217 Make multi-line selections appear to span the screen with a single div
Because lines are opaque and any area of a selection that overlaps a
line is actually rendered on the line itself, the screen-spanning
background of a multi-line selection can actually be rendered as a
single div spanning the entire screen from the first row to the
penultimate row of the selection.
2014-05-16 15:31:13 -06:00
Nathan Sobo
7a9278e6a7 Render selection fragments on opaque lines
Because lines are opaque on the GPU for sub pixel antialiasing, the
lines obscure the selections which were formerly rendered behind the
lines. This commit renders selection fragments *on* each opaque line
layer so the selections look correct again. Still needs cleanup and
optimization.
2014-05-16 15:31:13 -06:00
Nathan Sobo
01622140e3 Rename renderedRowRange to visibleRowRange
We only render visible rows now, so this makes more sense.
2014-05-16 15:31:13 -06:00
Nathan Sobo
e44027b186 Fix the height/width of the editor in spec
Now that everything is absolutely position, the editor no longer assumes
a "natural" height and width. This can be addressed later if we want to
allow editors to expand based on their content.
2014-05-16 15:31:13 -06:00
Nathan Sobo
d53f97ecfe Fix horizontal scrolling spec 2014-05-16 15:31:13 -06:00
Nathan Sobo
f3efd7d60b Position cursors relative to scrollLeft and fix specs 2014-05-16 15:31:12 -06:00
Nathan Sobo
8d25da9474 Update line number rendering specs for new layer scheme 2014-05-16 15:31:12 -06:00
Nathan Sobo
1aee276b45 Update line rendering specs for new layer scheme 2014-05-16 15:31:12 -06:00
Nathan Sobo
191bc115cf Use explicit descendant selector for styling lines 2014-05-16 15:31:12 -06:00
Nathan Sobo
63488997ee Give lines and line numbers an opaque background to support sub-pixel AA
Since lines and line numbers are now on the GPU, their text won't be
properly anti-aliased on low-resolution displays unless their layers
have a solid background.
2014-05-16 15:31:12 -06:00
Nathan Sobo
a22480d857 Don't give lines a negative z-index
Removing the z-index makes them accessible via mouse in the inspector.
2014-05-16 15:31:12 -06:00
Nathan Sobo
757ae6de39 Position selections relative to viewport
This is getting closer, but lines still need to be opaque. Multi-line
selections will still need to be rendered behind the line layers so they
can extend to the edge of the viewport, so this code still has value.
2014-05-16 15:31:12 -06:00
Nathan Sobo
cfc08e8b98 Allow horizontal scrolling 2014-05-16 15:31:12 -06:00
Nathan Sobo
c8e9282557 Position cursors as layers relative to the viewport 2014-05-16 15:31:11 -06:00
Nathan Sobo
a36163ce86 Manually set the gutter width to the width of a line number
We need to absolutely position line numbers to minimize repaints, but
the gutter needs to be wide enough to show them.
2014-05-16 15:31:11 -06:00
Nathan Sobo
e3d1a6aef8 Render each line number on its own layer 2014-05-16 15:31:11 -06:00
Nathan Sobo
7d8256d343 Drop lineOverdraw and scroll-view-content div 2014-05-16 15:31:11 -06:00
Nathan Sobo
bf9f8597a7 Give each line its own layer on the GPU 2014-05-16 15:31:11 -06:00
Nathan Sobo
9f2c8c1756 Measure characters in new lines when vertically scrolling stops 2014-05-16 15:31:11 -06:00