Skip to content

Commit 9604d61

Browse files
authored
Update usages of EditorOption.lineHeight (microsoft#261667)
1 parent 7d0d7ff commit 9604d61

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from '../../../../plat
2626
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
2727
import { isObject } from '../../../../base/common/types.js';
2828
import { CommandsRegistry } from '../../../../platform/commands/common/commands.js';
29-
import { IEditorOptions as ICodeEditorOptions, EditorOption } from '../../../../editor/common/config/editorOptions.js';
29+
import { EditorOption, IEditorOptions as ICodeEditorOptions } from '../../../../editor/common/config/editorOptions.js';
3030
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
3131
import { UILabelProvider } from '../../../../base/common/keybindingLabels.js';
3232
import { OS, OperatingSystem } from '../../../../base/common/platform.js';
@@ -326,7 +326,8 @@ export class WalkThroughPart extends EditorPane {
326326
this.contentDisposables.push(editor);
327327

328328
const updateHeight = (initial: boolean) => {
329-
const lineHeight = editor.getOption(EditorOption.lineHeight);
329+
const position = editor.getPosition();
330+
const lineHeight = position ? editor.getLineHeightForPosition(position) : editor.getOption(EditorOption.lineHeight);
330331
const height = `${Math.max(model.getLineCount() + 1, 4) * lineHeight}px`;
331332
if (div.style.height !== height) {
332333
div.style.height = height;
@@ -343,7 +344,7 @@ export class WalkThroughPart extends EditorPane {
343344
if (innerContent) {
344345
const targetTop = div.getBoundingClientRect().top;
345346
const containerTop = innerContent.getBoundingClientRect().top;
346-
const lineHeight = editor.getOption(EditorOption.lineHeight);
347+
const lineHeight = editor.getLineHeightForPosition(e.position);
347348
const lineTop = (targetTop + (e.position.lineNumber - 1) * lineHeight) - containerTop;
348349
const lineBottom = lineTop + lineHeight;
349350
const scrollDimensions = this.scrollbar.getScrollDimensions();
@@ -495,3 +496,4 @@ export class WalkThroughPart extends EditorPane {
495496
super.dispose();
496497
}
497498
}
499+

0 commit comments

Comments
 (0)