File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 11import fsOperation from "fileSystem" ;
22import actions from "handlers/quickTools" ;
33import keyBindings from "lib/keyBindings" ;
4+ import settings from "lib/settings" ;
45import Url from "utils/Url" ;
56
67const commands = [
@@ -266,6 +267,26 @@ const commands = [
266267 acode . exec ( "open-log-file" ) ;
267268 } ,
268269 } ,
270+ {
271+ name : "increaseFontSize" ,
272+ description : "Increase font size" ,
273+ exec ( editor ) {
274+ let size = Number . parseInt ( editor . getFontSize ( ) , 10 ) || 12 ;
275+ editor . setFontSize ( size + 1 ) ;
276+ settings . value . fontSize = size + 1 + "px" ;
277+ settings . update ( false ) ;
278+ } ,
279+ } ,
280+ {
281+ name : "decreaseFontSize" ,
282+ description : "Decrease font size" ,
283+ exec ( editor ) {
284+ let size = Number . parseInt ( editor . getFontSize ( ) , 10 ) || 12 ;
285+ editor . setFontSize ( Math . max ( size - 1 || 1 ) ) ;
286+ settings . value . fontSize = Math . max ( size - 1 || 1 ) + "px" ;
287+ settings . update ( false ) ;
288+ } ,
289+ } ,
269290] ;
270291
271292export function setCommands ( editor ) {
Original file line number Diff line number Diff line change @@ -580,14 +580,14 @@ export default {
580580 } ,
581581 increaseFontSize : {
582582 description : "Increase font size" ,
583- bindKey : "Ctrl-+" ,
583+ key : "Ctrl-+|Ctrl-= " ,
584584 } ,
585585 decreaseFontSize : {
586586 description : "Decrease font size" ,
587- bindKey : "Ctrl+-" ,
587+ key : "Ctrl+-|Ctrl-_ " ,
588588 } ,
589589 resetFontSize : {
590590 description : "Reset font size" ,
591- bindKey : "Ctrl+0|Ctrl-Numpad0" ,
591+ key : "Ctrl+0|Ctrl-Numpad0" ,
592592 } ,
593593} ;
You can’t perform that action at this time.
0 commit comments