evil-helix icon indicating copy to clipboard operation
evil-helix copied to clipboard

c in visual mode doesn’t change the selection

Open dnaq opened this issue 1 year ago • 4 comments

Summary

Selecting a word in visual mode and then hitting c does not immediately delete the selection and switch to insert mode, instead it acts like c in normal mode, waiting for a movement to be entered.

Reproduction Steps

I tried this:

  1. hx
  2. Select any word in visual mode
  3. Hit c

I expected this to happen:

That the selection immediately be deleted, and the mode switched to insert mode.

Instead, this happened:

The c command from normal mode

Helix log

No response

Platform

Linux

Terminal Emulator

tmux

Installation Method

flake

Helix Version

2dc286a

dnaq avatar Jul 06 '24 17:07 dnaq

Thank you for reporting this issue. I did not manage to reproduce it, however. c in visual mode immediately clears the selection and switches to insert mode. I did try it in a few different environments and on nix-darwin, but didn't notice anything unusual.

I haven't tried it with the flake though, I wonder if you're getting upstream helix binaries from cachix...

Mind checking if the problem persists with a different installation method? Maybe nix-shell -p evil-helix if you have an up-to-date unstable channel?

usagi-flow avatar Jul 10 '24 15:07 usagi-flow

Sorry for that, my bug report was lacking detail. This only seems to happen when making a selection using helix quickjump feature (gw), so selecting a word with gw and then pressing c seems to reproduce the issue.

dnaq avatar Jul 10 '24 17:07 dnaq

Oh, I see now; when you initiate a jump while in normal mode, it'll perform a selection, but stay in normal mode, which in turn results in the behavior you described. I'll have to vimify gw.

usagi-flow avatar Jul 10 '24 20:07 usagi-flow

Same thing happens when using object motion to select:

For example, text is:

word1 'word2' word3

And I want to change word2 inside the quotes.

The c works after selecting with vw but doesn't work after selecting with mi'.

mmoya avatar Jan 13 '25 14:01 mmoya