zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.94k stars 3.16k forks source link

Select all matches not creating selections in VIM mode, not triggering Visual mode #14681

Open atahrijouti opened 4 months ago

atahrijouti commented 4 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

https://github.com/user-attachments/assets/6936595c-f12d-4a75-838f-9974dce296aa

Steps

Observation

If visual mode is entered after selecting all matches, then vim::Right a few times, one can observe that the from the start of the VISUAL mark to the cursor exists a different selected area from the highlighted matches. One could say that search highlight isn't the same thing as VISUAL selection as VIM would consider it.

Environment

Zed: v0.143.7 (Zed) (mingw-w64-ucrt-x86_64-zed) OS: Windows 10.0.19045 Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

CharlesChen0823 commented 4 months ago

IMO, select all matches should not switch_mode from normal to visual, if we want substitute, can using :%s/a/b/g to replace.

atahrijouti commented 4 months ago

vim::Substitute is but an example. The main issue is about the expectations of correlation between normal editor actions and vim mode. When you read Select all matches you expect it to select the matches and not just highlight them.

With Vim Mode inactive, Select all matches does select the all matches. Clicking on delete or backspace does remove all the matches and not just go backwards.

if we want substitute, can using :%s/a/b/g to replace.

The workflow you describe has these issues IMO