diff --git a/src/editor.js b/src/editor.js index 79a4bd5..3249418 100644 --- a/src/editor.js +++ b/src/editor.js @@ -393,7 +393,8 @@ amdRequire(["vs/editor/editor.main"], function () { automaticLayout: true, readOnly: true, folding: false, - fontFamily: "Consolas, 'SF Mono', Menlo, 'Lucida Console', 'Courier New', monospace", + fontFamily: config.general.fontFamily, + fontSize: config.general.fontSize, overviewRulerBorder: false, scrollBeyondLastLine: false, smoothScrolling: true, @@ -478,6 +479,24 @@ document.getElementById("clear-btn").onclick = () => { editor.getModel().setValue(value); }; +document.getElementById("editor-font-family").onblur = (e) => { + let font = e.target.value.trim(); + + if (font === "") + font = + "Consolas, 'SF Mono', Menlo, 'Lucida Console', 'Courier New', monospace"; + editor.updateOptions({ fontFamily: font }); + configUpdate("general.fontFamily", font); +}; + +document.getElementById("editor-font-size").onblur = (e) => { + let size = e.target.value.trim(); + if (size === "") size = 12; + + editor.updateOptions({ fontSize: size }); + configUpdate("general.fontSize", size); +}; + document.getElementById("breakpoint-switch").onclick = (e) => { if (e.target.checked === true) { if (config.advance.breakpoint.onText.length === 0) { diff --git a/src/index.html b/src/index.html index 5cfc38b..bd27841 100755 --- a/src/index.html +++ b/src/index.html @@ -63,12 +63,12 @@
Hex Mode
Timestamp
Modem Signal
Customized Baud Rate