reedline
reedline copied to clipboard
`Move(Big)WordRightEnd` is off-by-1 in insert mode
Platform Linux (NixOS) Terminal software Wezterm
Using nushell 0.91.0
Steps to reproduce
- In your nushell config, setup a keybind with:
{ name: move_to_end_word mode: [emacs vi_insert vi_normal] modifier: Alt keycode: Char_e event: {edit: MoveWordRightEnd} } { name: move_to_end_WORD mode: [emacs vi_insert vi_normal] modifier: Alt_Shift keycode: Char_E event: {edit: MoveBigWordRightEnd} } - Write
this is some/cmdin nushell - Put cursor on
sofsome, make sure you are in insert mode:this is |some/cmd - Do
Alt-e, cursor is now betweenm&einstead of betweene&/:this is som|e/cmd - Do
Alt-E, cursor is now betweenm&dinstead of at the end of the input buffer:this is some/cm|d
Note that normal mode works okay, only insert mode isn't working correctly.
Screenshots/Screencaptures
https://github.com/nushell/reedline/assets/9730330/e722ee81-df56-4c77-9ca4-6a6fa898df8d
Good catch!
This is another case where our vi emulation breaks down.
The Editor/LineBuffer don't know anything about the Vi mode and just get EditCommands we emit in the emulation layer.
The word moves where designed with the cursor position reflecting the normal mode but the shifted cursor in insert mode was not taken into account (see also the recent #699 )