mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
have option to make block decorations not collapsed
This commit is contained in:
parent
f505dde405
commit
b5827cf895
4 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,7 @@ export class BlockDecorations extends ViewPart {
|
|||
bottom = ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, true);
|
||||
} else {
|
||||
top = ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, true);
|
||||
bottom = decoration.range.isEmpty()
|
||||
bottom = decoration.range.isEmpty() && !decoration.options.blockDoesNotCollapse
|
||||
? ctx.getVerticalOffsetForLineNumber(decoration.range.startLineNumber, false)
|
||||
: ctx.getVerticalOffsetAfterLineNumber(decoration.range.endLineNumber, true);
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ export interface IModelDecorationOptions {
|
|||
* In this case, the range must be empty and set to the last line.
|
||||
*/
|
||||
blockIsAfterEnd?: boolean | null;
|
||||
blockDoesNotCollapse?: boolean | null;
|
||||
blockPadding?: [top: number, right: number, bottom: number, left: number] | null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2248,6 +2248,7 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions {
|
|||
readonly description: string;
|
||||
readonly blockClassName: string | null;
|
||||
readonly blockIsAfterEnd: boolean | null;
|
||||
readonly blockDoesNotCollapse?: boolean | null;
|
||||
readonly blockPadding: [top: number, right: number, bottom: number, left: number] | null;
|
||||
readonly stickiness: model.TrackedRangeStickiness;
|
||||
readonly zIndex: number;
|
||||
|
@ -2275,6 +2276,7 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions {
|
|||
private constructor(options: model.IModelDecorationOptions) {
|
||||
this.description = options.description;
|
||||
this.blockClassName = options.blockClassName ? cleanClassName(options.blockClassName) : null;
|
||||
this.blockDoesNotCollapse = options.blockDoesNotCollapse ?? null;
|
||||
this.blockIsAfterEnd = options.blockIsAfterEnd ?? null;
|
||||
this.blockPadding = options.blockPadding ?? null;
|
||||
this.stickiness = options.stickiness || model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges;
|
||||
|
|
1
src/vs/monaco.d.ts
vendored
1
src/vs/monaco.d.ts
vendored
|
@ -1552,6 +1552,7 @@ declare namespace monaco.editor {
|
|||
* In this case, the range must be empty and set to the last line.
|
||||
*/
|
||||
blockIsAfterEnd?: boolean | null;
|
||||
blockDoesNotCollapse?: boolean | null;
|
||||
blockPadding?: [top: number, right: number, bottom: number, left: number] | null;
|
||||
/**
|
||||
* Message to be rendered when hovering over the glyph margin decoration.
|
||||
|
|
Loading…
Reference in a new issue