Move a line in the source code...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Caronte3D
Addict
Addict
Posts: 1355
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Move a line in the source code...

Post by Caronte3D »

Would be nice if we have the shortcut Alt+ArrowUp or Alt+ArrowDown to move the current line up and down (like in another IDEs) :wink:
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Move a line in the source code...

Post by Little John »

We can do that in the PureBasic IDE, using [Ctrl]+[Shift]+[↑] and [Ctrl]+[Shift]+[↓] (tested with PB 6.04 LTS on Windows).
User avatar
Caronte3D
Addict
Addict
Posts: 1355
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Move a line in the source code...

Post by Caronte3D »

Ugh! :? Thanks Little John, I don't know about it :D
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Move a line in the source code...

Post by AZJIO »

I encounter this every time I try to expand the selection, but instead a line is moved.
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Move a line in the source code...

Post by Shardik »

Little John wrote: Thu Jun 13, 2024 8:15 pm We can do that in the PureBasic IDE, using [Ctrl]+[Shift]+[↑] and [Ctrl]+[Shift]+[↓] (tested with PB 6.04 LTS on Windows).
Thank you for this excellent tip I also didn't know!

On MacOS it's [Command] + [Shift] + [↑] and [Command] + [Shift] + [↓].
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 457
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Move a line in the source code...

Post by Mindphazer »

Little John wrote: Thu Jun 13, 2024 8:15 pm We can do that in the PureBasic IDE, using [Ctrl]+[Shift]+[↑] and [Ctrl]+[Shift]+[↓] (tested with PB 6.04 LTS on Windows).
Wow :shock:
I wasn't aware of this tip either !
That's a great one !

Thanks Little John !
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Move a line in the source code...

Post by moulder61 »

Cool! Works in Linux too. :)

Moulder.
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Move a line in the source code...

Post by Kwai chang caine »

Little John wrote: Thu Jun 13, 2024 8:15 pm We can do that in the PureBasic IDE, using [Ctrl]+[Shift]+[↑] and [Ctrl]+[Shift]+[↓] (tested with PB 6.04 LTS on Windows).
Amazing.. :shock:
i don't know this function since several decade i use the IDE :oops:
Thanks for the TIP :wink:
ImageThe happiness is a road...
Not a destination
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Move a line in the source code...

Post by Tenaja »

Kwai chang caine wrote: Thu Jun 27, 2024 7:23 pm
Little John wrote: Thu Jun 13, 2024 8:15 pm We can do that in the PureBasic IDE, using [Ctrl]+[Shift]+[↑] and [Ctrl]+[Shift]+[↓] (tested with PB 6.04 LTS on Windows).
Amazing.. :shock:
i don't know this function since several decade i use the IDE :oops:
Thanks for the TIP :wink:
Check out the scintilla documentation (on their site) for other nifty keyboard shortcuts.
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Move a line in the source code...

Post by blueb »

Tip #2

Highlight the line (or a section of code), click on it, and drag it where you want. :mrgreen:
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Axolotl
Addict
Addict
Posts: 804
Joined: Wed Dec 31, 2008 3:36 pm

Re: Move a line in the source code...

Post by Axolotl »

I like your tip blueb, because I use it a lot.
Best part: The clipboard text remains unchanged. :)
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
SPH
Enthusiast
Enthusiast
Posts: 562
Joined: Tue Jan 04, 2011 6:21 pm

Re: Move a line in the source code...

Post by SPH »

Code: Select all

;  close a code section :

;{
; blablabla
;}
Test that :wink:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Move a line in the source code...

Post by boddhi »

I use this tip for a long time ago (I don't remember precisely but before PB 5.73, 5.60 maybe?).
It works with line blocs too. :wink:

Edit: Finally, it was since 5.72.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Post Reply