Author Topic: #define and highlighting  (Read 18261 times)

Online Commaster

  • Almost regular
  • **
  • Posts: 171
#define and highlighting
« on: August 30, 2013, 08:13:37 pm »
I recently tried to use #define in my wxFrame project and stumbled upon some strange highlighting.

After some investigation I found out, that the "#define" is highlighted with an extra space after it:

Although the "#ifndef" is highlighted properly.

I'm using Ubuntu 13.04 x64, Code::blocks svn 9271.
And I'm using double-click to select words for highlighting.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #1 on: August 30, 2013, 08:28:32 pm »
No such issues here (Fedora 19 x64 svn r9272).
What is your file-encoding and which language-settings dp ypu gave on your system ?

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #2 on: August 30, 2013, 08:44:42 pm »
All project files are UTF-8 with CR+LF.
Language settings seems to be English(United States).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #3 on: August 30, 2013, 08:53:22 pm »
Similar settings here.
Can you send me a minimal file which leads to this issue ?

Either attach it here or send it to me via mail to my username at codeblocks dot org.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #4 on: August 30, 2013, 09:03:33 pm »
I created a fresh Frame based project with the name "jensproject", cleaned up the authorinfo and modified the Main.cpp:
line 6.

Update: Reproduced with Dialog based project too.
« Last Edit: August 30, 2013, 09:05:16 pm by Commaster »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #5 on: August 30, 2013, 10:16:39 pm »
I'm still not able to reproduce this issue.
I tested it on Fedora with latest trunk and on Ubuntu 13.04 with 9266.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #6 on: August 30, 2013, 10:19:14 pm »
Do you use a self-build C::B ?
If yes, did you make sure your build-tree was absolutely clean ?
Are you sure no older C::B libs can interfere with your actual revision ?

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #7 on: August 30, 2013, 10:30:21 pm »
I'm using the same build script (evolved, updated) as in my previous post: http://forums.codeblocks.org/index.php/topic,17724.0.html

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #8 on: August 30, 2013, 10:37:16 pm »
Can you try to rebuild, but remove everything related to your old install(s) manually before the build ?
make uninstall does not always do what you expect, especially if Makefile's have changed, and make is forced to use the new ones to remove an older install.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #9 on: August 30, 2013, 10:43:26 pm »
Lucky me, cause I don't checkout before I uninstall as is seen in that script. But I'll try nevertheless.
(that'll take ~ 10 hours cause of the night time)
« Last Edit: August 30, 2013, 11:09:27 pm by Commaster »

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #10 on: August 31, 2013, 11:40:02 am »
Turns out it has something to do with my .codeblocks folder (During investigation I tried to move it and that fixed the issue). Although it makes the EOF LF by default now. (But the project and all the files were created with existing profile and EOF CR+LF + consistent EOFs). Any help where to look in the profile for this issue? Or should I send over my profile in tar.gz?

I also tried cleaning up /usr/local/(lib, share, inlcude), but the appropriate folders were just empty folders.
« Last Edit: August 31, 2013, 11:41:58 am by Commaster »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #11 on: August 31, 2013, 11:43:59 am »
All relevant settings should be in default.conf (if you do not explicitely start C::B with a different personality).
You can send the broken one to me, or try to find the diffs to the newly created conf-file.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #12 on: August 31, 2013, 12:16:58 pm »
The broken profile is so much bigger than the clean one. Looks like there are many redundant setting stored. Is there a button in Code::Blocks to optimize the config by chance?
(515 kB) http://paste.ubuntu.com/6047311/

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #13 on: August 31, 2013, 12:20:55 pm »
Can you please also paste the conf-file itself for testing ?

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #14 on: August 31, 2013, 12:28:36 pm »
default.conf I am using since ... I can't remember. http://pastebin.com/raw.php?i=3U3kEgjC

Thank you very much for helping with the investigation.
« Last Edit: August 31, 2013, 12:30:31 pm by Commaster »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: #define and highlighting
« Reply #15 on: August 31, 2013, 01:00:31 pm »
It seems scintilla or teh font is broken, if I change it in the editor settings it works correctly.
Your font ("Ubuntu" ?) is replaced by "Cantarell" (system default) and this does (reproducible) not work.

The cause seems to be a problem with the "fi" in define which is recognized as one letter and not as two, it might in fact be one special character in the editor.

I think there was similar issue before with some fonts (at least on Ubuntu), but I'm not absolutely sure about this.
In general it is better to use a monospaced font instead a proportional font for programming.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: #define and highlighting
« Reply #16 on: August 31, 2013, 01:28:46 pm »
Yes, changing the font to, say, Monospace fixes the highlighting.
Thanks again.
« Last Edit: August 31, 2013, 01:31:55 pm by Commaster »