adding code

pull/233110/head
Aiday Marlen Kyzy 2025-01-08 11:27:46 +01:00
parent c7ce4b25ab
commit 13e7c565c5
No known key found for this signature in database
GPG Key ID: D55A35EAC79FDA9A
6 changed files with 9 additions and 32 deletions

View File

@ -29,7 +29,6 @@
padding: 4px;
cursor: pointer;
}
.mtkoverflow:hover {
background-color: var(--vscode-button-hoverBackground);
}
@ -40,7 +39,6 @@
user-select: none;
-webkit-user-select: none;
}
/* Use user-select: text for lookup feature on macOS */
/* https://github.com/microsoft/vscode/issues/85632 */
.monaco-editor.mac .lines-content:hover,
@ -65,7 +63,6 @@
width: 100%;
}
/** spans should cover all the line height and text should be aligned at the bottom */
/* There are view-lines in view-zones. We have to make sure this rule does not apply to them, as they don't set a line height */
.monaco-editor .lines-content > .view-lines > .view-line > span {
top: 0;
@ -73,10 +70,6 @@
position: absolute;
}
.monaco-editor .lines-content > .view-lines > .view-line > span > span {
vertical-align: text-top;
}
.monaco-editor .mtkw {
color: var(--vscode-editorWhitespace-foreground) !important;
}

View File

@ -603,7 +603,6 @@ export class ViewLines extends ViewPart implements IViewLines {
}
public renderText(viewportData: ViewportData): void {
console.log('ViewLines#renderText');
// (1) render lines - ensures lines are in the DOM
this._visibleLines.renderLines(viewportData);
this._lastRenderedData.setCurrentVisibleRange(viewportData.visibleRange);

View File

@ -131,6 +131,8 @@ export class WhitespaceOverlay extends DynamicViewOverlay {
}
private _applyRenderWhitespace(ctx: RenderingContext, lineNumber: number, selections: LineRange[] | null, lineData: ViewLineData): string {
if (this._options.renderWhitespace === 'selection' && !selections) {
return '';
}
@ -146,7 +148,7 @@ export class WhitespaceOverlay extends DynamicViewOverlay {
const fauxIndentLength = lineData.minColumn - 1;
const onlyBoundary = (this._options.renderWhitespace === 'boundary');
const onlyTrailing = (this._options.renderWhitespace === 'trailing');
const lineHeight = this._options.lineHeight;
const lineHeight = ctx.getHeightForLineNumber(lineNumber);
const middotWidth = this._options.middotWidth;
const wsmiddotWidth = this._options.wsmiddotWidth;
const spaceWidth = this._options.spaceWidth;

View File

@ -1276,7 +1276,6 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}
public changeDecorations(callback: (changeAccessor: IModelDecorationsChangeAccessor) => any): any {
console.log('changeDecorations of CodeEditorWidget');
if (!this._modelData) {
// callback will not be called
return null;
@ -1324,7 +1323,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
}
public setDecorationsByType(description: string, decorationTypeKey: string, decorationOptions: editorCommon.IDecorationOptions[]): void {
console.log('setDecorationsByType of CodeEditorWidget');
const newDecorationsSubTypes: { [key: string]: boolean } = {};
const oldDecorationsSubTypes = this._decorationTypeSubtypes[decorationTypeKey] || {};
this._decorationTypeSubtypes[decorationTypeKey] = newDecorationsSubTypes;

View File

@ -25,8 +25,7 @@
background-color: inherit;
}
.monaco-editor .sticky-line-number,
.monaco-editor .sticky-line-content {
.monaco-editor .sticky-line-number, .monaco-editor .sticky-line-content {
color: var(--vscode-editorLineNumber-foreground);
white-space: nowrap;
display: inline-block;
@ -36,10 +35,10 @@
.monaco-editor .sticky-line-number .codicon-folding-expanded,
.monaco-editor .sticky-line-number .codicon-folding-collapsed {
float: right;
transition: var(--vscode-editorStickyScroll-foldingOpacityTransition);
display: inline-block;
vertical-align: text-top;
margin-left: 5px;
display: flex;
align-items: center;
}
.monaco-editor .sticky-line-content {
@ -48,14 +47,9 @@
white-space: nowrap;
}
.monaco-editor .sticky-line-content > span {
vertical-align: text-top;
}
.monaco-editor .sticky-line-number-inner {
display: inline-block;
text-align: right;
vertical-align: text-top;
}
.monaco-editor .sticky-widget {

View File

@ -142,7 +142,6 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
}
setState(_state: StickyScrollWidgetState | undefined, foldingModel: FoldingModel | undefined, _rebuildFromLine?: number): void {
console.log('setState, _state.startLineNumbers : ', _state?.startLineNumbers);
if (_rebuildFromLine === undefined &&
((!this._previousState && !_state) || (this._previousState && this._previousState.equals(_state)))
) {
@ -335,7 +334,6 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
newLine = sb.build();
}
// Need to set the line height from the decoration line height and font size
const height = this.specialLineHeights.get(line) ?? this._lineHeight;
const lineHTMLNode = document.createElement('span');
lineHTMLNode.setAttribute(STICKY_INDEX_ATTR, String(index));
@ -375,6 +373,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
this._editor.applyFontInfo(lineHTMLNode);
this._editor.applyFontInfo(lineNumberHTMLNode);
lineNumberHTMLNode.style.lineHeight = `${height}px`;
lineHTMLNode.style.lineHeight = `${height}px`;
lineNumberHTMLNode.style.height = `${height}px`;
@ -395,19 +394,10 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
lineHTMLNode.style.zIndex = isLastLine ? lastLineZIndex : intermediateLineZIndex;
lineNumberHTMLNode.style.zIndex = isLastLine ? lastLineZIndex : intermediateLineZIndex;
// --
console.log('index', index);
console.log('this._lineNumbers : ', this._lineNumbers);
console.log('this._lastLineRelativePosition', this._lastLineRelativePosition);
const widgetHeight = this._getStickyScrollWidgetFullHeight(this._lineNumbers, index);
console.log('widgetHeight', widgetHeight);
const lastLineTop = `${widgetHeight + this._lastLineRelativePosition + (stickyLine.foldingIcon?.isCollapsed ? 1 : 0)}px`;
const intermediateLineTop = `${index * this._lineHeight}px`;
console.log('isLastLine', isLastLine);
console.log('lastLineTop', lastLineTop);
console.log('intermediateLineTop', intermediateLineTop);
const top = isLastLine ? lastLineTop : intermediateLineTop;
console.log('top', top);
lineHTMLNode.style.top = top;
lineNumberHTMLNode.style.top = top;
return stickyLine;