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.79k stars 3.15k forks source link

inconsistent selection with block cursor #20121

Open andrewbanchich opened 3 weeks ago

andrewbanchich commented 3 weeks ago

Check for existing issues

Describe the bug / provide steps to reproduce it

if i set the cursor shape to block and the current position is e.g.

fn |f|oo(self) {}

ctrl-right will produce

fn foo|(|self) {}

while ctrl-shift-right will produce

fn fo|o|(self) {}

the actual selection area for the latter is correct - cutting only removes foo. however, that's confusing for me because the behavior of the former command makes me think that the block cursor's current position is its left, but then when you're using it to select something the actual position is its right.

Environment

Zed: v0.159.7 (Zed) OS: Linux Wayland ubuntu 24.04 Memory: 30.7 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV GFX1103_R1) || radv || Mesa 24.0.9-0ubuntu0.2

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.

Zed.log


andrewbanchich commented 3 weeks ago

also, i just noticed that holding shift-right will not move the cursor at all the first time.