This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
Add highlight decorations - #2605
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
This helper matches up kinda weird with the other one... seems like they should have corresponding names.
Contributor
|
Incredibly excited for this. |
The basics work. It will render them on the gutter.
Now you can specify a list of types with your decoration.
This reduces the number of intermediate objects we need to create. The downside is a bit more code complexity in the components.
Contributor
Author
|
@nathansobo there is one test failure, and it looks like something you had in there. I probably removed whatever code was handling this, but I dont understand what this is supposed to do or how to repro. |
34 of 35 tasks
And rename local variable to highlightDecorations to clarify intent
Also rename local variable to lineDecorations for clarity
Using the marker's id plus the decoration class can cause an error in the event we apply a decoration with the same class twice to the same marker. This is admittedly unlikely, but I think it's cleaner to just allocate unique id's for decoration objects.
Contributor
|
👯 |
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.
This adds the ability to highlight ranges in the buffer tracked by markers. Just like find and replace does when you search for something, only more efficient. You write a little code:
And get this:

Changes
Some things changed from the previous iteration of decorations
addDecorationForMarkerandremoveDecorationForMarker{type: ['gutter', 'line'], class: 'sweet-view'}[[4, 0], [4, Infinity]]to apply it to the wrapped rows, and[[4, 0], [4, 0]]to only apply to the initial row.See #2507 for the original decorations