zed icon indicating copy to clipboard operation
zed copied to clipboard

inconsistent selection with block cursor

Open andrewbanchich opened this issue 1 year ago • 4 comments

Check for existing issues

  • [X] Completed

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 avatar Nov 03 '24 00:11 andrewbanchich

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

andrewbanchich avatar Nov 03 '24 00:11 andrewbanchich

Yes, the simpler explanation here is that the block cursor is incorrectly placed when multiple things are selected:

Screenshot 2024-12-29 at 3 53 33 PM

vs the default cursor shape:

Screenshot 2024-12-29 at 3 53 52 PM

When we do a shift-right, the selection DOES correctly update, but the cursor doesn't actually move in Block mode. You can verify that the selection does update by doing shift-right and then backspace -- this will delete the character as you'd expect.

As well, I can confirm that this is platform independent

sanbox-irl avatar Dec 29 '24 20:12 sanbox-irl

This issue should be closed in favor of #18588 which is the same issue but with more conversation on it

sanbox-irl avatar Jan 03 '25 00:01 sanbox-irl

@sanbox-irl this is a different issue - this issue is about the visualization of the block. the selection is correct.

the issue you linked is about deleting too many characters. also, it's been closed since that has been fixed and this has not been.

andrewbanchich avatar May 16 '25 01:05 andrewbanchich

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!

github-actions[bot] avatar Sep 17 '25 07:09 github-actions[bot]

Still happening.

andrewbanchich avatar Sep 17 '25 10:09 andrewbanchich