Code::Blocks Forums

User forums => Help => Topic started by: tom0769 on August 16, 2005, 09:19:04 am

Title: Limited list of key words
Post by: tom0769 on August 16, 2005, 09:19:04 am
Hi,

i wanted to extend the list of key words and now it's not possible to do this using the editor settings.
I think this is because of the limitations of an normal edit control.
If i edit the registration key
"[HKEY_CURRENT_USER\Software\Code::Blocks\Code::Blocks v1.0\editor\color_sets\default\C_C++\editor\keywords]"
i can add some more keywords, but this isn't a comfortable way.

Isnt't it possible to do this in a file (for example like "TextPad").

Tom
Title: Re: Limited list of key words
Post by: Urxae on August 16, 2005, 10:15:37 am
Usually when I need to edit a long string like that in a single-line textbox, I copy-paste to my text editor, turn on word wrap, edit, copy-paste back. It's not ideal, but at least I get to see the entire text at the same time.
Title: Re: Limited list of key words
Post by: thomas on August 16, 2005, 11:05:53 am
Not that this helps regarding your actual problem at the present time, but...
There is currently a discussion about where to store configs, and in which format. As it looks, configs will (some day in the future) be saved into an xml file rather than the registry. This will make your life a lot happier.

Until then, well... regedit and copy-paste to an editor, like Urxae said.
Title: Re: Limited list of key words
Post by: thomas on August 17, 2005, 09:57:57 am
On a second thought... actually <CodeBlocks>\share\CodeBlocks\lexers pretty much looks like the place to go.

The only problem is that it does not really do anything. I deleted all C++ keywords except for "if" for testing, and nothing happened after restarting code::blocks. I have no clue how you can force it to reload these, going to editor settings and pressing each and every button in the colours tab did not change anything either.
Maybe someone else knows?

Or are the lexers only used for code completion? If so, it may be worthwile to merge these two things, would make sense.
Title: Re: Limited list of key words
Post by: tiwag on August 17, 2005, 10:04:12 am
On a second thought... actually <CodeBlocks>\share\CodeBlocks\lexers pretty much looks like the place to go.

The only problem is that it does not really do anything. I deleted all C++ keywords except for "if" for testing, and nothing happened after restarting code::blocks. I have no clue how you can force it to reload these, going to editor settings and pressing each and every button in the colours tab did not change anything either.
Maybe someone else knows?...
they are copied from the lexer files to registry when installing codeblocks
but there is a button "Reset Defaults" which should reset these settings in the registry
have you tried the button "Reset Defaults" after editing the lexer files ?
Title: Re: Limited list of key words
Post by: thomas on August 17, 2005, 11:28:32 am
have you tried the button "Reset Defaults" after editing the lexer files ?
Yes, but the "are you REALLY sure" dialog scared me off  :oops:
That does it!

So, to resume:
Title: Re: Limited list of key words
Post by: tiwag on August 17, 2005, 12:47:36 pm
... the "are you REALLY sure" dialog scared me off 
maybe it's a good idea to change the text of that dialog to somewhat more descriptive in the future .
Title: Re: Limited list of key words
Post by: rickg22 on August 17, 2005, 07:17:30 pm
I'm open to suggestions :)

Perhaps we should change the behavior of "reset defaults". I could be wrong, but I think "reset defaults" resets the syntax for ALL lexers. Perhaps we should need a "reload from disk" for individual lexers.