Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: drac on March 09, 2008, 02:11:34 am

Title: c++ headers not having syntax highlighting
Post by: drac on March 09, 2008, 02:11:34 am
Hi,

I'm using release 8.02 and if I create a c++ console application and I right click on the
#include <iostream> and select "Open #include file: 'iostream'" all I see is black text.

It seams that the extensionless c++ header files are not taken into consideration as
c++ files.

Here is a list of c++ header files: (taken from Dinkumware (http://www.dinkumware.com/manuals/default.aspx) documentation)

Code
<algorithm> 
<array>
<bitset>
<cassert>
<ccomplex>
<cctype>
<cerrno>
<cfenv>
<cfloat>
<cinttype>
<ciso646>
<climits>
<clocale>
<cmath>
<complex>
<csetjmp>
<csignal>
<cstdarg>
<ccstdbool>
<cstddef>
<cstdint>
<cstdio>
<cstdlib>
<cstring>
<ctgmath>
<ctime>
<cwchar>
<cwctype>
<deque>
<exception>
<fstream>
<functional>
<hardware>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<iterator>
<limits>
<list>
<locale>
<map>
<memory>
<new>
<numeric>
<ostream>
<queue>
<random>
<regex>
<set>
<slist>
<sstream>
<stack>
<stdexcept>
<streambuf>
<string>
<strstream>
<tuple>
<typeinfo>
<type_traits>
<utility>
<valarray>
<vector>

Regards,
Cristi.
Title: Re: c++ headers not having syntax highlighting
Post by: Ceniza on March 09, 2008, 11:04:26 am
That's right. It's because those files don't have an extension, so CB treats them as plain text files by default. A trick is to add * to the list of Filemasks in the Syntax Highlighting options for C/C++ (Settings -> Editor).
Title: Re: c++ headers not having syntax highlighting
Post by: drac on March 09, 2008, 02:00:40 pm
Thanks for the workaround.