1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Desktop: Added menu item to format inline code (#1641)

* Revert "Fix for #1426, aded backticks to auto-wrapping quotes."

This reverts commit 7dee93076a.

* changes to backtick behavior

- add shortcut ``` cmd+` ``` / ``` ctrl+` ```
- add menu item for `Inline code`

* rename menu item Inline Code -> Code
This commit is contained in:
Helmut K. C. Tessarek
2019-06-10 03:05:20 -04:00
committed by Laurent Cozic
parent 2cf1cda128
commit 3fafda9684
2 changed files with 12 additions and 3 deletions

View File

@@ -668,6 +668,16 @@ class Application extends BaseApplication {
name: 'textLink', name: 'textLink',
}); });
}, },
}, {
label: _('Code'),
screens: ['Main'],
accelerator: 'CommandOrControl+`',
click: () => {
this.dispatch({
type: 'WINDOW_COMMAND',
name: 'textCode',
});
},
}, { }, {
type: 'separator', type: 'separator',
screens: ['Main'], screens: ['Main'],

View File

@@ -896,9 +896,6 @@ class NoteTextComponent extends React.Component {
} }
return output; 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. // Disable Markdown auto-completion (eg. auto-adding a dash after a line with a dash.
// https://github.com/ajaxorg/ace/issues/2754 // https://github.com/ajaxorg/ace/issues/2754
@@ -1022,6 +1019,8 @@ class NoteTextComponent extends React.Component {
fn = this.commandStartExternalEditing; fn = this.commandStartExternalEditing;
} else if (command.name === 'showLocalSearch') { } else if (command.name === 'showLocalSearch') {
fn = this.commandShowLocalSearch; fn = this.commandShowLocalSearch;
} else if (command.name === 'textCode') {
fn = this.commandTextCode;
} }
} }