diff --git a/ElectronClient/app/app.js b/ElectronClient/app/app.js index 42ed6f9090..e76e2250df 100644 --- a/ElectronClient/app/app.js +++ b/ElectronClient/app/app.js @@ -668,6 +668,16 @@ class Application extends BaseApplication { name: 'textLink', }); }, + }, { + label: _('Code'), + screens: ['Main'], + accelerator: 'CommandOrControl+`', + click: () => { + this.dispatch({ + type: 'WINDOW_COMMAND', + name: 'textCode', + }); + }, }, { type: 'separator', screens: ['Main'], diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index caa3cb1e73..cef4293455 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -896,9 +896,6 @@ class NoteTextComponent extends React.Component { } return output; } - - //fixes #1426 but this is an Ace issue, so it can be removed if ace/brace is updated. - this.editor_.editor.getSession().getMode().$quotes = {'"': '"', "'": "'", "`": "`"}; // Disable Markdown auto-completion (eg. auto-adding a dash after a line with a dash. // https://github.com/ajaxorg/ace/issues/2754 @@ -1022,6 +1019,8 @@ class NoteTextComponent extends React.Component { fn = this.commandStartExternalEditing; } else if (command.name === 'showLocalSearch') { fn = this.commandShowLocalSearch; + } else if (command.name === 'textCode') { + fn = this.commandTextCode; } }