1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

PR fixes and cleanup

Signed-off-by: DMYTRO ZHARKOV <dmytrozharkov@DMYTROs-MBP.fritz.box>
This commit is contained in:
DMYTRO ZHARKOV 2022-01-17 09:52:21 +01:00
parent a249515b85
commit 0cfb8f0c75
3 changed files with 10 additions and 9 deletions

View File

@ -10,7 +10,7 @@ import { getAppVersion, ObservableToggleSet } from "../utils";
import type { editor } from "monaco-editor"; import type { editor } from "monaco-editor";
import merge from "lodash/merge"; import merge from "lodash/merge";
import { SemVer } from "semver"; import { SemVer } from "semver";
import { defaultTheme, defaultFontFamily, defaultFontSize } from "../vars"; import { defaultTheme, defaultEditorFontFamily, defaultFontSize } from "../vars";
export interface KubeconfigSyncEntry extends KubeconfigSyncValue { export interface KubeconfigSyncEntry extends KubeconfigSyncValue {
filePath: string; filePath: string;
@ -25,8 +25,8 @@ export type EditorConfiguration = Pick<editor.IStandaloneEditorConstructionOptio
export const defaultEditorConfig: EditorConfiguration = { export const defaultEditorConfig: EditorConfiguration = {
tabSize: 2, tabSize: 2,
lineNumbers: "on", lineNumbers: "on",
fontSize: 12, fontSize: defaultFontSize,
fontFamily: defaultFontFamily, fontFamily: defaultEditorFontFamily,
minimap: { minimap: {
enabled: true, enabled: true,
side: "right", side: "right",
@ -194,7 +194,7 @@ const terminalFontSize: PreferenceDescription<number | undefined> = {
}, },
toStore(val) { toStore(val) {
if (!val) { if (!val) {
return defaultFontSize; return undefined;
} }
return val; return val;
@ -207,7 +207,7 @@ const terminalFontFamily: PreferenceDescription<string | undefined> = {
}, },
toStore(val) { toStore(val) {
if (!val) { if (!val) {
return defaultFontFamily; return undefined;
} }
return val; return val;

View File

@ -26,8 +26,9 @@ export const productName = packageInfo.productName;
export const appName = `${packageInfo.productName}${isDevelopment ? "Dev" : ""}`; export const appName = `${packageInfo.productName}${isDevelopment ? "Dev" : ""}`;
export const publicPath = "/build/" as string; export const publicPath = "/build/" as string;
export const defaultTheme = "lens-dark" as string; export const defaultTheme = "lens-dark" as string;
export const defaultFontSize = 13; export const defaultFontSize = 12;
export const defaultFontFamily = "RobotoMono"; export const defaultTerminalFontFamily = "RobotoMono";
export const defaultEditorFontFamily = "RobotoMono";
// Webpack build paths // Webpack build paths
export const contextDir = process.cwd(); export const contextDir = process.cwd();

View File

@ -11,7 +11,7 @@ import type { DockStore, TabId } from "../dock-store/dock.store";
import { TerminalApi, TerminalChannels } from "../../../api/terminal-api"; import { TerminalApi, TerminalChannels } from "../../../api/terminal-api";
import { ThemeStore } from "../../../theme.store"; import { ThemeStore } from "../../../theme.store";
import { disposer } from "../../../utils"; import { disposer } from "../../../utils";
import { isMac, defaultFontFamily, defaultFontSize } from "../../../../common/vars"; import { isMac, defaultTerminalFontFamily, defaultFontSize} from "../../../../common/vars";
import { once } from "lodash"; import { once } from "lodash";
import { UserStore } from "../../../../common/user-store"; import { UserStore } from "../../../../common/user-store";
import { clipboard } from "electron"; import { clipboard } from "electron";
@ -38,7 +38,7 @@ export class Terminal {
cursorBlink: true, cursorBlink: true,
cursorStyle: "bar", cursorStyle: "bar",
fontSize: UserStore.getInstance().terminalFontSize || defaultFontSize, fontSize: UserStore.getInstance().terminalFontSize || defaultFontSize,
fontFamily: UserStore.getInstance().terminalFontFamily || defaultFontFamily, fontFamily: UserStore.getInstance().terminalFontFamily || defaultTerminalFontFamily,
}); });
private readonly fitAddon = new FitAddon(); private readonly fitAddon = new FitAddon();
private scrollPos = 0; private scrollPos = 0;