Some little improvements to the editor

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Christian Uceda
User
User
Posts: 67
Joined: Thu Jul 29, 2010 10:53 am

Some little improvements to the editor

Post by Christian Uceda »

As purebasic has a neat indenting feature, I propose to expand it a little bit more;

The editor knows about fold-able code using keywords, and it is able to identify the beginning and end of a code section, the proof is that if you leave the cursor over an if/endif for/next, etc. it can highlight it (it does underline the keywords).

So instead of me having to select manually the section, why not add a function that can select the whole section automatically using the underlying code-block feature and indent it automatically at the press of a keystroke like the F4 does for fold-able code.

This is obvious when one want to indent a whole procedure, and have to scroll the editor to select the entire code within the procedure.

Also another nice addition to the indention could be to get rid of the blank trailing spaces that remain so often at the end of a line.

Yeah I sound lazy, but bear in mind that my hands hurt when typing for too long, and those features I mention could save a lot of typing.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Some little improvements to the editor

Post by Vera »

Hi Christian,

I can't follow you not wanting to select something manually but I also find this and that uneasy while trying to keep a steady indentation.

Until your request might be considered I'd like to hint you to fine small IDE addon by HeX0R with which your code will be tidied within a second by a mouseclick or hotkey. It's PureBasic opensource and crossplattform and you could even adjust it to your personal preferences. :D
It always indents the whole code, fills up missing spaces and removes the obsolet ones.

Example / code & link to settings (Einstellungen) : [IDE-Tool]Einruecker
Searching the forums you'll find at least two other similar tools

To me it's a little big helper ;)

cheers ~ Vera
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Some little improvements to the editor

Post by ts-soft »

PB 4.51 can do this without any tool :roll:
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: Some little improvements to the editor

Post by Fluid Byte »

Ctrl+A / Ctrl+I :!:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Some little improvements to the editor

Post by Vera »

AllIndent - yes - but it doesn't handle the spaces and resists personal setting-attempts :mrgreen:
Christian Uceda
User
User
Posts: 67
Joined: Thu Jul 29, 2010 10:53 am

Re: Some little improvements to the editor

Post by Christian Uceda »

I can't follow you not wanting to select something manually but I also find this and that uneasy while trying to keep a steady indentation.
Well It is easy, it is so one doesn't have either to leave the keyboard and pick the mouse, or to hold the shift key and scroll using the keyboard, when you're on a small screen, at the end of the coding section you have either to move the mouse a lot, or use a lot of keystrokes.

If I have the cursor on top of a procedure (over the declaration line) why not indent the whole procedure automatically when pressing ctrl+<something> ????

I think that would be neat.
Until your request might be considered I'd like to hint you to fine small IDE addon by HeX0R with which your code will be tidied within a second by a mouseclick or hotkey. It's PureBasic opensource and crossplattform and you could even adjust it to your personal preferences. :D

It always indents the whole code, fills up missing spaces and removes the obsolete ones.
I'll have a look at it, but to indent everything at once PB can already do: ctrl+a, ctr+i

What I propose is just to do ctrl+<key> and just indent whatever block code that begins where the cursor is, so for example if I'm over the select statement in a select-endselect block, to have the PB editor to sort what code block without having to select the code beforehand.

This can be very good when you're working in the middle of a bunch of code, and just want to make the current code chunk a bit more readable, without having to indent the whole of the code.
Post Reply