News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Syntax Highlighting C++/SDL

Started by ravenshade, April 12, 2013, 05:17:55 AM

Previous topic - Next topic

ravenshade

Hi,

Given the popularity of SDL... I can't quite figure out how to get the Syntax Highlighting working for it. For instance SDL_Surface isn't highlighted nor is NULL which probably should be too.

I'm also using Linux as well so how the heck can I get it working?

Thanks

oBFusCATed

There is no semantic highlight in C::B yet.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Folco

You can add the SDL types to the list of the highlighted keywords.
Kernel Extremist - PedroM power ©

ravenshade

Null looks a bit weird in bright green or blue, it's supposed to be red or something similar. I had thought that the different 'sets' of keywords would have different colours or styles attached to them but as far as I can tell only sets 1 & 2 do anything at all. Though I am using the sets at the moment just to get round the problem.

I'm not really looking for 'Semantic highlighting' what would be nice is if all the sets had different colour codes/styles to them. I can't seem to figure out how to add a custom lexer either, the tutorial on the wiki doesn't give much information as to where things are stored and may involve further coding (which given that I'm learning, probably isn't a good idea for me to mess with). In theory I'd like to just extend the lexer and add in my own keywords and stuff but I don't know whether that would work as such.

Alpha


ravenshade

http://forums.next.codeblocks.org/index.php/topic,17248.msg118337.html#msg118337

Okay, I take that, but exactly what is set 4 supposed to do? Set 1 presents the text as Strong && Blue, Set 2 presents the text as Strong && Green. Set 4...does nothing visibly. (So far as I can tell).

Technically SDL_Surface is a global class/type def, but I can't tell the difference between it and normal black text.

Alpha

What version of Code::Blocks are you using?
If you have 12.11 or trunk/nightly, there should be a 'Global classes and typedefs' entry in the color style selection list.  (There is also 'Keyword' and 'User keyword' which control the style of sets one and two.)

ravenshade

#7
I'm using the one from the Fedora repository...which appears to be 10.05

I don't think Code::Blocks have submitted an updated version to the repository yet... so in the color style selection list...or list of "Default, Comment, ... , Number, Keyword, User keyword..." and so on I don't have Global Classes & Typedefs...

oBFusCATed

Alpha:
Here you see a request for improving your hack.  ;D
But please don't mislead user/s, the feature he requests do not exist currently.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ravenshade

oBFusCATed:

If the sets actually changed the colour/style of the text as they appear supposed to be able to do, that would be enough. I don't really need to craft an entire new Lexer. If it were possible for me to change what those sets do, would also be satisfactory. As I could then enter the stuff I needed through the GUI.

I just don't understand why there are 9 sets, if they 7 of them don't do anything.

Alpha

Quote from: ravenshade on April 14, 2013, 08:07:58 PM
I'm using the one from the Fedora repository...which appears to be 10.05
In that case, I recommend trying a nightly (binaries here).

Quote from: oBFusCATed on April 14, 2013, 08:20:55 PM
Alpha:
Here you see a request for improving your hack.  ;D
But please don't mislead user/s, the feature he requests do not exist currently.
If I understood ravenshade correctly, (s)he is just looking for additional keyword highlighting, not semantic (or pseudo semantic in my case ;)).  Keyword highlighting is something that Scintilla provides just fine, and in 12.11 and newer, three sets of keywords are available.

ravenshade

#11
Ah, I'll wait until the next Code::Blocks is submitted to the fedora repository. The last time I installed something from binary...it went horribly wrong.

But that's exactly what I want Alpha, more keyword highlighting!

oBFusCATed

Settings -> Editor -> Syntax Highlight -> C++ -> Keywords -> Enter your keywords

This is available for quite a long time.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ravenshade

Yes, I get that. But...

Quote from: ravenshade on April 12, 2013, 06:49:31 PM
Null looks a bit weird in bright green or blue, it's supposed to be red or something similar. I had thought that the different 'sets' of keywords would have different colours or styles attached to them but as far as I can tell only sets 1 & 2 do anything at all. Though I am using the sets at the moment just to get round the problem.


There are some 'words' such as NULL which shouldn't be in 'blue' because it's a value not a type or class. Which is why I'm trying to figure out how to get the other 'sets' to actually do things.

Jenna

Quote from: ravenshade on April 14, 2013, 09:42:26 PM
Ah, I'll wait until the next Code::Blocks is submitted to the repository. The last time I installed something from binary...it went horribly wrong.

On my server there are not just nightly binaries, it's a repo that should work fine with Fedora 16 to 18.
I personally have used it for fc17 and use it for fc18 now.

I do not provide binaries of the 12.11 release on my server (at least not for Fedora and RedHat/CentOS).