diff --git a/news/2 Fixes/7624.md b/news/2 Fixes/7624.md new file mode 100644 index 000000000000..1875f4ca313b --- /dev/null +++ b/news/2 Fixes/7624.md @@ -0,0 +1 @@ +Make interactive window and native take their fontSize and fontFamily from the settings in VS Code. diff --git a/package-lock.json b/package-lock.json index fe9aa78f2776..f2c501bab47e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13770,7 +13770,7 @@ "dependencies": { "buffer": { "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -13793,7 +13793,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -18754,7 +18754,7 @@ "dependencies": { "json5": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { diff --git a/src/client/datascience/types.ts b/src/client/datascience/types.ts index e737c1b2740f..9c1d80f82d9f 100644 --- a/src/client/datascience/types.ts +++ b/src/client/datascience/types.ts @@ -394,6 +394,8 @@ export interface IDataScienceExtraSettings extends IDataScienceSettings { extraSettings: { editorCursor: string; editorCursorBlink: string; + fontSize: number; + fontFamily: string; theme: string; }; intellisenseOptions: { diff --git a/src/client/datascience/webViewHost.ts b/src/client/datascience/webViewHost.ts index ec887ddbcc03..114e8fece340 100644 --- a/src/client/datascience/webViewHost.ts +++ b/src/client/datascience/webViewHost.ts @@ -170,6 +170,8 @@ export class WebViewHost implements IDisposable { extraSettings: { editorCursor: this.getValue(editor, 'cursorStyle', 'line'), editorCursorBlink: this.getValue(editor, 'cursorBlinking', 'blink'), + fontSize: this.getValue(editor, 'fontSize', 14), + fontFamily: this.getValue(editor, 'fontFamily', 'Consolas, \'Courier New\', monospace'), theme: theme }, intellisenseOptions: { @@ -240,6 +242,8 @@ export class WebViewHost implements IDisposable { // Post a message to our webpanel and update our new datascience settings private onPossibleSettingsChange = (event: ConfigurationChangeEvent) => { if (event.affectsConfiguration('workbench.colorTheme') || + event.affectsConfiguration('editor.fontSize') || + event.affectsConfiguration('editor.fontFamily') || event.affectsConfiguration('editor.cursorStyle') || event.affectsConfiguration('editor.cursorBlinking') || event.affectsConfiguration('python.dataScience.enableGather')) { diff --git a/src/datascience-ui/history-react/interactiveCell.tsx b/src/datascience-ui/history-react/interactiveCell.tsx index f00a13214649..e5ba31e99266 100644 --- a/src/datascience-ui/history-react/interactiveCell.tsx +++ b/src/datascience-ui/history-react/interactiveCell.tsx @@ -15,7 +15,7 @@ import { CollapseButton } from '../interactive-common/collapseButton'; import { ExecutionCount } from '../interactive-common/executionCount'; import { InformationMessages } from '../interactive-common/informationMessages'; import { InputHistory } from '../interactive-common/inputHistory'; -import { ICellViewModel } from '../interactive-common/mainState'; +import { ICellViewModel, IFont } from '../interactive-common/mainState'; import { IKeyboardEvent } from '../react-common/event'; import { getLocString } from '../react-common/locReactSide'; import { getSettings } from '../react-common/settingsReactSide'; @@ -39,6 +39,7 @@ interface IInteractiveCellProps { focusedCell?: string; hideOutput?: boolean; showLineNumbers?: boolean; + font: IFont; onCodeChange(changes: monacoEditor.editor.IModelContentChange[], cellId: string, modelId: string): void; onCodeCreated(code: string, file: string, cellId: string, modelId: string): void; openLink(uri: monacoEditor.Uri): void; @@ -211,6 +212,7 @@ export class InteractiveCell extends React.Component { unfocused={this.onCodeUnfocused} keyDown={this.props.keyDown} showLineNumbers={this.props.showLineNumbers} + font={this.props.font} /> ); } diff --git a/src/datascience-ui/history-react/interactivePanel.tsx b/src/datascience-ui/history-react/interactivePanel.tsx index 0d978809a73d..5038823a0730 100644 --- a/src/datascience-ui/history-react/interactivePanel.tsx +++ b/src/datascience-ui/history-react/interactivePanel.tsx @@ -67,6 +67,11 @@ export class InteractivePanel extends React.Component : undefined; @@ -77,7 +82,7 @@ export class InteractivePanel extends React.Component +