If a given selector in a stylesheet targeting the atom-text-editor
context references `.editor` or `.editor-colors`, we automatically
replace these with the appropriate `:host` pseudo-class expressions.
If the selector already contains the :host pseudo-class, we perform no
upgrade.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
The goal is to allow the editor’s styling to be overridden as follows:
atom-text-editor {
background: black;
color: white;
}
If we retain these classes, themes will continue to style the root
element of the editor and destroy the ability to style the editor in
this way. You would instead have to do the following:
atom-text-editor::shadow .editor {
background: black;
color: white;
}
This is way less intuitive and confusing for people.
Trying to style both modes of the text editor with the same style sheet
is proving to be more trouble than it’s worth. This prepares the shadow
DOM style sheet to diverge more radically to enable the background color
to be overridden from the outside more easily.
This also affects cmd-shift-backspace.
The expected behaviour of cmd-delete is that it deletes to end of line,
with cmd acting as a modifier to delete/shift-backspace.
We were getting stack traces in specs when the window got focused caused
by this subscription never getting disposed. We investigated, and can’t
find a case where removing this causes any issues.
Tested:
* Loading/reloading empty window
* Loading/reloading window with pane splits
* Opening/closing dev tools
* Switching focus between atom windows
* Switching focus between applications
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>