Commit Graph

31973 Commits

Author SHA1 Message Date
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
Nathan Sobo
bd6eedcc88 Eliminate strictly contained divs wrapping lines and highlights
I was hoping to strictly contain the layouts of highlights an lines
separately, since they are updated during different render phases.
Unfortunately, strict containment requires both divs to be positioned
absolutely. This in turn creates separate stacking contexts for lines
and highlights, which makes it impossible to render highlights in front
lines which themes sometimes need to do. For example,
atom-material-syntax pushes bracket matcher highlights to the front so
they are not obscured by the theme's solid black cursor line background.

/cc @as-cii. You should examine my work here and make sure I'm not
screwing something up with your line/block decoration update code.
2017-05-05 09:29:30 +02:00
Antonio Scandurra
46daf64e12 Set autoHeight: true explicitly in benchmarks 2017-05-05 09:29:30 +02:00
Antonio Scandurra
72351481c7 Fix positioning for block decorations located at the beginning of a tile 2017-05-05 09:29:30 +02:00
Antonio Scandurra
638bb78ecb Fix build failures 2017-05-05 09:29:30 +02:00
Antonio Scandurra
45e95912fa Cache derived dimensions during each phase of updateSync
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
4b34c476a3 Update lines content only once per frame
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
1544e3bc7f Update cursors only once per frame (after content has been measured)
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
97125ad083 Update gutter container only once per frame unless its width changes
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Nathan Sobo
d92e0fc0a1 Eliminate cached placeholderTextVnode 2017-05-05 09:29:30 +02:00
Nathan Sobo
82cdf80f25 Extract CursorsAndInputComponent 2017-05-05 09:29:30 +02:00
Nathan Sobo
b23dcb7b9f Eliminate caching of linesVnode 2017-05-05 09:29:30 +02:00
Nathan Sobo
7d7a6ab507 Pass props to GutterContainerComponent instead of reaching up to parent
There are still a few rootComponent references remaining in the
LineNumberGutterComponent. These should be removed and instead we should
consult this data when constructing the line numbers to render.
2017-05-05 09:29:30 +02:00
Nathan Sobo
8c7f4d91f8 🎨 2017-05-05 09:29:30 +02:00
Nathan Sobo
656cabda0f Initialize all measurements to 0 2017-05-05 09:29:30 +02:00
Nathan Sobo
1ca4c69c87 WIP: Start extracting gutter component 2017-05-05 09:29:30 +02:00
Nathan Sobo
305fd14cd9 Add TextEditorElement.pixelRectRangeForScreenRange for compatibility 2017-05-05 09:29:30 +02:00
Nathan Sobo
a5a80448cb Add intersectsVisibleRowRange on TextEditorElement 2017-05-05 09:29:30 +02:00
Nathan Sobo
b54dbb58ab Add missing methods on TextEditorElement 2017-05-05 09:29:30 +02:00
Nathan Sobo
44539b1dc6 Remove some redundant styling 2017-05-05 09:29:30 +02:00
Nathan Sobo
0996d90be3 Add scrollbar classes in case any packages or themes target them 2017-05-05 09:29:30 +02:00
Nathan Sobo
207cd31054 Add highlights class for package compatibility 2017-05-05 09:29:30 +02:00
Antonio Scandurra
6ed7cd97cc Add highlight decoration classes to region elements as well
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
4bcace1628 Don't remeasure scrollbars for mini editors
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
efdb044ce6 Use cursor:text on atom-text-editor elements
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
e1ae3749c0 Add a pixelPositionForMouseEvent method
This was a private method in the previous implementation that was used
by some packages.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
59ae239a8c Provide an editorElement shim on TextEditor
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:30 +02:00
Antonio Scandurra
f45ff05306 Add {get,set}FirstVisibleScreen{Row,Column} to TextEditorElement 2017-05-05 09:29:30 +02:00
Antonio Scandurra
37b5d2eb4d Restore scrollbar positions correctly on reload 2017-05-05 09:29:30 +02:00
Antonio Scandurra
72d6316459 Fix shift-scroll on Windows and Linux 2017-05-05 09:29:29 +02:00
Antonio Scandurra
906b3b05d6 Update mock text editor in gutter-container-spec.coffee 2017-05-05 09:29:29 +02:00
Antonio Scandurra
8f5e4216dc Fix more lint errors 2017-05-05 09:29:29 +02:00
Antonio Scandurra
6a083e14a2 Schedule component updates directly from the model
The only event-based APIs we kept are for listening to changes in block
decoration markers.
2017-05-05 09:29:29 +02:00
Antonio Scandurra
a890528ec9 Use Math.round for positions that are at the end of a line 2017-05-05 09:29:29 +02:00
Nathan Sobo
c338227dab Drop floats 2017-05-05 09:29:29 +02:00
Nathan Sobo
77f04c47d9 Consolidate editor style sheets 2017-05-05 09:29:29 +02:00
Nathan Sobo
5bbbe1d790 Give line numbers the full width of the line number gutter 2017-05-05 09:29:29 +02:00
Nathan Sobo
1cc68e408e Add TextEditorComponent.screenPositionForPixelPositionSync
This method can be used to translate a pixel position to a screen
position even if the line is not currently rendered on screen.
2017-05-05 09:29:29 +02:00
Nathan Sobo
3d6921cca3 Add cursor decorations
These decorations allow the class and style of a cursor associated with
any marker to be customized.

/cc @t9md
2017-05-05 09:29:29 +02:00
Antonio Scandurra
3bca09bf27 Schedule update when setting scroll top row or scroll left column 2017-05-05 09:29:29 +02:00
Antonio Scandurra
e4659aad87 Add data-screen-row to line nodes 2017-05-05 09:29:29 +02:00
Antonio Scandurra
9d79b0189f Fix cursor positioning around fold markers 2017-05-05 09:29:29 +02:00
Antonio Scandurra
1e6a1c61e7 Add middle mouse pasting on Linux 2017-05-05 09:29:29 +02:00
Antonio Scandurra
2f356f85d3 Make process.platform easier to mock 2017-05-05 09:29:29 +02:00
Nathan Sobo
b242f034b4 Don't render decorations for invalidated markers 2017-05-05 09:29:29 +02:00
Nathan Sobo
dfe647d914 Fix lint error 2017-05-05 09:29:29 +02:00
Nathan Sobo
348d085880 Only enable cursor blink optimization when updateSync is using scheduler
This ensures that direct calls to updateSync from places like scroll
handlers never take this optimization path.
2017-05-05 09:29:29 +02:00