This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268351 - Multicarets select
Summary: Multicarets select
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P2 normal with 1 vote (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-05 10:10 UTC by CaguCT
Modified: 2016-12-14 09:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Can't do like this (81.07 KB, image/jpeg)
2016-10-05 10:10 UTC, CaguCT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description CaguCT 2016-10-05 10:10:27 UTC
Created attachment 162347 [details]
Can't do like this

Hello!
In Dev version from august i start use editor multicarets. All was ok! But in relese 8.2 I can use this function fully.
I cant multiselect text like this http://joxi.ru/gmvVZRDUbJoRma
Also in Dev version its worked.

Sorry for my english, I hope you understend what im try tell.
Comment 1 Ralph Ruijs 2016-10-05 14:02:24 UTC
Using the mouse to add a second selection doesn't seem to work anymore.

Steps to reproduce

1. Select a word with the mouse (there is now 1 caret)
2a. Add a second caret by holding ctrl+shift and double-clicking another word
2b. Add a second caret by holding ctrl+shift and draging over anoter word

expected: two carets both selecting a word (pos and mark with different value)
actual: two carets, but only the first one is in selection
Comment 2 CaguCT 2016-10-05 15:52:17 UTC
This is a very handy feature for me.
It was especially good to allocate different parts of the code in different places, and then insert the same selected parts from another location.
Why removed?

I went back to the editor only for multycarrets.
Your steps to reproduce isn't work, when words is different, and this is so long while.

Thank you for having responded to me.
Comment 3 CaguCT 2016-10-05 15:54:21 UTC
Can I download dev version, where this function is available?
Comment 4 CaguCT 2016-10-05 17:04:41 UTC
Its somes like this 2016-07-04
Comment 5 Miloslav Metelka 2016-12-09 10:38:05 UTC
The functionality got removed by this commit http://hg.netbeans.org/main-silver/rev/09a03109c14b but I've fixed it so now it should work like this:
Ctrl+Shift+single-click - add caret at clicked offset
Ctrl+Shift+double-click - add caret and select word under cursor; if word was already selected remove the word selection and the corresponding caret.
Comment 6 Miloslav Metelka 2016-12-09 10:39:05 UTC
http://hg.netbeans.org/jet-main/rev/05eac58c4689
Comment 7 CaguCT 2016-12-09 13:23:05 UTC
(In reply to Miloslav Metelka from comment #5)
> The functionality got removed by this commit
> http://hg.netbeans.org/main-silver/rev/09a03109c14b but I've fixed it so now
> it should work like this:
> Ctrl+Shift+single-click - add caret at clicked offset
> Ctrl+Shift+double-click - add caret and select word under cursor; if word
> was already selected remove the word selection and the corresponding caret.

It's magic!
I finally waited, thank you!

Also I can make like this - https://www.youtube.com/watch?v=k9xFNgX-WDk ?
Comment 8 Miloslav Metelka 2016-12-09 23:37:01 UTC
Transplanted into release82 branch so that it gets included in 8.2.1 patch:
05eac58c4689 transplanted to 541f384d35ce
Comment 9 Miloslav Metelka 2016-12-14 09:07:25 UTC
(In reply to Ralph Ruijs from comment #1)
> Using the mouse to add a second selection doesn't seem to work anymore.
> 
> Steps to reproduce
> 
> 1. Select a word with the mouse (there is now 1 caret)
> 2a. Add a second caret by holding ctrl+shift and double-clicking another word
> 2b. Add a second caret by holding ctrl+shift and draging over anoter word
As Jirka P. pointed out the drag case 2b. still doesn't work with the fix, sorry for that.
As a workaround Shift+Click applies to last added caret so the selection for additional carets can be done by
1. Ctrl+Shift+Click to add the next caret.
2. Shift+Click on to-be-created selection's end.

I've filed issue #269329 to fix the 2b. case.
Comment 10 Jiri Prox 2016-12-14 09:10:42 UTC
Scenario 2a works -> marking as verified