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
45.73k stars 2.52k forks source link

vim mode: Don't switch_mode when editor selection changed(not change by vim operator) #14622

Open CharlesChen0823 opened 1 month ago

CharlesChen0823 commented 1 month ago

Check for existing issues

Describe the feature

currently, in vim_mode, vim will switch_mode when editor selections changed(not change by vim operator). this will cause some wried behaviour, e.g. when using g l for search all, rename using menu.

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

No response

Congyuwang commented 1 month ago

I think like g l switching from NORMAL to VISUAL is necessary, and also when making selections, since you do not have selections in NORMAL mode. But I somehow do not like the switching to VISUAL when just mouse right clicking.

CharlesChen0823 commented 1 month ago

I cannot thinking which use case for g l switch normal mode to visual model? can you give me an example?

Congyuwang commented 1 month ago

Yeah you are probably right. You can also have multiple cursor in NORMAL model (which probably also work for g l), but just not range selection in NORMAL mode (like selecting a symbol), am I right?

Currently find-all (through cmd+f, and alt+enter) does keep NORMAL mode unchanged.

ConradIrwin commented 1 month ago

I have been thinking about making gl keep you in normal mode and just jump to the same position in the current word. That might be better (and more like how add cursor below work).

If you want to take a pass at this feel free (or pair with me on it https://calendly.com/conradirwin/pairing).