79 Commits

Author SHA1 Message Date
Nathan Sobo
7c356d2592 Revert "Render highlights on their own layer to avoid GPU artifacts" 2014-06-21 01:58:11 -06:00
Nathan Sobo
df8d014e3c Add a dedicated underlayer to avoid GPU artifacts on wrap guide etc
Trying to make the .highlights layer double as the .underlayer was
causing GPU artifacts on the wrap guide when the last highlight was
removed. This puts it in its own layer to avoid that.
2014-06-20 16:33:08 -06:00
Nathan Sobo
4218e0a037 Render highlights on their own layer to avoid GPU artifacts
Previously, when the last highlight div was removed from the lines
layer, chunks of the lines would sometimes disappear. Since we've
discovered that giving the lines an opaque background doesn't help with
subpixel anti-aliasing anyway, I've found that rendering highlights on
their own layer behind the lines and making the lines layer transparent
avoids the arficacts.
2014-06-20 15:18:19 -06:00
Ben Ogle
63587abe97 Give fold markers a pointer on hover 2014-06-18 14:21:03 -07:00
Ben Ogle
3790cdb262 Reset highlights so they don’t interfere with styleguide text.highlight 2014-06-17 17:08:53 -07:00
Ben Ogle
a3784500ec Fix editor-view tests 2014-06-17 11:13:15 -07:00
Ben Ogle
0312609e19 Make highlights render as absolute position 2014-06-16 15:57:23 -07:00
Corey Johnson
5e51445118 Update cursor z-index 2014-06-11 10:04:31 -07:00
Ben Ogle
d9e731c84a Update styles on the foldable icons 2014-06-09 14:04:23 -07:00
Nathan Sobo
fe3ea229a2 Prevent focus loss on double click without breaking single click focus
Previously, we stopped propagation on mousedown events to prevent
certain cases where focus was being lost after double clicking to select
a word.

Unfortunately, this also broke the ability to focus the editor by
clicking it. When investigating this, I noticed that whenever we lost
focus, the target of the mousedown event was always the cursor. So I
tried setting `pointer-events: none` on cursors and can no longer
reproduce the double-click issue.

/cc @probablycorey
2014-06-07 12:37:40 +09:00
Nathan Sobo
66661f2d10 Make cursor visible when .editor-contents is focused 2014-06-06 23:58:39 +09:00
Nathan Sobo
cae5cdc81c Put the .editor class on the wrapper, not the component
Things depend on the react editor wrapper having the .editor class,
but inside the editor, we can control the style. I changed the
component's div to be .editor-contents for now. We can eliminate this
extra style when we eliminate the wrapper.
2014-06-06 23:52:35 +09:00
Ben Ogle
d684911fce Make cursor visible when over indent guides 2014-05-27 12:11:24 -07:00
Nathan Sobo
2ae7cba452 Don't blink cursors with CSS animation
It seems to create intermittent lags when moving the cursor and typing.
2014-05-20 14:04:59 -06:00
Nathan Sobo
b000e8e4a2 Get selection specs passing again 2014-05-16 15:31:16 -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
7dfe829fc8 Style lines with inline styles for performance 2014-05-16 15:31:15 -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
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
191bc115cf Use explicit descendant selector for styling lines 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
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
bf9f8597a7 Give each line its own layer on the GPU 2014-05-16 15:31:11 -06:00
David Y. Ross
e3302b3f73 hide the cursor with cursor-hidden class rather than element.style 2014-05-15 19:20:32 -07:00
Nathan Sobo
ab1ede5fe6 Add a dummy scrollbar corner
Horizontal / vertical scrollbars render a 'corner' on the lower right
when they would otherwise overlap. I previously relied on drawing both
dummy scrollbars at their full width/height so the corner got rendered,
but that interfered with the display of the horizontal scrollbar in
certain circumstances because it was too wide to scroll. This commit
provides that behavior with an absolutely positioned div with the same
dimensions as the intersection of scrollbars when both are visible.
2014-05-09 11:33:04 -06:00
Nathan Sobo
dbd271f70a Don't obscure last character of long lines with vertical scrollbar
This entailed quite a few changes to dial in scrollbars. The scrollbars
are now adjusted in size to account for the width of the opposite
scrollbar. If the width or height are not explicitly constrained and we
are scrollable in the opposite direction that is constrained, we account
for the width of the opposite scrollbar in assigning a natural height
or width based on the content.
2014-05-09 11:33:04 -06:00
Nathan Sobo
e6df30e94c Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we
can't actually scroll in that direction, causing the white square where
neither scrollbar overlaps to appear at the lower right corner.
2014-05-09 11:33:03 -06:00
Nathan Sobo
c730e3c67e Ensure selections span the entire screen, even when lines are short
Also, pass scrollHeight and scrollWidth as props to child components
instead of calling the method to compute them in multiple components.
2014-04-22 17:10:22 -06:00
Nathan Sobo
22496ceeb1 WIP: Minimize paint when scrolling and composite lines with the GPU 2014-04-22 17:10:22 -06:00
Nathan Sobo
d566726b9f Use negative z-indices so attached views are visible in react editor 2014-04-22 17:10:21 -06:00
Nathan Sobo
8c266957f1 Isolate CSS changes to a single selector 2014-04-22 17:09:41 -06:00
David Graham & Nathan Sobo
48135a1e8d Update the horizontal scrollbar when scrollLeft changes in the model 2014-04-22 17:09:38 -06:00
Nathan Sobo
1162af61ed Render a basic gutter 2014-04-22 17:09:38 -06:00
Nathan Sobo
a931aaff53 Remove temporary cursor visibility styling 2014-04-22 17:09:38 -06:00
Nathan Sobo
3d3b72a954 Render selections 2014-04-22 17:09:04 -06:00
Nathan Sobo
70e5880b1d Start on cursor rendering 2014-04-22 17:09:02 -06:00
Nathan Sobo
c2858fcae2 Use overflow: hidden for editor 2014-04-22 17:09:02 -06:00
Nathan Sobo
3c69fd2d49 Handle mouse wheel and make some tweaks to improve scroll performance 2014-04-22 17:09:02 -06:00
Nathan Sobo
519ebb1ca6 Leave folded marker on end of lines in its natural position
Previously, we were nudging it upward. Something must have changed at
some point because it looked too high.
2014-01-20 14:22:26 -07:00
Nathan Sobo
4db2ad53fd Rename .fold class to .folded on line numbers in gutter
Using an adjective blends in better with '.foldable'
2014-01-18 11:35:22 -07:00
Nathan Sobo
149a6825b4 Show bookmarks instead of fold indicators unless hovering 2014-01-17 17:20:37 -07:00
Nathan Sobo
99f025d5d6 Rename .fold-icon to .icon-right in gutter to make it multi-purpose 2014-01-17 16:59:50 -07:00
Nathan Sobo
475ff140a7 Make unfolded fold icons darker on hover 2014-01-17 15:22:29 -07:00
Nathan Sobo
1e3dc05b3d Nudge chevron-right left a bit to align better with chevron-down 2014-01-17 14:58:16 -07:00
Nathan Sobo
1a12a17b7a Use actual markup for fold icon so we can determine when it's clicked 2014-01-17 14:55:06 -07:00
Nathan Sobo
8757e1f145 Add downward pointing chevrons next to foldable row numbers in gutter 2014-01-17 14:34:53 -07:00
Ben Ogle
0c2c739741 Add ability for placeholder text in mini editor 2013-11-25 14:46:54 -08:00