MultiEditing

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

MultiEditing

Post by RSBasic »

Hello :)

In Notepad++ and in other editors there is the function "Multi Editing" to mark and edit several code areas at the same time.
This is how it looks in another program: https://learn.microsoft.com/en-us/visua ... diting.gif

PureBasic and SpiderBasic can not use this function. With my new tool it is now possible.

How to?
Ctrl key + Left mouse button: You can create multiple cursors and write or delete text in multiple lines at the same time.
Shift key + Alt key + Left mouse button pressed: Several lines are marked within a rectangle and you can write or delete text in several lines at the same time.
Shift key + Alt key + Arrow key (up, down, left or right): Several lines are marked within a rectangle and you can write or delete text in several lines at the same time.

Screenshot:
Image

Installation:
Image

Download: https://www.rsbasic.de/downloads/downlo ... diting.zip
Image

I would be very pleased about feedbacks, improvement suggestions, error messages or wishes. Thanks :)
Image
Image
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

Re: MultiEditing

Post by BarryG »

:shock: https://www.youtube.com/watch?v=IumBp15irvM

I installed it and worked out I need to double-click each text selection to edit them simultaneously, but it also adds what I type to where the cursor is, which is unwanted.
dige
Addict
Addict
Posts: 1251
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: MultiEditing

Post by dige »

I just had the use case of developing in two different places in the code at the same time and remembered the MultiEdit tool.
Unfortunately, it no longer seems to work.

Or do I still have to do something to activate the screen split?
"Daddy, I'll run faster, then it is not so far..."
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: MultiEditing

Post by RSBasic »

dige wrote: Tue Apr 18, 2023 2:17 pm I just had the use case of developing in two different places in the code at the same time and remembered the MultiEdit tool.
Unfortunately, it no longer seems to work.

Or do I still have to do something to activate the screen split?
I tested it with PureBasic 6.02 LTS. It works. Are you still having this problem?
Image
Image
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MultiEditing

Post by Little John »

Hi, this sounds promising!

I have installed the tool, but unfortunately I don't have any idea how it is going to be used. Can you explain it, please?
RSBasic wrote: Sat Jun 22, 2019 9:06 pm In Notepad++ and in other editors there is the function "Multi Editing" to mark and edit several code areas at the same time.
This is how it looks in Notepad++: https://notepad-plus-plus.org/assets/im ... tiEdit.gif
That link is dead now.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: MultiEditing

Post by RSBasic »

Thanks for the hint. I updated the link to the external image.

Here's a new example of what that looks like:
https://learn.microsoft.com/en-us/visua ... vsmac-2022

With the MultiEdit function you can edit several lines at the same time.
Image
Image
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MultiEditing

Post by Little John »

RSBasic wrote: Sun Aug 27, 2023 9:10 am With the MultiEdit function you can edit several lines at the same time.
Yes, I know what the purpose of your tool is, and that was not my question. ;-)
Little John wrote: Sun Aug 27, 2023 7:42 am [...] I don't have any idea how it is going to be used.
I don't have experience with Notepad++. Do I have to hold down the [Alt] key while dragging the mouse (doesn't seem to work) in order to get multiple cursors or multiple selections, or what else is to be done in order to active multiediting mode with your tool?
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: MultiEditing

Post by RSBasic »

Hello Little John

If you have added my program as a tool in PureBasic (see installation guide), then restart PureBasic.
In the editor you put the cursor in a line, e.g.:
Image

Press Shift key and Alt key at the same time while pressing e.g. down arrow key:
Image

Then you can remove with DEL key and write what:
Image
Image
Image
Image
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MultiEditing

Post by Little John »

RSBasic wrote: Press Shift key and Alt key at the same time while pressing e.g. down arrow key:
This is the information I was missing, thank you.

However, after doing so, I get e.g. a rectangular selection that spans 5 lines. When I then press say the "x" key, an x will only be written in the 5th line, and after the key press, there is no selection anymore and only one caret in the 5th line. :? Lines 1 to 4 remain unchanged.
Tested with PB 6.03 beta 5 (x64) on Windows.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: MultiEditing

Post by RSBasic »

I can not confirm. I can also use Shift and Alt with my mouse to mark a rectangle and when I write something, it replaces in all lines at the same time.
Can you create a video or gif animation?
Image
Image
highend
Enthusiast
Enthusiast
Posts: 125
Joined: Tue Jun 17, 2014 4:49 pm

Re: MultiEditing

Post by highend »

Can't confirm either on PB 6.03 beta 5 (x64) on Windows. Works as expected.

A feature wish: Can you add the option to define the hotkey(s) to press?

E.g. through an .ini file in the same folder as the MultiEditing.exe file (so that it stays 100% portable)

I'm used to just press Alt in all my editors that support multi-line editing. Not Shift+Alt.
So I'd like to switch (if you don't mind to implement that)...

Thanks for the nice tool! :mrgreen:
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: MultiEditing

Post by Little John »

RSBasic wrote: Sun Aug 27, 2023 5:09 pm Can you create a video or gif animation?
Today doing the same as yesterday, now it works as expected. :?
User avatar
Caronte3D
Addict
Addict
Posts: 1047
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: MultiEditing

Post by Caronte3D »

Nice feature, I missed it when was posted :wink:
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: MultiEditing

Post by RSBasic »

I added a guide in the first post:
How to?
Ctrl key + Left mouse button: You can create multiple cursors and write or delete text in multiple lines at the same time.
Shift key + Alt key + Left mouse button pressed: Several lines are marked within a rectangle and you can write or delete text in several lines at the same time.
Shift key + Alt key + Arrow key (up, down, left or right): Several lines are marked within a rectangle and you can write or delete text in several lines at the same time.

highend wrote: Mon Aug 28, 2023 8:50 am A feature wish: Can you add the option to define the hotkey(s) to press?

E.g. through an .ini file in the same folder as the MultiEditing.exe file (so that it stays 100% portable)

I'm used to just press Alt in all my editors that support multi-line editing. Not Shift+Alt.
I'll check this.
Image
Image
highend
Enthusiast
Enthusiast
Posts: 125
Joined: Tue Jun 17, 2014 4:49 pm

Re: MultiEditing

Post by highend »

I'll check this
Thanks!
Post Reply