Author Topic: Limited list of key words  (Read 4939 times)

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Limited list of key words
« 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

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Limited list of key words
« Reply #1 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Limited list of key words
« Reply #2 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Limited list of key words
« Reply #3 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Limited list of key words
« Reply #4 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 ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Limited list of key words
« Reply #5 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:
  • edit <CodeBlocks>\share\CodeBlocks\lexers
  • start code::blocks, go to editor settings -- colours
  • click on "Reset Defaults"
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Limited list of key words
« Reply #6 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 .

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Limited list of key words
« Reply #7 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.