提交 d59da643 编写于 作者: I isidor

debug.console.wordWrap

fixes #72210
上级 466c132f
......@@ -375,6 +375,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
this.createReplInput(this.container);
this.replDelegate = new ReplDelegate(this.configurationService);
const wordWrap = this.configurationService.getValue<IDebugConfiguration>('debug').console.wordWrap;
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, treeContainer, this.replDelegate, [
this.instantiationService.createInstance(VariablesRenderer),
this.instantiationService.createInstance(ReplSimpleElementsRenderer),
......@@ -386,11 +387,10 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
identityProvider: { getId: (element: IReplElement) => element.getId() },
mouseSupport: false,
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IReplElement) => e },
horizontalScrolling: false,
horizontalScrolling: !wordWrap,
setRowLineHeight: false,
supportDynamicHeights: true
supportDynamicHeights: wordWrap
}) as WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>;
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
let lastSelectedString: string;
this._register(this.tree.onMouseClick(() => {
......@@ -742,8 +742,13 @@ class ReplDelegate implements IListVirtualDelegate<IReplElement> {
const countNumberOfLines = (str: string) => Math.max(1, (str.match(/\r\n|\n/g) || []).length);
// Give approximate heights. Repl has dynamic height so the tree will measure the actual height on its own.
const fontSize = this.configurationService.getValue<IDebugConfiguration>('debug').console.fontSize;
const config = this.configurationService.getValue<IDebugConfiguration>('debug');
const fontSize = config.console.fontSize;
const rowHeight = Math.ceil(1.4 * fontSize);
const wordWrap = config.console.wordWrap;
if (!wordWrap) {
return element instanceof Expression ? 2 * rowHeight : rowHeight;
}
// In order to keep scroll position we need to give a good approximation to the tree
// For every 150 characters increase the number of lines needed
......
......@@ -437,6 +437,7 @@ export interface IDebugConfiguration {
fontSize: number;
fontFamily: string;
lineHeight: number;
wordWrap: boolean;
};
}
......
......@@ -249,6 +249,11 @@ configurationRegistry.registerConfiguration({
description: nls.localize('debug.console.lineHeight', "Controls the line height in pixels in the debug console. Use 0 to compute the line height from the font size."),
default: 0
},
'debug.console.wordWrap': {
type: 'boolean',
description: nls.localize('debug.console.wordWrap', "Controls if the lines should wrap in the debug console."),
default: true
},
'launch': {
type: 'object',
description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."),
......
......@@ -25,6 +25,7 @@ interface IConfiguration extends IWindowsConfiguration {
telemetry: { enableCrashReporter: boolean };
keyboard: { touchbar: { enabled: boolean } };
workbench: { list: { horizontalScrolling: boolean }, useExperimentalGridLayout: boolean };
debug: { console: { wordWrap: boolean } };
}
export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution {
......@@ -38,6 +39,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private touchbarEnabled: boolean;
private treeHorizontalScrolling: boolean;
private useGridLayout: boolean;
private debugConsoleWordWrap: boolean;
constructor(
@IWindowsService private readonly windowsService: IWindowsService,
......@@ -109,6 +111,12 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
changed = true;
}
// Debug console word wrap
if (config.debug && typeof config.debug.console.wordWrap === 'boolean' && config.debug.console.wordWrap !== this.debugConsoleWordWrap) {
this.debugConsoleWordWrap = config.debug.console.wordWrap;
changed = true;
}
// Notify only when changed and we are the focused window (avoids notification spam across windows)
if (notify && changed) {
this.doConfirm(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册