Case control (suggestion)

Working on new editor enhancements?
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Case control (suggestion)

Post by Joubarbe »

Would it be possible to have complete control over upper / lower case of constants, keywords and procedures? Including built-in items and standard libraries. I think it would be more elegant and readable to have everything lower case, except for #CONSTANTS, like modern languages.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Case control (suggestion)

Post by Marc56us »

Joubarbe wrote: Tue Jan 04, 2022 9:19 am Would it be possible to have complete control over upper / lower case of constants, keywords and procedures? Including built-in items and standard libraries. I think it would be more elegant and readable to have everything lower case, except for #CONSTANTS, like modern languages.
(Pure)BASIC is not case sensitive.
You can disable the auto-correction of the IDE and write as you want.
Preferences > Editor > Editing > [ ] Enable Case correction
:wink:
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Case control (suggestion)

Post by Joubarbe »

No that doesn't work. If you use autocomplete (and of course you do), standard functions will be capitalized. Same for constants (and I would like them UPPERCASE). This case correction option doesn't really do much.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Case control (suggestion)

Post by Marc56us »

Yes, but It was not specified at first that you wanted this option with auto-completion.
Or typing error?
Would it be possible to have complete control over upper / lower case
No that doesn't work. If you use autocomplete
Thank you for being precise in question and translations :wink:
Yes, you are right, auto-completion auto change case even with uncheck option.
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Case control (suggestion)

Post by BarryG »

[Edit] Doing the below is probably against the Terms and Conditions of PureBasic's license. If you do it anyway, you must NOT share the modified files!

If the team doesn't do your request: you can hack it, but it's a lot of work. (Although you could write a tool to automate it). All you need to do is hex edit all the commands in all files the "PureLibraries" folder, and rename them to be lower-case. Then the editor will auto-complete them to that case.

I just tested it by editing the "PureLibraries\Clipboard" file to rename GetClipboardText() to getclipboardtext():

Image

Then, in the editor, it auto-completes like this:

Image

Just make sure you don't leave any backup files in the library folder, or PureBasic will complain about duplicate commands. (I use HxD to edit, and it creates a ".bak" file after editing, which I need to delete to avoid the PureBasic warning).

So... a nice little coding project for you to bulk-convert all the commands in the folder? Hehe.
Last edited by BarryG on Tue Jan 04, 2022 11:46 am, edited 1 time in total.
Joubarbe
Enthusiast
Enthusiast
Posts: 555
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Case control (suggestion)

Post by Joubarbe »

Haha, too complicated :)
Maybe I should look at the IDE source actually... It's on GitHub now.
Post Reply