Commit Graph

92 Commits

Author SHA1 Message Date
Nathan Sobo
8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -07:00
Nathan Sobo
b86f6870c5 Use native event handlers instead of React
React event handlers don’t work because of the shadow DOM
2014-11-04 16:37:22 -07:00
Ivan Zuzak
29ad748aa4 Dont propagate fold icon clicks to editor component 2014-09-03 18:52:50 +02:00
Nathan Sobo
7738eeeacc Give the line-numbers div an opaque background for better GPU perf
We sample both the background color of the editor and the gutter. If the
gutter has an actual background color, we use it. Otherwise we fall back
to the same background as the editor.
2014-07-24 17:23:04 -07:00
Nathan Sobo
d3a46b6bc9 Don't try to update lines/line numbers until after initial measurement
Fixes #3047
2014-07-24 10:27:38 -07:00
Ben Ogle
2a9c78ef92 Move horiz scrollbar into the scrollView
Also remove all the gutter width calculation. It was flawed anyway,
2014-07-23 16:20:48 -07:00
Ben Ogle
d3a6e79428 The horizontal scrollbar takes gutter width into account 2014-07-22 18:26:58 -07:00
Nathan Sobo
ba21f0b0d8 Eliminate duplicate 'gutter' class
This was previously needed when we applied 'editor-colors' to the
line numbers to give them an opaque background in hopes of supporting
sub pixel AA, but that dream is dead for now anyway. This makes the
gutter harder to style, so I'm nixing it.
2014-07-21 14:56:09 -07:00
Nathan Sobo
a68b9a793f Don't update the GutterComponent if there's no renderedRowRange 2014-07-21 14:28:48 -07:00
Nathan Sobo
38b286f989 Remove 'editor-colors' class from lines and gutter for mini editors
Having the editor-colors class on these elements was causing the theme
to be applied to lines in mini editors in the settings view, which
caused a black inset box to appear with dark syntax themes.

This was added to give the lines an opaque background which was supposed
to enable sub pixel anti-aliasing despite being on the GPU, but it
didn't seem to be working. Perhaps we can revisit this issue after the
Chrome 35 upgrade to see if sub pixel antialiasing works with opaque
backgrounds afterward.
2014-07-21 13:50:58 -07:00
Ben Ogle
9976166902 Render the line numbers after gutter mount
Fixes #2916
2014-07-10 17:25:58 -07:00
Ben Ogle
475f92351f == -> is 2014-07-10 10:40:49 -07:00
Ben Ogle
7be5553ba1 Index line decorations by ids
And don’t use _.deepContains
2014-07-09 12:51:52 -07:00
Ben Ogle
80eb31679f Add a Decoration object. Rework to use this object 2014-07-03 17:32:37 -07:00
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
7c356d2592 Revert "Render highlights on their own layer to avoid GPU artifacts" 2014-06-21 01:58:11 -06:00
Nathan Sobo
d839ea9aa5 Don't render an opaque background behind line numbers
It doesn't help subpixel anti-aliasing like I thought, so screw it.
2014-06-20 16:07:19 -06:00
Ben Ogle
dee0771dd7 Use ? in the conditional. 2014-06-20 12:50:42 -07:00
Ben Ogle
b1dd4f2e8e Index the previous decoration cache by lineNumberId rather than screenRow
Why? Screen rows change. If some operation (folding?) changes the 
screen rows and the decorations at the same time, the previous 
decorations will no longer be valid and can no longer be diffed against 
the decorations to-be-rendered.
2014-06-20 11:27:39 -07:00
Ben Ogle
593b5b4e36 Use _.deepContains 2014-06-20 10:50:12 -07:00
Ben Ogle & Nathan Sobo
9083103bb3 Add click and shift-click in gutter 2014-06-19 12:04:36 -07:00
Nathan Sobo
609855af3c Decide to measure gutter's width in gutter
The gutter is in a better position to determine if the max line number
length has changed because it's a property that gets passed in so we
can compare current with previous.

Fixes #2659
2014-06-18 21:07:13 -06:00
Nathan Sobo
8d87eb2ed6 Style the .line-numbers div to be compatible w/ both themes and the GPU
The .line-numbers div has to have an opaque background because it's
sent as a texture to the GPU, and otherwise it will have isuses with
subpixel antialiasing.

However, themes style the background of the .gutter div, which was
getting obscured by the opaque background of the line numbers. This
commit adds the .gutter class to the .line-numbers div as well and
ensures it always fills the entire height of the editor.
2014-06-18 12:36:40 -06:00
probablycorey
bacd612c71 Apply editor-colors style to gutter
Closes #2596
2014-06-18 09:42:33 -07:00
Nathan Sobo
2fffbba503 Eliminate Decoration class and use plain objects instead 2014-06-17 17:35:56 -06:00
Nathan Sobo
4832d36ac1 Rename filterDecorationsByScreenRow to getLineDecorations
Also rename local variable to lineDecorations for clarity
2014-06-17 14:35:56 -06:00
Ben Ogle
ef09fbbfb2 Remove softWrap decoration option 2014-06-17 11:24:27 -07:00
Ben Ogle
34ec15862f Filter decorations in the components.
This reduces the number of intermediate objects we need to create. The 
downside is a bit more code complexity in the components.
2014-06-16 16:54:21 -07:00
Ben Ogle
4f2f158d0d Make selection updating work properly 2014-06-16 15:36:09 -07:00
Ben Ogle
d4057d21c7 Pass the decoration hash into the gutterComponent 2014-06-16 15:36:08 -07:00
Ben Ogle
b028673b5d Only render on updates 2014-06-16 15:36:08 -07:00
Ben Ogle
2d4360dcf0 Decorations can now only be attached to markers.
The basics work. It will render them on the gutter.
2014-06-16 15:36:08 -07:00
Corey Johnson
94dd1eed54 Merge remote-tracking branch 'origin/master' into cj-add-react-editor-shims
Conflicts:
	src/editor-component.coffee
2014-06-11 08:56:27 -07:00
Nathan Sobo
99611fad34 Give React editor lines and line numbers an opaque background
This ensures subpixel antialiasing works correctly. It was previously
present on both of these components but got dropped accidentally.
2014-06-11 08:51:19 -06:00
probablycorey
9e7e77bdf8 Merge remote-tracking branch 'origin/master' into cj-add-react-editor-shims
Conflicts:
	src/gutter-component.coffee
2014-06-10 15:42:23 -07:00
Ben Ogle
e59f242f19 Move click gutter into the GutterComponent 2014-06-09 14:11:41 -07:00
Ben Ogle
8e1e5a3760 Add ability to click the fold icons 2014-06-09 14:04:23 -07:00
Ben Ogle
da5bf6c74c Defensive on the decorations 2014-06-09 14:04:23 -07:00
Ben Ogle
5cd8f5952f Make editor push decorator updates to the gutter 2014-06-09 14:04:23 -07:00
Ben Ogle
a13990155f Use setImmediate rather than setTimeout 2014-06-09 14:04:23 -07:00
Ben Ogle
a72f11594d 💄 remove decoratorType instance var 2014-06-09 14:04:23 -07:00
Ben Ogle
6ce859774a Name changes 2014-06-09 14:04:22 -07:00
Ben Ogle
d51894103d Debounce the rendering of decorations 2014-06-09 14:04:22 -07:00
Ben Ogle
eb59196c02 Rendering decorations works well.
Also specs.
2014-06-09 14:04:22 -07:00
Ben Ogle
142eedd705 Renders decoration changes. 2014-06-09 14:04:22 -07:00
Ben Ogle
77d269c6d9 Beginning of decorations 2014-06-09 14:04:22 -07:00
Ben Ogle
b23009a8f3 fold classes work 2014-06-09 14:04:21 -07:00
Nathan Sobo
fc5dc46e73 Make dummy line number have a buffer row of -1
This prevents accidentally returning the dummy line number when asking
for line numbers for buffer row 0 using shim code.
2014-06-09 13:32:42 -06:00
Nathan Sobo
2234ff78c7 Include line-number class for backward compatibility 2014-06-06 16:54:28 +09:00