Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middle Click + Drag Multicursor #11990

Closed
1 task done
donatj opened this issue May 17, 2024 · 7 comments · Fixed by #12005
Closed
1 task done

Middle Click + Drag Multicursor #11990

donatj opened this issue May 17, 2024 · 7 comments · Fixed by #12005
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] mouse interaction Feedback for mouse interaction states, actions, etc

Comments

@donatj
Copy link

donatj commented May 17, 2024

Check for existing issues

  • Completed

Describe the feature

I would really like it if middle click + drag was added for creating multiple cursors and multiline selections similar to how Sublime, VSCode and Intellij editors do so.

I was frankly kind of surprised I couldn't find a feature request for it.

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

Here's a little video of it working in Sublime Text

Screen.Recording.2024-05-17.at.1.26.54.PM.mov-slow-20240517-132826.mp4
@donatj donatj added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels May 17, 2024
@mikayla-maki
Copy link
Contributor

mikayla-maki commented May 17, 2024

Interesting, so it acts like a drag but each new line becomes it's own multi cursor...

Well, not quite a drag, as it doesn't extend a specific line's selection if the cursor moves vertically, only when it moves horizontally, but something like that.

@donatj
Copy link
Author

donatj commented May 17, 2024

Yep. It's kind of similar to selecting a box of text by holding down alt and dragging in Terminal.app except each selected line gets its own cursor on whatever side the drag ended

Terminal Dragging right to left Dragging left to right
image image image

@mikayla-maki
Copy link
Contributor

Ahh! This feature already exists, under alt-shift-left-mouse-drag. I'll see about adding a middle click binding for it :)

mikayla-maki added a commit that referenced this issue May 18, 2024
fixes #11990

Release Notes:

- Changed middle mouse down to trigger a columnar selection, creating a
rectangle of multi cursors over a dragged region.
([#11990](#11990))
@donatj
Copy link
Author

donatj commented May 18, 2024

Dang that was FAST! Thank you so much!

@JosephTLyons JosephTLyons added mouse interaction Feedback for mouse interaction states, actions, etc editor Feedback for code editing, formatting, editor iterations, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 18, 2024
osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this issue May 18, 2024
…ies#12005)

fixes zed-industries#11990

Release Notes:

- Changed middle mouse down to trigger a columnar selection, creating a
rectangle of multi cursors over a dragged region.
([zed-industries#11990](zed-industries#11990))
@cisoun
Copy link

cisoun commented May 23, 2024

Hi! First, thanks for the feature!

I've just noticed the selection has to be made in weird way though. To make it work, this is what I have to do:

  1. Middle click and release
  2. Left click and drag

My expectation was: middle click -> drag

Is this intended?

Zed preview 0.137.0, MacOS

@major-hmhco
Copy link

major-hmhco commented May 23, 2024

I am also observing a similar issue - simply middle-clicking and dragging does not activate multicursor select; I have to hold middle-click then left-click/drag then release middle-click to get a multicursor selection. It's almost as though middle-click has been bound to the Opt+Shift part of the "standard" keybind

I also experience strange behaviour in a multi-pane editor environment - when selecting a block in pane A, pane B also appears to see selection/highlighting. When I change focus to the second pane (using keyboard shortcuts) I find that the second pane's selection is carried over from the first pane, rather than staying where it was before interaction. This behaviour does not seem to present with the "standard" Opt+Shift+LClickDrag binds. It seems as though all middle-click operations affect both panes and not just the one being interacted with.

Zed preview 0.137.0, MacOS 12.7.4, 2021 MBP w/ M1 Pro

@CurbaiCode
Copy link

I am also experiencing a strange behavior. If I open a new file and alt-shift-left-mouse-drag, it acts as if the starting position for the command is the beginning of the file (the default new cursor location) and not at the location the mouse was at when the command was called.

Zed: v0.137.5 (Zed)
OS: macOS 12.6.6
Memory: 16 GiB
Architecture: x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] mouse interaction Feedback for mouse interaction states, actions, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants