File tree 2 files changed +8
-3
lines changed
Filter options
2 files changed +8
-3
lines changed
Original file line number Diff line number Diff line change @@ -177,9 +177,12 @@ def _parse_key1(key, s):
177
177
ret = key [s ]
178
178
s += 1
179
179
if ctrl :
180
- if len (ret ) > 1 :
181
- raise KeySpecError ("\\ C- must be followed by a character" )
182
- ret = chr (ord (ret ) & 0x1F ) # curses.ascii.ctrl()
180
+ if len (ret ) == 1 :
181
+ ret = chr (ord (ret ) & 0x1F ) # curses.ascii.ctrl()
182
+ elif ret in {"left" , "right" }:
183
+ ret = f"ctrl { ret } "
184
+ else :
185
+ raise KeySpecError ("\\ C- followed by invalid key" )
183
186
if meta :
184
187
ret = ["\033 " , ret ]
185
188
else :
Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ def make_default_commands() -> dict[CommandName, type[Command]]:
136
136
(r"\<up>" , "up" ),
137
137
(r"\<down>" , "down" ),
138
138
(r"\<left>" , "left" ),
139
+ (r"\C-\<left>" , "backward-word" ),
139
140
(r"\<right>" , "right" ),
141
+ (r"\C-\<right>" , "forward-word" ),
140
142
(r"\<delete>" , "delete" ),
141
143
(r"\<backspace>" , "backspace" ),
142
144
(r"\M-\<backspace>" , "backward-kill-word" ),
You can’t perform that action at this time.
0 commit comments