softtouch 9 Posted January 3 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
Dave Nottage 554 Posted January 4 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
softtouch 9 Posted January 4 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
Dave Nottage 554 Posted January 4 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
softtouch 9 Posted January 4 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: Share this post Link to post
Lars Fosdal 1790 Posted January 4 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
Kas Ob. 121 Posted January 4 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
Uwe Raabe 2056 Posted January 4 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
pyscripter 689 Posted January 4 (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 January 4 by pyscripter 5 1 Share this post Link to post
Lars Fosdal 1790 Posted January 4 I didn't realize that VSCode had it. It defaulted to Alt+Click, while I expected Ctrl+Click. Share this post Link to post
PeaShooter_OMO 11 Posted January 4 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
pyscripter 689 Posted January 4 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
Brandon Staggs 272 Posted January 4 (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 January 4 by Brandon Staggs Share this post Link to post
Lars Fosdal 1790 Posted January 5 I use reg.ex search/replace and/or macros for that kind of stuff. Share this post Link to post
Brandon Staggs 272 Posted January 5 (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 January 5 by Brandon Staggs Share this post Link to post