eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
37 stars 92 forks source link

Cursor multi-select doesn't work with Ctrl+Shift when JDT "smart caret" feature is enabled #1323

Open zhro opened 7 months ago

zhro commented 7 months ago

The Eclipse multi-select feature breaks and drops back to single-cursor mode when using Ctrl+Shift with the "smart caret" feature enabled. This makes it largely useless, because I want to select either the whole variables or camel case portions at a time, not just a single character.

See here for an example video:

https://www.youtube.com/watch?v=lq-8kfnj8Ic

I am using the key bind "Multi selection down relative to anchor selection" to make my selection, placing the cursor on the right side of the variable, and then Ctrl+Shift+Left Arrow to try and select a larger portion of the variable. This drops back to single-cursor, instead of selecting across all cursors, as expected.

mickaelistria commented 7 months ago

Thanks. Would you be interested in trying to provide a PR that fixes it? I suspect it starts with finding the text symbol for "Smart Caret" in the properties file, then looking for usage of this symbol in the codebase and you'll probably find the preference symbol for it, and usage of this preference symbol should lead you to where the fix is to be applied. I think it requires to handle the case of textSelection instanceof MultiTextSelection specifically.

Adrodoc55 commented 1 month ago

This seems like a duplicate of #301