It is currently Thu Oct 18, 2018 9:15 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Allow us to disable highlighting/correction of keywords
PostPosted: Sat Aug 04, 2018 5:59 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3225
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:
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.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Allow us to disable highlighting/correction of keywords
PostPosted: Sat Aug 04, 2018 8:22 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1154
Location: Germany, Glienicke
>> Allow us to disable highlighting/correction of keywords

Both is possible:

https://www.purebasic.com/documentation/reference/ide_preferences.html
Quote:
[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

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: Allow us to disable highlighting/correction of keywords
PostPosted: Sun Aug 05, 2018 2:59 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3225
I like highlighting keywords and case correction. I only want to disable it for certain keywords.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Allow us to disable highlighting/correction of keywords
PostPosted: Mon Aug 06, 2018 8:15 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 152
Location: Germany
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Allow us to disable highlighting/correction of keywords
PostPosted: Wed Aug 08, 2018 10:54 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3225
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.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye