mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Merge pull request #6737 from atom/iz-fix-accelerators
Tweak how + and - keys are handled when constructing menu keystrokes
This commit is contained in:
@@ -162,8 +162,8 @@ class ApplicationMenu
|
||||
firstKeystroke = keystrokesByCommand[command]?[0]
|
||||
return null unless firstKeystroke
|
||||
|
||||
modifiers = firstKeystroke.split('-')
|
||||
key = modifiers.pop()
|
||||
modifiers = firstKeystroke.split(/-(?=.)/)
|
||||
key = modifiers.pop().toUpperCase().replace('+', 'Plus')
|
||||
|
||||
modifiers = modifiers.map (modifier) ->
|
||||
modifier.replace(/shift/ig, "Shift")
|
||||
@@ -171,5 +171,5 @@ class ApplicationMenu
|
||||
.replace(/ctrl/ig, "Ctrl")
|
||||
.replace(/alt/ig, "Alt")
|
||||
|
||||
keys = modifiers.concat([key.toUpperCase()])
|
||||
keys = modifiers.concat([key])
|
||||
keys.join("+")
|
||||
|
||||
Reference in New Issue
Block a user