Jump to content
softtouch

Is there any edit/memo which allows multiselect?

Recommended Posts

I am looking for a edit/memo component which allows multiselect. For example, I have a text "This is just a test" in the edit/memo and would like to select "This" and "test".

I tried to find such component, but without luck. Does it exist or is it just wishful thinking?

Share this post


Link to post
1 hour ago, softtouch said:

Does it exist or is it just wishful thinking?

Where the user can select multiple parts of text I suspect is wishful thinking. There's bound to be edits/memos where text can appear to be selected in multiple locations, i.e. searched text is highlighted.

Share this post


Link to post
8 hours ago, Dave Nottage said:

Where the user can select multiple parts of text I suspect is wishful thinking. There's bound to be edits/memos where text can appear to be selected in multiple locations, i.e. searched text is highlighted.

Thats a pity. I thought there is such control. Notepad++ can do that.

Share this post


Link to post
2 minutes ago, softtouch said:

Notepad++ can do that

Then I stand corrected 🙂


Not sure if there's anything for Delphi. Someone else might be able to chime in

Share this post


Link to post
14 minutes ago, Dave Nottage said:

Then I stand corrected 🙂


Not sure if there's anything for Delphi. Someone else might be able to chime in

Just to show what I mean:

new_1_-_Notepad++_2024-01-04_10-16-43.gif

Share this post


Link to post

That is a very unusual function for a plain text editor. I don't think I've seen it before.

Share this post


Link to post
11 minutes ago, Lars Fosdal said:

That is a very unusual function for a plain text editor. I don't think I've seen it before.

For plain text editor it is indeed strange, but NotePad++ is not plain text editor it is more like everything editor with huge plugins database.

 

I think i saw that behavior in editing Word documents and in editing HTML, it was useful to change font style and color in one go.

 

TRichView doesn't support such multi selection, but might be easier to emulate selection by simply highlighting.

Share this post


Link to post

SynEdit has a feature request for Multi-Select, but I am not sure if that was meant for this use case.

Share this post


Link to post
Posted (edited)

All modern code editors have multi-select and multi-caret functionality (Visual Studio, VS-Code, Scintilla, Atom etc.).  Also the freepascal CudaText.  See CudaText - Free Pascal wiki for how it works.  Very useful.

 

I am currently working to add this to SynEdit.

 

 

Edited by pyscripter
  • Like 5
  • Thanks 1

Share this post


Link to post

I didn't realize that VSCode had it. It defaulted to Alt+Click, while I expected Ctrl+Click.

Share this post


Link to post

How would copy and paste work? I suppose it would only copy the selected text but how would it look like after pasting? Space separated?

Share this post


Link to post
4 minutes ago, PeaShooter_OMO said:

How would copy and paste work?

It is explained in the link to CudaText I gave above.

Share this post


Link to post
Posted (edited)
6 hours ago, Lars Fosdal said:

That is a very unusual function for a plain text editor. I don't think I've seen it before.

It is extremely useful. Multi caret and selection editing has saved me hours of repetitive work. I'll often copy a Delphi unit into Sublime Text to do this kind of stuff and then copy back.

 

Here's a quick example just looking on youtube (not my video, just something that shows how fast and easy you can do multi-line edit with multi-selection):

 

 

Edited by Brandon Staggs

Share this post


Link to post

I use reg.ex search/replace and/or macros for that kind of stuff.

 

Share this post


Link to post
Posted (edited)
6 hours ago, Lars Fosdal said:

I use reg.ex search/replace and/or macros for that kind of stuff.

 

I also use regex. Combining regex with multiselect and multi-caret editing has a multiplicative effect on time savings when doing certain kinds of editing tasks. Taking the time to learn the shortcuts and features in Sublime Text for mult-line and multi-caret editing and selection yielded a ROI similar to the one I got from taking some time to become competent in regex.

 

Besides being able to edit hundreds of carets in place all at once, using regex to copy thousands of matches all at the same time from a complex document and paste them into a new document all at once is worth multi-select all by itself. Having to record a macro for these kinds of things seems like a waste of time once you can do that.

Edited by Brandon Staggs

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×