File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -1026,20 +1026,14 @@ class ToolHelpBase(ToolBase):
1026
1026
default_keymap = rcParams ['keymap.help' ]
1027
1027
image = 'help.png'
1028
1028
1029
-
1030
1029
@staticmethod
1031
- def format_shortcut (keysequence ):
1030
+ def format_shortcut (key_sequence ):
1032
1031
"""
1033
1032
Converts a shortcut string from the notation used in rc config to the
1034
1033
standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
1035
1034
"""
1036
- def repl (match ):
1037
- s = match .group (0 )
1038
- return 'Shift+' + s if len (
1039
- s ) == 1 and s .isupper () else s .capitalize ()
1040
- if len (keysequence ) == 1 :
1041
- return keysequence # do not modify single characters
1042
- return re .sub (r"\w{2,}|(?<=\+)\w" , repl , keysequence )
1035
+ return (key_sequence if len (key_sequence ) == 1 else
1036
+ re .sub (r"\+[A-Z]" , r"+Shift\g<0>" , key_sequence ).title ())
1043
1037
1044
1038
def _format_tool_keymap (self , name ):
1045
1039
keymaps = self .toolmanager .get_tool_keymap (name )
You can’t perform that action at this time.
0 commit comments