Commit Graph

79 Commits

Author SHA1 Message Date
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
Nathan Sobo
b47f6265c7 Move gutter width measurement into EditorComponent 2014-06-03 18:30:24 +09:00
Nathan Sobo
be0877327e Kill comment 2014-06-03 18:18:53 +09:00
Nathan Sobo
8f98f2368b Base gutter updates on defaultCharWidth instead of fontSize/Family 2014-06-03 17:43:56 +09:00
Nathan Sobo
e222998f82 Only compare screenRow to mouseWheelScreen row when it is defined
Fixes #2482
2014-06-03 17:43:35 +09:00
Nathan Sobo
f2a08cd178 Update the lines and gutter when the mouseWheelScreenRow changes 2014-05-31 08:56:56 +09:00
probablycorey
cb109dc09f Add buffer-row data to gutter-component 2014-05-30 15:04:50 -07:00
Nathan Sobo
875cfefd36 Merge branch 'master' into ns-ks-react-dont-measure-when-hidden
Conflicts:
	spec/editor-component-spec.coffee
	src/editor-component.coffee
	src/editor-scroll-view-component.coffee
	src/lines-component.coffee
2014-05-22 10:48:21 -06:00
Kevin Sawicki & Nathan Sobo
9e3ce09658 Rename lineHeight to lineHeightInPixels to distinguish from CSS value
CSS has a line-height property with values like '1.3', but we also have
a measured pixel value for line height. It's important to keep these
separate conceptually.
2014-05-22 10:17:12 -06: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
778beba901 Remove editor-colors class from line numbers 2014-05-20 17:10:55 -06:00
Nathan Sobo
353eb27d2e Update dataset screenRow of gutter nodes when updating them 2014-05-19 21:34:06 -06:00
Nathan Sobo
37bdfb716b Preserve the target when scrolling w/ mousewheel in gutter
Removing the target of a mouseweel event messes up velocity scrolling
with the track pad, so it needs to be preserved until scrolling ceases.
2014-05-19 14:03:34 -06:00
Nathan Sobo
8e65d30a84 Compute rendered row range once in EditorComponent and pass it down 2014-05-16 20:58:40 -06:00