Commit Graph

92 Commits

Author SHA1 Message Date
Nathan Sobo
fadde63ec4 Integrate properly with Atom scheduler 2017-05-05 09:29:28 +02:00
Nathan Sobo
251078da10 Factor editor component update into high-level phases 2017-05-05 09:29:28 +02:00
Nathan Sobo
555273f997 Refactor 2017-05-05 09:29:28 +02:00
Nathan Sobo
4707803416 Use the atom.views scheduler in TextEditorComponent
This ensures smooth scheduling interactions with autocomplete-plus
overlays so they measure their dimensions at the right time.
2017-05-05 09:29:28 +02:00
Nathan Sobo
1676617218 Add static TextEditor.viewForOverlayItem method to avoid using global 2017-05-05 09:29:28 +02:00
Nathan Sobo
5297e7ab1a Add avoidOverflow: false option for overlays 2017-05-05 09:29:28 +02:00
Nathan Sobo
47761a455e Support class property on overlay decorations 2017-05-05 09:29:28 +02:00
Nathan Sobo
b6f71bc648 Render overlay decorations 2017-05-05 09:29:28 +02:00
Nathan Sobo
c7dc567e62 Only update scrollTop/Left of dummy scrollbar after inner div is updated 2017-05-05 09:29:28 +02:00
Nathan Sobo
5f2d4c801b Handle mousedowns on dummy scrollbars that miss the actual scrollbars
Because the dummy scrollbar elements are potentially wider than the real
scrollbars rendered by the browser, we need to delegate some mousedown
events to the parent component.
2017-05-05 09:29:28 +02:00
Nathan Sobo
e6e5420f42 Correctly handle overflows caused by scrollbar for the opposite axis 2017-05-05 09:29:28 +02:00
Nathan Sobo
0999d0bf02 Handle scrolling of the dummy scrollbars directly 2017-05-05 09:29:28 +02:00
Nathan Sobo
2075f06404 WIP: Introduce dummy scrollbars
Still need tests on all of this
2017-05-05 09:29:28 +02:00
Nathan Sobo
5a47f179e3 Introduce synthetic scrolling
We previously thought scroll events had changed somehow to become
synchronous, but were wrong. This introduces synthetic scrolling where
we use GPU translation of the contents of the gutter and scroll
containers to simulate scrolling and explicitly capture mousewheel
events.

Still need to add dummy scrollbars and deal with their footprint in
clientHeight and clientWidth.
2017-05-05 09:29:28 +02:00
Nathan Sobo
e6026a145c Fix auto-width 2017-05-05 09:29:28 +02:00
Nathan Sobo
2cde4aea76 Remove TextEditorComponent.getModel 2017-05-05 09:29:28 +02:00
Nathan Sobo
927648d318 Use marker id as highlight key
This keeps highlight elements in stable positions on the DOM, which
ensures that CSS transitions don't appear in the wrong spot.
2017-05-05 09:29:28 +02:00
Nathan Sobo
bef043a8ad Refactor highlight flashing 2017-05-05 09:29:28 +02:00
Nathan Sobo
6023159819 Add highlight decoration flashing 2017-05-05 09:29:28 +02:00
Nathan Sobo
4e00139965 Support placeholderText parameter 2017-05-05 09:29:28 +02:00
Nathan Sobo
36f5262f40 Honor the isLineNumberGutterVisible option 2017-05-05 09:29:28 +02:00
Nathan Sobo
88b30bc4dc Support autoHeight and autoWidth settings 2017-05-05 09:29:28 +02:00
Nathan Sobo
369818b475 Emit editor blur events as if no hidden input existed 2017-05-05 09:29:28 +02:00
Nathan Sobo
401434858b Gracefully handle focus prior to detecting the editor has become visible 2017-05-05 09:29:28 +02:00
Nathan Sobo
1427dbf540 Make lines extend across the entire width of the scroller
This ensures line decorations render properly, even when the content is
narrower than the editor.
2017-05-05 09:29:28 +02:00
Nathan Sobo
5c7208751f Correctly autoscroll if a horizontal scrollbar appears in the same frame 2017-05-05 09:29:28 +02:00
Nathan Sobo
5d82dcf87a Wait for content width to update before autoscrolling horizontally 2017-05-05 09:29:28 +02:00
Nathan Sobo
758466c9af Make various tweaks to improve mini editors
Still a ways to go, but this is a start toward getting the mini-editors
to play nice with our existing styling.
2017-05-05 09:29:28 +02:00
Nathan Sobo
ebad2e6605 Implement detachment to eliminate spurious drag events 2017-05-05 09:29:28 +02:00
Nathan Sobo
173cdcb372 Cache rendered screen lines on component to avoid drifting from model
The model may have screen lines that aren't yet rendered in the page,
and we want to avoid referring to them on mouse clicks.
2017-05-05 09:29:27 +02:00
Nathan Sobo
625990d22f Null guard target check to keep tests simple 2017-05-05 09:29:27 +02:00
Nathan Sobo
df4d52c89a Use constrained scroll values 2017-05-05 09:29:27 +02:00
Nathan Sobo
c2206b88da Destroy folds on fold marker click 2017-05-05 09:29:27 +02:00
Nathan Sobo
a2f75c8337 Toggle folds when clicking the arrow icon in the line number gutter 2017-05-05 09:29:27 +02:00
Nathan Sobo
cf19d0efd5 Autoscroll vertically when click-dragging the line number gutter 2017-05-05 09:29:27 +02:00
Nathan Sobo
6e9a9ef43c Add spec structure 2017-05-05 09:29:27 +02:00
Nathan Sobo
ffc2025df5 Handle clicking, shift-clicking, cmd-clicking and dragging in gutter 2017-05-05 09:29:27 +02:00
Nathan Sobo
17d579f949 Only handle the left mouse button (and middle on Linux) 2017-05-05 09:29:27 +02:00
Nathan Sobo
35ae3fb08f Implement autoscroll when mouse is dragged on content 2017-05-05 09:29:27 +02:00
Nathan Sobo
5594c9d82f Expand selections on mouse drag 2017-05-05 09:29:27 +02:00
Nathan Sobo
6bfe08e9b0 Remove cyclic requires 2017-05-05 09:29:27 +02:00
Nathan Sobo
3f4cd5e438 Correctly render cursors on reversed selections 2017-05-05 09:29:27 +02:00
Nathan Sobo
8f385377cf Make cursors render above lines 2017-05-05 09:29:27 +02:00
Nathan Sobo
4ef2119ef8 Inherit background color so line tiles get a solid background 2017-05-05 09:29:27 +02:00
Nathan Sobo
c410309827 Expand selections on shift-click 2017-05-05 09:29:27 +02:00
Nathan Sobo
35753c3a8d Add specs for single-, triple-, and cmd-clicking 2017-05-05 09:29:27 +02:00
Nathan Sobo
2996500d90 Handle double and triple click on lines 2017-05-05 09:29:27 +02:00
Nathan Sobo
fab5a93254 Set cursor position on single click 2017-05-05 09:29:27 +02:00
Nathan Sobo
88f3a5b468 WIP: Port screenPositionForPixelPosition from old LinesYardstick
Still need to port tests. This will support various mouse interactions.
2017-05-05 09:29:27 +02:00
Nathan Sobo
d7e76d9302 Remove unused event parameters 2017-05-05 09:29:27 +02:00