1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Add "duplicate line" command in Markdown editor (#4873)

Ref: https://discourse.joplinapp.org/t/duplicate-line-command/12650/15
This commit is contained in:
Caleb John 2021-04-25 02:57:35 -06:00 committed by GitHub
parent f87ff54e3d
commit b1ea3f3ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -596,6 +596,7 @@ function useMenu(props: Props) {
menuItemDic.attachFile,
separator(),
menuItemDic['editor.deleteLine'],
menuItemDic['editor.duplicateLine'],
menuItemDic['editor.toggleComment'],
menuItemDic['editor.sortSelectedLines'],
menuItemDic['editor.indentLess'],

View File

@ -87,6 +87,10 @@ const declarations: CommandDeclaration[] = [
name: 'editor.deleteLine',
label: () => _('Delete line'),
},
{
name: 'editor.duplicateLine',
label: () => _('Duplicate line'),
},
{
name: 'editor.undo',
label: () => _('Undo'),

View File

@ -35,6 +35,7 @@ export default function() {
'toggleSideBar',
'toggleVisiblePanes',
'editor.deleteLine',
'editor.duplicateLine',
'editor.undo',
'editor.redo',
'editor.indentLess',

View File

@ -46,6 +46,7 @@ const defaultKeymapItems = {
{ accelerator: 'Shift+Cmd+P', command: 'commandPalette' },
{ accelerator: 'F1', command: 'help' },
{ accelerator: 'Cmd+D', command: 'editor.deleteLine' },
{ accelerator: 'Shift+Cmd+D', command: 'editor.duplicateLine' },
{ accelerator: 'Cmd+Z', command: 'editor.undo' },
{ accelerator: 'Cmd+Y', command: 'editor.redo' },
{ accelerator: 'Cmd+[', command: 'editor.indentLess' },
@ -87,6 +88,7 @@ const defaultKeymapItems = {
{ accelerator: 'Ctrl+Shift+P', command: 'commandPalette' },
{ accelerator: 'F1', command: 'help' },
{ accelerator: 'Ctrl+D', command: 'editor.deleteLine' },
{ accelerator: 'Shift+Ctrl+D', command: 'editor.duplicateLine' },
{ accelerator: 'Ctrl+Z', command: 'editor.undo' },
{ accelerator: 'Ctrl+Y', command: 'editor.redo' },
{ accelerator: 'Ctrl+[', command: 'editor.indentLess' },