#895 Bug that "terminates" C code syntax highlighting


I finally tracked down the exact conditions that cause a strange bug I've been experiencing in the C syntax highlighting. I'm running Geany 0.21 on Linux (specificly the version packaged in the Ubuntu 12.04 repositories).

I found that in some of my .c files the syntax highlighting would cease to oppearte after some particular line in some of my files (all text after that line would be pure black and white). The .c files that this affected compile correctly without any warnings, so use correct C syntax.

I tracked the problem to one particular type a line that "terminates" the syntax highlighting. Here is an example:


In this case the "Hello World\n" string is not syntax highlighted, nor are any lines after this in the file. The problem appears to be the specific upper-case R character immediately preceding the quote ". If I change that R to lower case or any other letter the bug does not occur, not if I add a space between the R and the ".

I've attached a simple example file that can be opened to view the bug: "return 0" on line 8 should be highlighted but is not.
This example can also be compiled and run with no errors or warnings:
$ gcc -Wall geany-syntax-highlighting-bug-example.c -o example
$ ./example
Example: Hello World


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-10-05
    Last edit: Anonymous 2013-11-20
  • Colomban Wendling

    Already fixed in 1.22.

  • Colomban Wendling

    • labels: 790033 --> Filetypes
    • milestone: 542693 --> v1.22
    • status: open --> closed-out-of-date
  • Colomban Wendling

    • labels: Filetypes --> Filetypes, C, Scintilla
    • Found in: --> v0.21

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks