18 Commits

Author SHA1 Message Date
Nathan Sobo
0edfbaebeb Rename editor option to useHardwareAcceleration 2014-07-01 12:17:43 -06:00
Nathan Sobo
512d4da587 Add editor.gpuDisabled option to prevent React editor from using layers
When gpuDisabled is true, we use `translate` instead of `translate3d`
to position various elements, preventing the creation of GPU layers.
2014-07-01 11:56:05 -06:00
Nathan Sobo
f41a9739ac 💄 2014-06-24 13:02:41 -06:00
Nathan Sobo
0150b40376 Implement CursorComponent::shouldComponentUpdate
This prevents re-rendering cursors on blink, since only the class on
the outer component changes.
2014-06-24 12:42:58 -06:00
Nathan Sobo
d3e6bd038f Precompute cursor pixel rects in EditorComponent and pass them down 2014-06-24 12:40:56 -06:00
Nathan Sobo
030bcd6d4f Make react cursor the width of a default character at the end of lines
When the cursor is positioned before a character, we always make it the
width of that character. But at the end of a line, there is no character
to use to set the width, so we just use the defaultCharWidth.

This makes the block cursor visible on empty lines in vim-mode.
2014-06-11 11:54:10 -06:00
Nathan Sobo
1bce626324 Compute ranges of cursors & selections in EditorComponent and pass down
Previously, SelectionsComponenet::shouldComponentUpdate was storing the
ranges for selections as a side effect. We also were passing boolean
values (cursorMoved and selectionUpdated) to determine if these
components should update.

Now, we compute a simple hash of screen ranges for selections and
cursors in the root component and pass them down. This simplifies
shouldComponentUpdate for selections and allows us to implement one
for cursors.
2014-06-03 17:43:55 +09:00
Nathan Sobo
65b1e13b83 Use Atom-specific fork of React allowing selection restoration opt out
This fork of React allows data-react-skip-selection-restoration to be
defined on input elements, skipping costly selection restoration that
occurs when the input element is focused during reconciliation.
2014-05-20 23:05:13 -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
f3efd7d60b Position cursors relative to scrollLeft and fix specs 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
48d90e3dfc Funnel cursor and selection updates through EditorComponent 2014-04-22 17:09:43 -06:00
Nathan Sobo
66f3f2d883 Add displayName to components 2014-04-22 17:09:42 -06:00
Nathan Sobo
2b0ef68255 Blink cursors always. Still need to pause blinking when moving. 2014-04-22 17:09:37 -06:00
Nathan Sobo
e24196c0ef Require React directly rather than via reactionary
Reactionary is just a tiny helper library that can rely on the react
installed by the requiring application instead.
2014-04-22 17:09:36 -06:00
Nathan Sobo
3d3b72a954 Render selections 2014-04-22 17:09:04 -06:00
Nathan Sobo
53cc5c9856 Base cursor x position on char widths stored in DisplayBuffer
Whenever new lines are added to the screen, we measure and store any
unseen scope/character combinations in the DisplayBuffer.
2014-04-22 17:09:03 -06:00
Nathan Sobo
9c2d321327 Break out selection, cursor, and input components 2014-04-22 17:09:02 -06:00