nushell / nushell/reedline

`Move(Big)WordRightEnd` is off-by-1 in insert mode

Open
#766 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ViKeybinding bug
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

Platform Linux (NixOS)
Terminal software Wezterm

Using nushell 0.91.0

Steps to reproduce

  1. 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}
     }
    
  2. Write this is some/cmd in nushell
  3. Put cursor on s of some, make sure you are in insert mode:
    this is |some/cmd
  4. Do Alt-e, cursor is now between m & e instead of between e & /:
    this is som|e/cmd
  5. Do Alt-E, cursor is now between m & d instead 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in nushell with the MoveWordRightEnd and MoveBigWordRightEnd keybindings, comparing vi insert mode with normal mode. Trace the implementations of these edit commands and their insert-mode handling; done means Alt-e stops after some and Alt-E reaches the end of some/cmd in insert mode while normal mode remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.