Menu

#895 Bug that "terminates" C code syntax highlighting

v1.22
closed-out-of-date
nobody
v0.21
5
2013-07-23
2012-10-05
Anonymous
No

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:

printf(MACRO_WITH_NAME_ENDING_WITH_UPPERCASE_R"Hello World\n");

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

Discussion

  • 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.