124 Commits

Author SHA1 Message Date
Kevin Sawicki
05dc9aad89 💄 2014-10-24 13:31:43 -07:00
Kevin Sawicki
e5660e5e83 🐎 Only use String::substr for pair chars 2014-10-24 13:31:43 -07:00
Kevin Sawicki
e928447eab Stored paired characters in width cache
Previously characters were treated individually even when multiple
characters would render as a single character on screen.
2014-10-24 13:31:43 -07:00
Ben Ogle
31490ca31e Last of scopeDescriptor -> scopes from tokens 2014-10-21 11:49:49 -07:00
Ben Ogle
16ad957609 scopeDescriptor -> scopes
Now that we have a real ScopeDescriptor object, 
these should change back!
2014-10-21 11:38:43 -07:00
Ben Ogle
c0091b4601 scopes -> scopeDescriptor
!!!
2014-10-13 16:30:41 -07:00
Nathan Sobo
2a94e4a33c Pass tokenizedLines to LinesComponent so measuring stays in sync
Fixes #3318
2014-08-25 18:16:45 -06:00
Nathan Sobo
a71a524ec7 Rework DOM measurement to try to prevent measurement errors
* Simplify scrollbar refresh and measurement by using imperative DOM
  manipulation instead of React to hide/show scrollbars.
* Rename `::performInitialMeasurement` to `::becameVisible`
* Break `::checkForVisibilityChange` out of `::pollDOM` and use it in
  to check for the element becoming visible in `componentWillUpdate`.
* Don't rely on stored visibility state anywhere. Always check again.
  This could potentially be cached for an update cycle but being wrong
  about this is disastrous so I'm being conservative.
2014-08-21 17:50:46 -06:00
Nathan Sobo
6c52bcf20c Assign ::firstNonWhitespace/TrailingWhitespaceIndex in Token::split
Fixes #3277
2014-08-15 12:58:27 -06:00
Nathan Sobo
c74f6bb615 Remove handling of invisibles from EditorComponent 2014-08-13 16:31:40 -06:00
Nathan Sobo
63f2ab3088 Render end-of-line invisibles based on state of TokenizedLine 2014-08-13 16:31:39 -06:00
Ben Ogle
7de2ad34aa Remove opaque backgrounds on mini editors
Fixes #3239
2014-08-12 14:53:09 -07:00
Nathan Sobo
393552a4b6 Take cursors off the GPU and position them on the lines layer
The compositor overhead is not worth it.
2014-07-27 11:47:33 -06:00
Nathan Sobo
c6116468e4 Apply background color of root editor node to lines as an inline style
This ensures lines have an opaque background that matches whatever the
editor is styled as, but avoids the need to apply the .editor-colors
class to the .lines div. That approach fell down when people were
setting the background color via means other than .editor-colors, such
as styling mini editors via the .editor.mini selector in the settings
view.
2014-07-24 16:54:01 -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
ffb041a160 Only render an nbsp on empty lines when no eol character defined
Fixes #3053
2014-07-23 09:30:52 -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
Nathan Sobo
ca1220a682 Delay initial measurement until the editor becomes visible
Previously, these measurements were always performed when the editor
component was mounted. This didn't work in situations where the
component was mounted in a non-visible state. This commit includes a
visibility check in the resize polling we were already doing, kicking
off the measurement process as soon as the editor is visible.
2014-07-21 13:40:10 -07:00
Nathan Sobo
d0893ccdaf Add placeholderText to React editors 2014-07-21 10:43:31 -07:00
Nathan Sobo
79ee887c9a Fix a bug where scopes were being duplicated for every single token
This improves scroll performance by generating many fewer span elements
to render lines.
2014-07-20 15:09:14 -07:00
Nathan Sobo
cdb5fe15d2 Render nbsp on empty lines to ensure they have a non-zero height
Fixes #2958
2014-07-16 00:56:14 -07:00
Lee Dohm
7ac3e6d9a5 🐛 Fix regression in indent-guide in React editor
Previously the indent guide was always showing on the whitespace only
lines in the React editor. This is the same behavior as in the old
editor and had the same fix, just ported to `LinesComponent`.

See: 314833bbac

Fixes #2274
2014-07-13 09:39:21 -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
Nathan Sobo
dd5c9ff6d4 Remove stray logging 2014-07-08 21:06:34 -06:00
Nathan Sobo
e170b9f56b Render line-ending invisibles on empty lines
Fixes #2857

Including correct interleaving with indent guides.
2014-07-08 16:53:06 -06:00
Nathan Sobo
2878196e0a Make React editor indent guide work like it did in the old editor
Fixes #2367

* The indent level of empty lines is the *max* of the nearest non empty
  line, rather than favoring the level of the line below.

* An extra wrap guide is no longer rendered for empty lines

I didn't port the specs over because we already had good coverage at the
model level. It just needed to be updated for the preferred behavior.
2014-07-07 17:59:26 -06:00
Ben Ogle
80eb31679f Add a Decoration object. Rework to use this object 2014-07-03 17:32:37 -07:00
Nathan Sobo
a4ed02c3c5 Update lines for line insertions/removals preceding rendered row range 2014-07-03 11:22:57 -06: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
Ben Ogle
7179bc5af1 Merge pull request #2738 from atom/bo-fix-max-scroll-width
Fix max scroll width in react editor
2014-06-25 18:16:32 -07:00
Nathan Sobo
3bf0c73170 Assign line width explicitly to prevent full screen repaints
Fixes #2746
2014-06-25 19:13:50 -06:00
Ben Ogle & Nathan Sobo
f739dce210 Only recompute scroll width once for each batch of measured chars 2014-06-25 15:26:13 -07:00
Ben Ogle
9b577ecbf8 Make lines 100% of the width of their container
This is part of the solution to #2701. Lines need to be 100% wide in
case a class styles their background.
2014-06-23 22:46:27 -06:00
Ben Ogle & Nathan Sobo
76a911f17a Render highlights immediately to support underlayer shim 2014-06-23 16:23:45 -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
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
Nathan Sobo
64f3938f5c Batch all editor updates together automatically via process.nextTick 2014-06-20 15:06:10 -06:00
Ben Ogle
aef6991ca8 Set the decorations and previousDecorations vars before loops
Both loops use both vars, so both need to be available before the 
diffing!
2014-06-20 11:29:18 -07:00
Ben Ogle
e8db3e97ce Remove cached decorations for removed lines 2014-06-20 11:28:01 -07:00
Ben Ogle
1228435f9b 💄 2014-06-20 11:00:40 -07:00
Ben Ogle
593b5b4e36 Use _.deepContains 2014-06-20 10:50:12 -07:00
Ben Ogle
72b1821828 Render line decorations. 2014-06-19 17:20:05 -07:00
Nathan Sobo
388763e7cd Wait to measure characters if editor is hidden
Also, when characters *are* measured, request a display update
2014-06-19 04:19:51 -06:00
Ben Ogle
7a9710b8c3 Add fold markers to folded lines
Fixes #2634
2014-06-18 13:47:38 -07:00
Nathan Sobo
f1f83a7d36 Add a comment explaining the .editor-colors class on .lines 2014-06-18 12:36:40 -06:00
Nathan Sobo
5d15af943e Rename filterDecorationsByMarkerId to getHighlightDecorations
And rename local variable to highlightDecorations to clarify intent
2014-06-17 14:31:56 -06: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