zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

Color retention of character block when deleting characters in visual mode

Open sashkachan opened this issue 3 years ago ā€¢ 2 comments

General information

Please report the following information as possible as you can:

  • Terminal program: kitty
  • Operating system: macOS
  • ZSH framework: -
  • ZSH version: 5.8
  • ZVM version: HEAD

Basic examination

  • [x] I have read through the README page
  • [x] I have the latest version of zsh-vi-mode
  • [x] I have tested with another terminal program

Problem description

Single visual selection character block retains visual selection colour. After the issue appears, the coloured block stays in the line regardless of any further movements / edits

Reproduction steps

  1. write a string: "string string string"
  2. esc - switch to normal mode
  3. v - visual mode
  4. b - move one word back
  5. x - delete selection
  6. i - switch to insert mode

Expected behavior

Visual mode selection colour should disappear.

Please see the image attached.

Screenshot 2022-01-22 at 13 33 41

sashkachan avatar Jan 22 '22 12:01 sashkachan

Putting the following in my .zshrc solved the above problem and similar problems I had when pressing ā€˜xā€™ to delete in visual mode.

function zvm_after_lazy_keybindings() {
  bindkey -M visual 'x' zvm_vi_delete
}

Being not very experienced with ZSH or this plugin, I do not know if this is a proper solution, but before I made the above change I noticed that ā€˜dā€™ and ā€˜xā€™ had different key bindings in visual mode:

% bindkey -M visual d
"d" zvm_vi_delete
% bindkey -M visual x
"x" vi-delete

I do not know whether this was due to a mistake in my configuration or whether this should be considered a bug in zsh-vi-mode.

anderslundstedt avatar Sep 10 '22 00:09 anderslundstedt

Hi @sasha-glv

Thanks for your issue, and sorry for the late reply. Could you try again with the HEAD version, and let's see if this issue has been fixed or not?

Thanks & Regards

jeffreytse avatar Jul 24 '23 06:07 jeffreytse