From b21f84459223bb7b3be959ffe264ed4d48d5fcf8 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 4 Apr 2019 12:41:24 +0200 Subject: [PATCH] added ctrl +- to editor --- src/app/editor/editor.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 797304dfcf..83fd681783 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -101,6 +101,35 @@ class Editor { // Unmap ctrl-t & ctrl-f this.editor.commands.bindKeys({ 'ctrl-t': null }) + + // shortcuts for "Ctrl-"" and "Ctrl+"" to increase/decrease font size of the editor + this.editor.commands.addCommand({ + name: 'increasefontsizeEqual', + bindKey: {win: 'Ctrl-=', mac: 'Command-='}, + exec: (editor) => { + this.editorFontSize(1) + }, + readOnly: true + }) + + this.editor.commands.addCommand({ + name: 'increasefontsizePlus', + bindKey: {win: 'Ctrl-+', mac: 'Command-+'}, + exec: (editor) => { + this.editorFontSize(1) + }, + readOnly: true + }) + + this.editor.commands.addCommand({ + name: 'decreasefontsize', + bindKey: {win: 'Ctrl--', mac: 'Command--'}, + exec: (editor) => { + this.editorFontSize(-1) + }, + readOnly: true + }) + this.editor.setShowPrintMargin(false) this.editor.resize(true)