Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements block decorations feature. #152740

Merged
merged 2 commits into from Jun 21, 2022
Merged

Implements block decorations feature. #152740

merged 2 commits into from Jun 21, 2022

Conversation

hediet
Copy link
Member

@hediet hediet commented Jun 21, 2022

No description provided.

@hediet hediet requested a review from alexdima June 21, 2022 13:53
@hediet hediet self-assigned this Jun 21, 2022
@VSCodeTriageBot VSCodeTriageBot added this to the June 2022 milestone Jun 21, 2022
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I left a few small comments.


.monaco-editor .blockDecorations-block {
position: absolute;
content: " ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is not necessary - was a left over. Thanks!

this.domNode.appendChild(block);
}
const top = ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber);
const bottom = ctx.getVerticalOffsetForLineNumber(decoration.range.endLineNumber + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will contain any view zone immediately following this line. If you would like to limit the block strictly to the end line number, you would need to use something like ctx.getVerticalOffsetForLineNumber(decoration.range.endLineNumber) + lineHeight. lineHeight can be found in the editor options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, good catch. Unfortunately, this is the behavior I need, to cover deleted ranges in the 3wm editor.

I suggest to add a comment and merge it as this and solve the problem when someone does not want to include view zones.

src/vs/editor/common/model/textModel.ts Outdated Show resolved Hide resolved
@hediet hediet requested a review from alexdima June 21, 2022 14:19
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@hediet hediet enabled auto-merge June 21, 2022 14:21
@hediet hediet merged commit af45c32 into main Jun 21, 2022
@hediet hediet deleted the hediet/blockDecorations branch June 21, 2022 14:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants