Commit Graph

31887 Commits

Author SHA1 Message Date
Nathan Sobo
bfa410b114 Add has-selection class to editors with non-empty selections 2017-05-05 09:29:29 +02:00
Nathan Sobo
f83ad6bb7c Give cursors at the end of lines the width of an 'x' character 2017-05-05 09:29:29 +02:00
Nathan Sobo
87eb16f5ed Fix clicking fold placeholders by ignoring pointer events on cursors div 2017-05-05 09:29:29 +02:00
Nathan Sobo
336aa0f521 Hide scrollbars in mini editors 2017-05-05 09:29:29 +02:00
Nathan Sobo
e602b5c466 Account for scrollbars and padding in autoHeight/Width mode 2017-05-05 09:29:29 +02:00
Nathan Sobo
988118213d Don't use position: relative on atom-text-editor 2017-05-05 09:29:29 +02:00
Nathan Sobo
9bf0ea83f4 Test clicking more locations outside of the lines 2017-05-05 09:29:29 +02:00
Antonio Scandurra
893da22c55 Replace element-resize-detector with experimental ResizeObserver API
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:29 +02:00
Antonio Scandurra
837871700d Position dummy line element absolutely and make it invisible
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:29 +02:00
Antonio Scandurra
8372d08b49 Don't share block decoration/character measurement vnodes across instances
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:29 +02:00
Antonio Scandurra
03702a1fe6 Add deprecated shadow root property to editor element
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:29 +02:00
Antonio Scandurra
26b9273e00 Add data-encoding to editor element
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:29 +02:00
Antonio Scandurra
2a1ba7f05b Add data-grammar to editor element 2017-05-05 09:29:29 +02:00
Antonio Scandurra
0a702d1680 Skip obsolete tests for now, but delete them later 2017-05-05 09:29:29 +02:00
Antonio Scandurra
5df17f061e Create resize detector before calling etch.updateSync for the first time 2017-05-05 09:29:29 +02:00
Antonio Scandurra
f3c48c8b70 Register style elements change events in AtomEnvironment.initialize
...and fix spec/workspace-element-spec.js
2017-05-05 09:29:29 +02:00
Antonio Scandurra
1d01d499a9 Fix spec/text-editor-spec.coffee 2017-05-05 09:29:29 +02:00
Antonio Scandurra
e2cf60a0c9 Don't reuse resize detectors across TextEditorComponent instances
Due to the way element-resize-detector schedules the delivering of
resize events, this will ensure that creating an editor while the clock
is mocked won't prevent subsequent tests using the real clock from
getting such events.
2017-05-05 09:29:29 +02:00
Antonio Scandurra
b7a421eadf Stop calling initialize in ViewRegistry tests 2017-05-05 09:29:29 +02:00
Antonio Scandurra
0210b0bc81 Update fake gutter container interface in gutter-spec.coffee 2017-05-05 09:29:29 +02:00
Antonio Scandurra
1d8f4f2cdd Wait until the editor is focused before starting to type in smoke test 2017-05-05 09:29:29 +02:00
Antonio Scandurra
2993f3c1ac Further optimize line replacement 2017-05-05 09:29:29 +02:00
Antonio Scandurra
a99237b33b Fix lint errors and delete dead code 2017-05-05 09:29:29 +02:00
Antonio Scandurra
6742025a02 Import octicon-mixins in static/text-editor.less 2017-05-05 09:29:29 +02:00
Antonio Scandurra
c8aeee9786 Fix bad syntax in src/initialize-benchmark-window.js 2017-05-05 09:29:29 +02:00
Antonio Scandurra
8707cabe40 Don't count the dummy line in block decoration test 2017-05-05 09:29:29 +02:00
Nathan Sobo
c83cd34e02 Slice lines and decorations passed to LinesTileComponent
This ensures the component's shouldUpdate method works correctly.
2017-05-05 09:29:29 +02:00
Nathan Sobo
8aabd026ad Remove highlight caching for now 2017-05-05 09:29:29 +02:00
Nathan Sobo
b99ddfd3bf Remove unused var 2017-05-05 09:29:28 +02:00
Nathan Sobo
060a884ba9 Include more properties in LinesTileComponent.shouldUpdate 2017-05-05 09:29:28 +02:00
Nathan Sobo
99e3c62e69 Clear highlight nodes when recycling line tiles 2017-05-05 09:29:28 +02:00
Nathan Sobo
3fce3ebe17 Fix test 2017-05-05 09:29:28 +02:00
Nathan Sobo
6e6dce21ee Don't re-measure if editor has become invisible 2017-05-05 09:29:28 +02:00
Nathan Sobo
7aec696bb5 Remove stray logging 2017-05-05 09:29:28 +02:00
Nathan Sobo
2c6490c2e0 Don't update editor component if we know we are not visible 2017-05-05 09:29:28 +02:00
Nathan Sobo
95c8950004 Re-measure and update rendered content when editor styles change 2017-05-05 09:29:28 +02:00
Nathan Sobo
b6cd473c16 Fix typo 2017-05-05 09:29:28 +02:00
Antonio Scandurra
054c133ed4 Remeasure block decorations when editor width changes
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-05 09:29:28 +02:00
Antonio Scandurra
8103bd687c Update line number gutter when invalidating a visible block decoration
When two or more decorations in the same tile were invalidated but the
sum of their height didn't change, we were previously failing to
recognize that the line numbers gutter needed to be re-rendered. With
this commit, whenever a block decoration is visible and gets
invalidated, we will force the line number gutter to always update.
2017-05-05 09:29:28 +02:00
Nathan Sobo
8aae3ab1ae Hide cursors with non-empty selection if showCursorsOnSelection is false
Also, remove some barely used public APIs around cursor visibility that
don't make much sense and are not ideal for performance. We don't want
to subscribe to the visibility of each cursor.
2017-05-05 09:29:28 +02:00
Antonio Scandurra
bc8b548d1a Add TextEditorElement.prototype.invalidateBlockDecorationDimensions 2017-05-05 09:29:28 +02:00
Antonio Scandurra
b264d4764a Align line number nodes with line nodes 2017-05-05 09:29:28 +02:00
Antonio Scandurra
7474b4b678 Integrate block decorations in the custom lines rendering routine 2017-05-05 09:29:28 +02:00
Antonio Scandurra
919c5a022b Don't use etch for lines rendering 2017-05-05 09:29:28 +02:00
Antonio Scandurra
316df28bbd Splice LineTopIndex when a textual change occurs 2017-05-05 09:29:28 +02:00
Antonio Scandurra
4cd9a36594 Handle inserting and updating block decorations 2017-05-05 09:29:28 +02:00
Antonio Scandurra
015f196f2f Test scrolling down with block decorations 2017-05-05 09:29:28 +02:00
Antonio Scandurra
e289283205 Render block decorations between lines 2017-05-05 09:29:28 +02:00
Antonio Scandurra
7a0a41a7df Use Array.push instead of array[i] = when adding line components
Albeit (potentially) slower, this will allow to add a dynamic number of
block decoration nodes before and after a given line.
2017-05-05 09:29:28 +02:00
Antonio Scandurra
f7632a9095 Add fast path when no block decorations need to be measured 2017-05-05 09:29:28 +02:00