zed icon indicating copy to clipboard operation
zed copied to clipboard

Multiple cursors are dependent on direction of selection

Open trifle opened this issue 10 months ago • 1 comments

Hi, thanks for making ZED.

Today I ran across a pretty obvious problem with multiple selections. To reproduce:

  1. Place cursor at end of one expression (e.g. self.title)
  2. select entire expression with shift-left (or shift-alt-left)
  3. press cmd-d to select next match

Now we have two selections, but the cursors are at opposite ends: The cursor for the initial selection is now (logically) at the beginning of the expression. The cursor for the second match is placed at the end of the expression.

From an implementation point of view, that might make sense. But it's very cumbersome for actual use: It's now almost impossible to consistently navigate across these multiple selections. For example, moving all cursors to remove the "self" or to change the "title" in self.title requires a jump to the beginning/end of the line followed by navigating token by token.

So, it's not a dealbreaker but irritating once realized :)

trifle avatar Apr 17 '25 15:04 trifle

Yep, sounds annoying and is definitely a bug not a feature. Thanks for reporting!

probably-neb avatar May 06 '25 14:05 probably-neb

Hey @trifle, looks like this PR:

  • https://github.com/zed-industries/zed/pull/29293

... fixed the issue, so I'm going to close this out. Thanks for reporting this to us.

JosephTLyons avatar May 30 '25 17:05 JosephTLyons

Awesome, I can confirm that this now works consistently. Thanks!

trifle avatar May 30 '25 18:05 trifle