提交 e3038450 编写于 作者: D Daniel Imms

Don't let the terminal font size fallback to editor setting

Fixes #16446
上级 5afeacc0
......@@ -24,6 +24,7 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import debugActions = require('vs/workbench/parts/debug/browser/debugActions');
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { OpenNextRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions';
import { DefaultConfig } from 'vs/editor/common/config/defaultConfig';
let configurationRegistry = <IConfigurationRegistry>Registry.as(Extensions.Configuration);
configurationRegistry.registerConfiguration({
......@@ -81,9 +82,9 @@ configurationRegistry.registerConfiguration({
'default': false
},
'terminal.integrated.fontSize': {
'description': nls.localize('terminal.integrated.fontSize', "Controls the font size in pixels of the terminal, this defaults to editor.fontSize's value."),
'description': nls.localize('terminal.integrated.fontSize', "Controls the font size in pixels of the terminal."),
'type': 'number',
'default': 0
'default': DefaultConfig.editor.fontSize
},
'terminal.integrated.lineHeight': {
'description': nls.localize('terminal.integrated.lineHeight', "Controls the line height of the terminal, this number is multipled by the terminal font size to get the actual line-height in pixels."),
......
......@@ -119,7 +119,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
let editorConfig = this._configurationService.getConfiguration<IConfiguration>();
let fontFamily = terminalConfig.fontFamily || editorConfig.editor.fontFamily;
let fontSize = this.toInteger(terminalConfig.fontSize, 0) || editorConfig.editor.fontSize;
let fontSize = this.toInteger(terminalConfig.fontSize, 0);
if (fontSize <= 0) {
fontSize = DefaultConfig.editor.fontSize;
}
......
......@@ -83,22 +83,6 @@ suite('Workbench - TerminalConfigHelper', () => {
configHelper.panelContainer = fixture;
assert.equal(configHelper.getFont().fontSize, '2px', 'terminal.integrated.fontSize should be selected over editor.fontSize');
configurationService = new MockConfigurationService({
editor: {
fontFamily: 'foo',
fontSize: 1
},
terminal: {
integrated: {
fontFamily: 0,
fontSize: 0
}
}
});
configHelper = new TerminalConfigHelper(Platform.Linux, configurationService);
configHelper.panelContainer = fixture;
assert.equal(configHelper.getFont().fontSize, '1px', 'editor.fontSize should be the fallback when terminal.integrated.fontSize not set');
configurationService = new MockConfigurationService({
editor: {
fontFamily: 'foo',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册