Skip to content

Vi-mode poor autosuggestion behavior / Invalid cursor placement and length in normal mode #10286

@johnpyp

Description

@johnpyp

fish, version 3.7.0
3.7.0
OS: Linux 6.6.14 NixOS (but happens on any OS)
Term: Kitty (but any terminal does this, over ssh, etc.)


In vi mode, I noticed an autocomplete issue, say you start here:
image

If you then press ESC to enter normal mode, then l to attempt to complete the autosuggestion, it doesn't work. You have to press l twice to complete.

It seems that the reason for this issue with the autosuggestion or the fact that ESC moves you back, but that vi mode lets you move your normal mode cursor to after the last character, which isn't actually a valid vi place to put the cursor (or a "non-extant character").

Then, when autosuggestion logic checks if you're at the last possible cursor position when you call forward-char with l, it should consider you at the last possible normal mode position, but instead it thinks that there is that one extra place for the cursor to be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions