Page 1 of 1

One key source reformat

Posted: Fri Jul 26, 2013 3:58 pm
by blueznl
This one says it all: http://www.purebasic.fr/english/viewtop ... 13&t=55624 :-)

Anyway, I would like:

A full reformat of the whole code, upon pressing a shortcut key, with AFTER the reformat NOTHING selected and the cursor (as far as possible) on its original place. That would allow a quick Alt+R or something similar and just continue coding.

Yes, I know CTRL+F2 CTRL+A CTRL+I F2 mostly does this, but a single keypress would even be better.

(I could stick to CodeCaddy's reformatting, but I like the way the IDE does multiline code, and I'm just not in the mood to rewrite my own reformatting code :-))

Re: One key source reformat

Posted: Fri Jul 26, 2013 6:50 pm
by Danilo
Could use the same menu. With text selection, the selected text gets re-formatted. Without selected text, the whole source gets re-formatted.
I first thought this IDE menu does not work, because I tried without selected text and nothing happened... ;)

Re: One key source reformat

Posted: Fri Jul 26, 2013 7:16 pm
by Josh
Bad idea. In some cases I'm using my own formatting and it would be horrible, if one mistype destroy my formatting when I'm on a place where I can't check the changes.

I need this function only, if I'm testing a foreign codes.

Re: One key source reformat

Posted: Fri Jul 26, 2013 7:29 pm
by Danilo
Josh wrote:if one mistype destroy my formatting
...you can go back with Undo (CTRL+Z), like always after mistyping something. ;)

Just saying that I expected code re-formatting to work without a selection, like in other editors.
However it is done, I also would like to see blueznl's wish implemented. New shortcut key is OK with me,
but using the same menu/key for it is more logical to me. Same thing: re-formatting. With selection and without.

Re: One key source reformat

Posted: Fri Jul 26, 2013 7:35 pm
by Josh
Danilo wrote:
Josh wrote:if one mistype destroy my formatting
...you can go back with Undo (CTRL+Z), like always after mistyping something. ;)
Josh wrote:... when I'm on a place where I can't check the changes.
What doe's CTRL+Z help, if I'm coding on a place where I don't check the changes and see two hours later the broken formatting.

Re: One key source reformat

Posted: Fri Jul 26, 2013 7:43 pm
by Danilo
Josh wrote:What doe's CTRL+Z help, if I'm coding on a place where I don't check the changes and see two hours later the broken formatting.
So it would be better for you to make this two separate shortcut keys and menus to do the same thing. You could disable the hotkey for reformat without selection then...

Re: One key source reformat

Posted: Fri Jul 26, 2013 7:59 pm
by Josh
Danilo wrote:So it would be better for you to make this two separate shortcut keys and menus to do the same thing. You could disable the hotkey for reformat without selection then...
Ok, here you are right :D
Generally I think, CTRL+A CTRL+I is ok. I don't think, that CTRL+A has something to do, that PB changes to the end of code. So it would be fine, when the code after CTRL+I is shown at the same position like before.