Skip to content

lightspeed intercepts the first <BS> during a change operation after a jump #140

@TheBlob42

Description

@TheBlob42

After jumping via <Plug>Lightspeed_s, <Plug>Lightspeed_S, <Plug>Lightspeed_omni_s, <Plug>Lightspeed_gs, <Plug>Lightspeed_gS or <Plug>Lightspeed_omni_gs and calling a change operation (e.g. cw) lightspeed will intercept the first <BS> that I press. Afterwards everything works fine. Even if move the cursor after the jump via h or l the next change is still affected. But when I move the cursor after the jump with w, e, b or so the next change works fine.

Here is an example to better illustrate the issue (minimal config, only lightspeed installed and no further configuration):

  1. open nvim, enter insert mode and type some text (| is the cursor)
this is just some text for demonstration|
  1. press <esc> to go back to normal mode and jump to the word "some" by pressing Sso
this is just |some text for demonstration
  1. start changing text by pressing ce to delete the word "some" and insert some alternative
this is just yeah| text for demonstration
  1. press backspace and realize that nothing happens
this is just yeah| text for demonstration
  1. press backspace again, now the character before the cursor gets deleted properly, from now on backspace works fine again

From my own testing it only happens for the two character jump commands and only in combination with changing text. Deleting something after the jump and then entering insert mode does not show the described behavior.

I had a brief look in the source code and could see that you are handling the change operator and backspace in some cases, but from my short read I did not understand for what reason and if this could be the cause for this minor bug here. But maybe it is rather obvious for you why this is happening and if it could be avoided easily 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions