This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
Improve default decorations for cursor and selection lines in React editor - #2757
Merged
Merged
Conversation
Contributor
|
👏 |
Contributor
Author
|
So after thinking about this more I'm thinking that we shouldn't tie any of these styling changes to the React editor switch. Keeping everything as close as possible to the existing editor will make the transition easier. So I'm going to switch back to the former treatment of |
added 14 commits
June 28, 2014 15:39
It only decorates the head position of the decoration's marker.
The cursor-line decoration shouldn't be applied to every line that's selected. It should only be applied to the location of the cursor. We'll need to update themes to reflect this.
The React editor does not apply the .cursor-line-no-selection class, but instead relies on a combination of .cursor-line and .selection-line for selectors that want to target the cursor line when there is no selection. This allows themes to be upgraded to support the React editor and the old editor at the same time.
- onlyHead - onlyEmpty - onlyNonEmpty
We will introduce .selection-line as part of a separate effort, not the React switchover.
nathansobo
pushed a commit
that referenced
this pull request
Jun 28, 2014
Improve default decorations for cursor and selection lines in React editor
34 of 35 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2701
This PR updates the decorations on lines and line numbers in the following way:
.cursor-lineclass..selection-lineclass..cursor-line-no-selectionclass. I'd prefer this to be synthesized with.cursor-line:not(.selection-line)but we need it for backward compatibility.Previously, the
.cursor-lineclass would be applied to every line number in a selection, but now it's only applied to the line containing the cursor for consistency with what we do on line elements. This means certain themes will need to switch.line-number.cursor-lineto.line-number.selection-linefor the same effect. To support these themes in the old editor, we now also add.selection-lineto the line numbers in the gutter.Here you can see the line highlight working again in the light theme.
