Skip to content

Commit

Permalink
use cmd key for mac shortcuts, fix #101
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilgamesh Athoraya authored and Gilgamesh Athoraya committed Mar 7, 2017
1 parent 52064a3 commit 70ef64b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/cmds.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//Some of the codes are inherited from Dyalog's old IDE (see ../docs/cmd-codes.txt and near the end of km.js)
//Others were made up for RIDE's purposes - those use no fewer than three letters.
'use strict'
D.cmds=[
D.buildCmds=function(){
return [
//code description default keys
['ABT','About', ['Shift-F1']],
['AC', 'Align comments', []],
Expand Down Expand Up @@ -47,7 +48,7 @@ D.cmds=[
['PF12','', []],
['PRF','Show preferences', []],
['PV' ,'Previous match', []],
['QIT','Quit', ['Ctrl-Q']],
['QIT','Quit', (D.mac?['Cmd-Q']:[]).concat('Ctrl-Q')],
['QT', 'Quit (and lose changes)', ['Shift-Esc']],
['RD', 'Reformat', ['NumpadDivide']],
['RP', 'Replace', []],
Expand All @@ -64,7 +65,8 @@ D.cmds=[
['WI', 'Weak interrupt', ['Ctrl-Pause']],
['WSE','Toggle workspace explorer',[]],
['ZM', 'Toggle maximise editor', []],
['ZMI','Increase font size', ['Ctrl-=','Shift-Ctrl-='].concat(D.mac?['Cmd-=','Shift-Cmd-=']:[])],
['ZMO','Decrease font size', ['Ctrl--'].concat(D.mac?'Cmd--':[])],
['ZMR','Reset font size', ['Ctrl-0'].concat(D.mac?'Cmd-0':[])]
['ZMI','Increase font size', (D.mac?['Cmd-=','Shift-Cmd-=']:[]).concat(['Ctrl-=','Shift-Ctrl-='])],
['ZMO','Decrease font size', (D.mac?['Cmd--']:[]).concat('Ctrl--')],
['ZMR','Reset font size', (D.mac?['Cmd-0']:[]).concat('Ctrl-0')]
]
}
2 changes: 1 addition & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(typeof node_require!=='undefined'){
D=$.extend(D,node_require('electron').remote.getGlobal('D'))
var plt=process.platform;D.win=/^win/i.test(plt);D.mac=plt==='darwin'
}

D.cmds=D.buildCmds()
var a=document.querySelectorAll('[id]')
for(var i=0;i<a.length;i++){var e=a[i],s=e.id,j=s.indexOf('_');I[s]=e;
if(j>=0){var u=s.slice(0,j),v=s.slice(j+1);(J[u]=J[u]||{})[v]=e}}
Expand Down

0 comments on commit 70ef64b

Please sign in to comment.