X.Prompt: Alias C-m to RET in Emacs/Vim bindings

Both programs interpret C-m as RET, so the prompt should reflect this as
well.
This commit is contained in:
Tony Zorman 2023-03-29 08:24:25 +02:00
parent fb63987ac8
commit f127f71c91
2 changed files with 9 additions and 0 deletions

View File

@ -210,6 +210,11 @@
- Changed `addDescrKeys` and `addDescrKeys'` to not discard the
keybindings in the current config.
* `XMonad.Prompt`
- The `emacsLikeXPKeymap` and `vimLikeXPKeymap` keymaps now treat
`C-m` the same as `Return`.
### Other changes
## 0.17.1 (September 3, 2022)

View File

@ -1009,6 +1009,7 @@ emacsLikeXPKeymap' p = M.fromList $
, (xK_g, quit)
, (xK_bracketleft, quit)
, (xK_t, transposeChars)
, (xK_m, acceptSelection)
] ++
map (first $ (,) mod1Mask) -- meta key + <key>
[ (xK_BackSpace, killWord' p Prev)
@ -1058,6 +1059,9 @@ vimLikeXPKeymap' :: (XPColor -> XPColor)
-- alternates.
-> M.Map (KeyMask,KeySym) (XP ())
vimLikeXPKeymap' fromColor promptF pasteFilter notWord = M.fromList $
map (first $ (,) controlMask) -- control + <key>
[ (xK_m, acceptSelection)
] ++
map (first $ (,) 0)
[ (xK_Return, acceptSelection)
, (xK_KP_Enter, acceptSelection)