Un Indent & auto Comment

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Nexus100
User
User
Posts: 55
Joined: Tue Feb 16, 2010 9:40 pm
Location: Essex, UK

Un Indent & auto Comment

Post by Nexus100 »

Hi All

Would it be possible to have an Unindent feature that moved a selected block of text back one tab space? Currently I can see we can highlight a block of text and press tab to make it tab to the right, but it would be great to be able to do the reverse - makes it easy to format code to look sensible!

Also, I feel an 'Auto Comment' keystroke could be added where once pressed a comment line would be entered at the cursor with the date and possibler time - ths makes it easy to see the last changes you made to your code...something like this to appear:

;10-03-10 14:56:

ready for the user to type the comments after this!

Thanks

Jason
All watched over by MACHINES..I am little more than #DigitalPlankton
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Un Indent & auto Comment

Post by c4s »

Nexus100 wrote:Also, I feel an 'Auto Comment' keystroke could be added where once pressed a comment line would be entered at the cursor with the date and possibler time - ths makes it easy to see the last changes you made to your code...something like this to appear:

;10-03-10 14:56:
Good idea!
But that's what the tool area is for: Develop it for yourself - it shouldn't be too hard. And than if you want to post your solution here. :)

To your other request:
Just use "Shift+Tab". I didn't know it for myself until now but I thought it could be a scintilla shortcut ...et voila see here: http://www.scintilla.org/SciTEDoc.html
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: Un Indent & auto Comment

Post by Blue Steel »

shit tab on block of selected text un-indents (removes tab)

darn someone beat me too it lol

ROTF.. i just noticed .. in my haste i mistyped the word "shift" ROTF
Last edited by Blue Steel on Wed Mar 10, 2010 12:40 pm, edited 1 time in total.
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Un Indent & auto Comment

Post by c4s »

Blue Steel wrote:shit tab on block of selected text un-indents (removes tab)

darn someone beat me too it lol
haha you made me laugh. :D
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Un Indent & auto Comment

Post by Vera »

Hi,

just in case anyone likes an overview about ScintillaShortcuts in PB-IDE you can find a list here.

greetings ~ Vera
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: Un Indent & auto Comment

Post by Blue Steel »

in the help file it tells you about the SHIFT TAB

The PureBasic IDE
-Editing features
Special Tab behaviour:

When the Tab key is pressed while nothing or only a few characters are selected, the Tab key acts as mentioned above (inserting a number of spaces, or a real tab if configured that way).

However when one or more full lines are selected, the reaction is different. In that case at the beginning of each selected line, it will insert spaces or a tab (depending on the configuration). This increases the indentation of the whole selected block.

Marking several lines of text and pressing Shift+Tab reverses this behaviour. It removes spaces/tabs at the start of each line in order to reduce the indentation of the whole block.
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Un Indent & auto Comment

Post by blueznl »

Aligning your code by hand is sooooo 2004 :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply