Commit Graph

15672 Commits

Author SHA1 Message Date
Nathan Sobo
174bac378d Fix lint errors 2017-05-05 09:29:29 +02:00
Nathan Sobo
c8f2fbb657 Get TextEditorElement tests passing 2017-05-05 09:29:29 +02:00
Nathan Sobo
eb33b5c39b Delete obsolete code and tests related to text editor rendering 2017-05-05 09:29:29 +02:00
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
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
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
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
c8aeee9786 Fix bad syntax in src/initialize-benchmark-window.js 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
6e6dce21ee Don't re-measure if editor has become invisible 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
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
Nathan Sobo
5a6935a01c Use LineTopIndex to convert from/to rows to/from pixel positions 2017-05-05 09:29:28 +02:00
Nathan Sobo
b32b760ee4 WIP: Start on block decorations 2017-05-05 09:29:28 +02:00
Nathan Sobo
171e4e88ca Cache prefixed scope names 2017-05-05 09:29:28 +02:00
Nathan Sobo
eb588d4c7c Test and fix the center option to autoscroll 2017-05-05 09:29:28 +02:00
Nathan Sobo
8652222b22 Add setInputEnabled and don't handle textInput if it is disabled 2017-05-05 09:29:28 +02:00
Nathan Sobo
acf996fc14 Speed up cursor blink test 2017-05-05 09:29:28 +02:00
Nathan Sobo
7da588c3ee Ensure nextUpdateOnlyBlinksCursor argument is true, not just truthy
We pass the bound scheduleUpdate method as an event handler to a variety
of subscription methods, some of which supply arguments.
2017-05-05 09:29:28 +02:00
Nathan Sobo
3b7112889a Correctly assign gutter container vnode 2017-05-05 09:29:28 +02:00