Use 'evt.shiftKey' instead of matching 'charCodes'

The shortcut wasn't running consistently and was blocking
'Cmd+L' on Chrome 38. Instead of going to the location bar
it would tooggle the list. Strangely, it did not override
'Cmd+N'. Using `evt.shiftKey` instead of matching the `charCode`
to the uppercase letter solves the problem.
pull/2271/head
Prateek Saxena 2014-10-14 18:36:26 +05:30
parent 68c805070a
commit 6f5f89bc6b
1 changed files with 2 additions and 2 deletions

View File

@ -3749,7 +3749,7 @@ function Ace2Inner(){
toggleAttributeOnSelection('strikethrough'); toggleAttributeOnSelection('strikethrough');
specialHandled = true; specialHandled = true;
} }
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "L" && (evt.metaKey || evt.ctrlKey)) if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "l" && (evt.metaKey || evt.ctrlKey) && evt.shiftKey)
{ {
// cmd-shift-L (unorderedlist) // cmd-shift-L (unorderedlist)
fastIncorp(9); fastIncorp(9);
@ -3757,7 +3757,7 @@ function Ace2Inner(){
doInsertUnorderedList() doInsertUnorderedList()
specialHandled = true; specialHandled = true;
} }
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "N" && (evt.metaKey || evt.ctrlKey)) if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "n" && (evt.metaKey || evt.ctrlKey) && evt.shiftKey)
{ {
// cmd-shift-N (orderedlist) // cmd-shift-N (orderedlist)
fastIncorp(9); fastIncorp(9);