Add 'Ctrl-5' keyboard shortcut for 'strikethrough' #1987

A quick search revealed that 'Ctrl-5' is a popular shortcut
for strikethrough. Implemented in 'ace2_inner' and updated
the English l10n file for the tooltip.
This commit is contained in:
Prateek Saxena 2014-10-11 22:46:01 +05:30
parent 6ec55309a7
commit 001d75cd1e
2 changed files with 12 additions and 4 deletions

View File

@ -5,7 +5,7 @@
"pad.toolbar.bold.title": "Bold (Ctrl-B)",
"pad.toolbar.italic.title": "Italic (Ctrl-I)",
"pad.toolbar.underline.title": "Underline (Ctrl-U)",
"pad.toolbar.strikethrough.title": "Strikethrough",
"pad.toolbar.strikethrough.title": "Strikethrough (Ctrl-5)",
"pad.toolbar.ol.title": "Ordered list",
"pad.toolbar.ul.title": "Unordered List",
"pad.toolbar.indent.title": "Indent (TAB)",

View File

@ -3741,6 +3741,14 @@ function Ace2Inner(){
toggleAttributeOnSelection('underline');
specialHandled = true;
}
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "5" && (evt.metaKey || evt.ctrlKey))
{
// cmd-5 (strikethrough)
fastIncorp(13);
evt.preventDefault();
toggleAttributeOnSelection('strikethrough');
specialHandled = true;
}
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "h" && (evt.ctrlKey))
{
// cmd-H (backspace)