diff --git a/js/contextMenus.js b/js/contextMenus.js index 96da445a55b..50e3c2555bc 100644 --- a/js/contextMenus.js +++ b/js/contextMenus.js @@ -642,7 +642,7 @@ function getMisspelledSuggestions (selection, isMisspelled, suggestions) { return menuUtil.sanitizeTemplateItems(template) } -function getEditableItems (selection, editFlags) { +function getEditableItems (selection, editFlags, hasFormat) { const hasSelection = selection.length > 0 const hasClipboard = clipboard.readText().length > 0 const template = [] @@ -670,6 +670,16 @@ function getEditableItems (selection, editFlags) { enabled: hasClipboard, role: 'paste' }) + if (hasFormat) { + template.push({ + label: locale.translation('pasteWithoutFormatting'), + accelerator: 'Shift+CmdOrCtrl+V', + enabled: hasClipboard, + click: function (item, focusedWindow) { + focusedWindow.webContents.pasteAndMatchStyle() + } + }) + } } return menuUtil.sanitizeTemplateItems(template) } @@ -999,7 +1009,7 @@ function mainTemplateInit (nodeProps, frame, tab) { } } - const editableItems = getEditableItems(nodeProps.selectionText, nodeProps.editFlags) + const editableItems = getEditableItems(nodeProps.selectionText, nodeProps.editFlags, true) template.push(...misspelledSuggestions, { label: locale.translation('undo'), accelerator: 'CmdOrCtrl+Z',