Repository navigation
Implement changing editing mode - #681
Conversation
5d55556 to
2a75980
Compare
|
Since both mappings are currently used for other operations, this feels like a breaking change. |
|
The original key mapping is different from Readline, so I believe few people use it. |
|
Just for information, GNU Bash source code comment also says it's confusing. /* In Bash, the user can switch editing modes with "set -o [vi emacs]",
so it is not necessary to allow C-M-j for context switching. Turn
off this occasionally confusing behaviour. */
...
if (func == rl_vi_editing_mode)
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
...
if (func == rl_vi_editing_mode)
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
...
if (func == rl_emacs_editing_mode)
rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap); |
2a75980 to
92ef148
Compare
| end | ||
|
|
||
| def test_vi_editing_mode | ||
| @line_editor.__send__(:vi_editing_mode, nil) |
There was a problem hiding this comment.
When key binding is set, key.char is passed as symbol to LineEditor#update.
I can't seem to test it properly with input_keys. If you have a better way to do this, please let me know.
I implemented Readline’s emacs-editing-mode (C-e) and vi-editing-mode (M-C-j, M-C-m) to switch editing modes. The keymap was aligned with Readline's behavior. But
M-C-mwas used in the yamatanooroti tests, so I decided not to map it.