Commit Graph

32019 Commits

Author SHA1 Message Date
Antonio Scandurra
f3a96c968d Change editor.bufferRowsForScreenRows to include the supplied endScreenRow 2017-05-11 11:00:51 +02:00
Antonio Scandurra
a0ed201fe8 Fix blurring the editor when no hidden input is present 2017-05-11 10:52:56 +02:00
Antonio Scandurra
dc6653ffa6 Avoid creating a new timeout every time cursor blinking is paused 2017-05-11 10:39:52 +02:00
Antonio Scandurra
3c87b7499e Optimize isFoldable
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-10 18:48:18 +02:00
Antonio Scandurra
58a9682a0d ⬆️ text-buffer 2017-05-10 17:54:58 +02:00
Antonio Scandurra
e89552ea75 Ignore mismatched tags between lines in TokenizedBufferIterator
Previously the DisplayLayer would have issues when closing tags that had
not been previously opened, requiring us to guard against mismatched
scopes at the frontier of asynchronous tokenization (see 5cfe9716 for
more information).

Now the DisplayLayer gracefully handles closing tags that had not been
opened, meaning we can eliminate this costly logic.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-10 17:54:14 +02:00
Antonio Scandurra
c12882a371 ⬆️ etch 2017-05-10 16:25:53 +02:00
Antonio Scandurra
42b397e3b9 ⬆️ line-top-index 2017-05-10 16:24:55 +02:00
Antonio Scandurra
955cf98feb Use bufferRowsForScreenRows to compute line numbers 2017-05-10 13:45:19 +02:00
Antonio Scandurra
ab20fc3b19 Don't populate more screen rows than necessary
See 4eecf8d1a6.
2017-05-10 10:48:16 +02:00
Antonio Scandurra
ebf2aaa688 Avoid deopt when calling TokenizedLine.prototype.getTokenIterator 2017-05-10 10:44:19 +02:00
Nathan Sobo
4eecf8d1a6 Don't change number of tiles based on block decorations
This means we may render more tiles than necessary when we have block
decorations, but it prevents changing the number of rendered tiles
during scrolling with certain combinations of line height and editor
height. If it ever becomes a problem we can get smarter about
subtracting the height of the visible block decorations from the editor
height, but for now this gives us more reliable performance for the
common case.
2017-05-09 15:09:14 -06:00
Antonio Scandurra
f2aba0afc2 ⬆️ etch 2017-05-09 19:37:26 +02:00
Antonio Scandurra
f58fd749aa Dispose nodes associated with a LineComponent when replacing it 2017-05-09 18:30:44 +02:00
Antonio Scandurra
ca3395b1b2 Null out component when editor is destroyed to minimize leaks
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-09 18:24:24 +02:00
Antonio Scandurra
be2aaa0b22 Use explicit state to recycle tiles instead of modulo scheme
This avoids updating tiles unnecessarily when changing the number of
rendered tiles.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-09 17:46:29 +02:00
Antonio Scandurra
7f3794b12e Don't populate more screen rows than necessary
See 1c8847cb4f
2017-05-09 16:08:48 +02:00
Antonio Scandurra
5be2db645a Delete more dead code 2017-05-09 08:57:34 +02:00
Max Brunsfeld
1c8847cb4f 🐎 Ensure rendered tile count is stable when scrolling
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-08 15:50:16 -07:00
Nathan Sobo
681a1cb015 ⬆️ text-buffer 2017-05-08 16:03:46 -06:00
Nathan Sobo
f76e850aa5 Fix rendering artifacts when resizing with soft wraps
Previously, we were accidentally depending on the state of the display
layer when forcing it to update its index. This caused us to not index
enough content to cover the visibile area, which meant we weren't
querying enough lines to fill the screen in some situations.
2017-05-08 10:58:33 -06:00
Antonio Scandurra
ecef2af271 Merge pull request #13880 from atom/ns-editor-rendering
Rewrite editor rendering layout to use new browser features and virtual DOM
2017-05-05 19:57:08 +02:00
Antonio Scandurra
245f294cc3 Call editor.setEditorWidthInChars only when the value changed
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 19:55:57 +02:00
Antonio Scandurra
a7f658a40f Move cursors within a transaction to batch marker layer update events
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 19:55:18 +02:00
Antonio Scandurra
df4116d4aa Fix clicking past the content height
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 19:55:14 +02:00
Nathan Sobo
edf1b7fb74 Remove dead code 2017-05-05 11:30:14 -06:00
Antonio Scandurra
15f25a745a Update width of content when approximate longest screen row changes 2017-05-05 11:29:57 -06:00
Antonio Scandurra
b9783b125e Don't 'contain: paint' line elements
This fixes
https://github.com/atom/atom/pull/13880#issuecomment-296623782 once
again.
2017-05-05 14:18:17 +02:00
Antonio Scandurra
2855e01289 Don't create empty nodes when a text decoration ends next to a text tag
This was causing problems in measurements because in that code path we
assume that text nodes are never empty. This commit also adds a test
verifying this invariant when a text decoration ending right after a
text tag is added.
2017-05-05 11:22:01 +02:00
Antonio Scandurra
f7b79b477a Update class list even when the editor is not attached 2017-05-05 09:30:08 +02:00
Antonio Scandurra
97d2d7fb8b Fix remaining linting warnings 2017-05-05 09:30:08 +02:00
Antonio Scandurra
c541d3941c Fix remaining test failures in core 2017-05-05 09:30:08 +02:00
Nathan Sobo
bc34344d90 Maintain the scroll position when changing font size 2017-05-05 09:30:08 +02:00
Nathan Sobo
0c7030c70b Only resolve update promise after final render phase 2017-05-05 09:30:08 +02:00
Nathan Sobo
c5c48094ba Avoid requesting horizontal measurement when auto-scrolling vertically
This was leaving a measurement request in the map that was getting
picked up on the next frame. In some cases, the requested measurement
row was not present, causing an exception.
2017-05-05 09:30:08 +02:00
Nathan Sobo
1b1973db15 Rename method to match old implementation 2017-05-05 09:30:08 +02:00
Nathan Sobo
c00ad62a0e Pass mini attribute when creating new TextEditor from TextEditorElement
This avoids content being shifted over due to rendering and measuring
the gutter on element creation and then subsequently hiding it.
2017-05-05 09:30:08 +02:00
Nathan Sobo
abfcfb3c9a Set overflow: hidden and contain: layout paint on lines 2017-05-05 09:30:08 +02:00
Nathan Sobo
42bb02c8a8 Account for vertical scrollbar width when soft-wrapping lines 2017-05-05 09:30:08 +02:00
Nathan Sobo
fe13279531 Update DOM in screenPositionForPixelPosition if needed
Some packages are interacting with this method assuming this behavior,
so this commit eliminates `screenPositionForPixelPositionSync` and
instead just performs the DOM update in `screenPositionForPixelPosition`
if it is needed.
2017-05-05 09:30:08 +02:00
Antonio Scandurra
001fef4a05 Don't activate scrollPastEnd for autoHeight editors 2017-05-05 09:30:08 +02:00
Antonio Scandurra
de2cfb5ef7 ⬆️ text-buffer 2017-05-05 09:30:08 +02:00
Antonio Scandurra
ccc35b5141 Make first-mate scope ids always larger than built-in ones 2017-05-05 09:29:30 +02:00
Antonio Scandurra
c2b854123b Never create empty spans at the beginning of a row
This was happening when a text decoration overlapped a row, but the next
boundary was located exactly at the beginning of it.
2017-05-05 09:29:30 +02:00
Nathan Sobo
ac8a908385 Implement text decorations in rendering layer 2017-05-05 09:29:30 +02:00
Antonio Scandurra
f17baf4790 Use scope ids instead of tags 2017-05-05 09:29:30 +02:00
Antonio Scandurra
570cfdeaff Ignore resize events if they are delivered while the editor is hidden 2017-05-05 09:29:30 +02:00
Nathan Sobo
16b2fba851 Fix lint errors 2017-05-05 09:29:30 +02:00
Nathan Sobo
c36303e631 Avoid blowing away classes assigned on the editor element by packages
/cc @t9md
2017-05-05 09:29:30 +02:00
Nathan Sobo
c7228f6d81 Fix error when attaching soft-wrap editor in synchronous update mode
Taking the initial measurement was setting the soft wrap column, which
was triggering a display layer reset, which was scheduling an update.
This update occurred at an unexpected time causing an exception.
2017-05-05 09:29:30 +02:00