Page 1 of 1

Allow us to disable highlighting/correction of keywords

Posted: Sat Aug 04, 2018 5:59 pm
by Mistrel
I would like to disable List and Map as keywords as I want to use my own variables with these names as lower-case and have them not automatically case correct or appear colored (which is confusing).

A possible solution would be to allow prefixing a '-' in the custom keywords list to identify which ones to remove.

So:

Code: Select all

SomeKeyword <- Add
-List <- Remove
-Map <- Remove
I would like to use my own keywords "AsList" and "AsMap" which are actually macros to "List" and "Map" as replacements. This would allow me to have nicely colored keywords for procedure arguments and also free up these two keywords for use with variables. I often use "list" and "map" as short and succinct variable names in other languages but I can't really do this well from the PureBasic IDE due to them being built-in keywords.

Re: Allow us to disable highlighting/correction of keywords

Posted: Sat Aug 04, 2018 8:22 pm
by STARGĂ…TE
>> Allow us to disable highlighting/correction of keywords

Both is possible:

https://www.purebasic.com/documentation ... ences.html
[x] Enable bolding of keywords
If your font does not display bold characters in the same size as non-bold ones, you should disable this option. If disabled, the keywords will not be shown as bold.

[x] Enable case correction
If enabled, the case of PureBasic keywords, PureBasic Functions as well as predefined constants will automatically be corrected while you type.
Image

Image

Re: Allow us to disable highlighting/correction of keywords

Posted: Sun Aug 05, 2018 2:59 am
by Mistrel
I like highlighting keywords and case correction. I only want to disable it for certain keywords.

Re: Allow us to disable highlighting/correction of keywords

Posted: Mon Aug 06, 2018 8:15 am
by Derren
Add them to the list of custom keywords and use the same format as for variables in the dialog STARGATE posted.

downside: If you decide to use "LIST" in another project, it will be corrected to lower case (or however you wrote it in the list of custom keywords), also you can't have any other custom keywords or syntax highlighting for those anymore, of course...

I tried to find the Keywords in the resident file, but couldn't. Apparently those are hardcoded or hidden somewhere else.

Re: Allow us to disable highlighting/correction of keywords

Posted: Wed Aug 08, 2018 10:54 pm
by Mistrel
Derren wrote:I tried to find the Keywords in the resident file, but couldn't. Apparently those are hardcoded or hidden somewhere else.
I had the same idea. I'm pretty sure that it's hard-coded into the IDE (PureBasic.exe). The trick is that it's probably UTF-16 so you have to use a UTF-aware hex editor search for it. There are a lot of instances of the word "list" and I haven't found the right one yet.