Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: Roman on August 05, 2007, 03:48:32 pm
-
Dear guys!
The C++ standard library is a great place to learn good programming techniques. Because of that I often use "open #include fie 'streambuf'" command in the rightclick menu. But <streambuf> has no extension and C::B doesn't use appropriate syntax highlighting scheme. So my suggestion is to 'hardcode' the names of new style standard C++ library header files so they will be highlighted as C++ by default.
Best Regards,
Roman
-
another way would give users the option to change the lexer of any open editor (a la Scite)
-
another way would give users the option to change the lexer of any open editor (a la Scite)
Edit->Highlight mode
-
Edit->Highlight mode
<iostream>
<istream>
<ios>
<ostream>
<ios>
When travelling from top to <ios> content I usually use Edit->Highlight mode but it would be more comfortable not to do so )
Best Regards,
Roman
-
Edit->Highlight mode
Hmm, interesting. When I open a standard C++ header with no file extension, there is no syntax highlighting.
Edit->Highlight mode shows the list with C/C++ selected. Reselecting C/C++ or closing the menu has no effect.
However, if I Edit->Highlight mode and select, say, Batch, highlighting appears.
Then I can Edit->Highlight mode and select C/C++ and get the desired syntax highlighting.
This does not seem correct. Am I missing a refresh command or something?
Windows XP, Nightly SVN 4338.
-
Same thing
-
Edit->Highlight mode
<iostream>
<istream>
<ios>
<ostream>
<ios>
When travelling from top to <ios> content I usually use Edit->Highlight mode but it would be more comfortable not to do so )
Best Regards,
Roman
Does the fact that I quoted dmoore give you a hint that maybe I replied to him? He made a specific suggestion and I replied that it's already there :).
For the rest of the things mentioned in this topic, file a feature request.
-
Edit->Highlight mode
:oops: I've even used this before, but use so infrequently I forgot its existence...
So my suggestion is to 'hardcode' the names of new style standard C++ library header files so they will be highlighted as C++ by default.
Roman: instead of hardcoding a list, how about automatically changing to the C/C++ lexer (or the currently active lexer) if you follow a #include? that should be easy to implement
Hmm, interesting. When I open a standard C++ header with no file extension, there is no syntax highlighting.
Edit->Highlight mode shows the list with C/C++ selected. Reselecting C/C++ or closing the menu has no effect.
having troubles replicating this. my version doesn't even show a check next to the current lexer. If I open a file without extension it defaults to plain text. I can change to c/c++ but can't change back to text.
anyway, I can work on these issues in the next week or two if someone else wants to put a bug/feature request on berlios.
-
...I can work on these issues in the next week or two if someone else wants to put a bug/feature request on berlios.
Thanks. Bug 011720.
-
Thanks. Bug 011720.
I was about to commit a fix for this bug. But dmoore reported another one and I stopped. ;)
having troubles replicating this. my version doesn't even show a check next to the current lexer. If I open a file without extension it defaults to plain text. I can change to c/c++ but can't change back to text.
Both the bugs are fixed in rev 4353. :)
-
So my suggestion is to 'hardcode' the names of new style standard C++ library header files so they will be highlighted as C++ by default.
No way, sorry.
Roman: instead of hardcoding a list, how about automatically changing to the C/C++ lexer (or the currently active lexer) if you follow a #include? that should be easy to implement
That would break languages with similar/identical preprocessor syntax. Two such examples are Cg and Objective-C (there are probably more).
-
Roman: instead of hardcoding a list, how about automatically changing to the C/C++ lexer (or the currently active lexer) if you follow a #include? that should be easy to implement
That would break languages with similar/identical preprocessor syntax. Two such examples are Cg and Objective-C (there are probably more).
note the alternative:
(or the currently active lexer)
surely this won't break unless a language can #include code written in another language, or a language uses a different lexer for its #includes?
-
So my suggestion is to 'hardcode' the names of new style standard C++ library header files so they will be highlighted as C++ by default.
No way, sorry.
I do have the same opinion as of Thomas.
One way to identify is to read the file for some embedded highlighting tags. E.g., iostream begins with the following line-
// Standard iostream objects -*- C++ -*-
which indicates that it's a C++ file. But this behavior is not uniform and MS supplied headers doesn't have these identifiers. :)
-
i still don't see what is wrong with assuming the same lexer as the file they are linking from. what am i missing?
-
i still don't see what is wrong with assuming the same lexer as the file they are linking from. what am i missing?
I'm missing it too )
-
i still don't see what is wrong with assuming the same lexer as the file they are linking from. what am i missing?
That would probably work.