#464 BugFix #3692, #3759: Correct raw string parsing in C/C++


Fixed wrong syntax highlighting on raw strings in C/C++. See bugs [#3692] and [#3759].

1 Attachments


Bugs: #3692
Bugs: #3759


  • froschbrocken

    froschbrocken - 2013-03-18

    Fixes the syntax highlighting in the following two examples.

    Example 1:

    #include <stdio.h>
    #define R "buggy"
    int main()
    printf("Hello, "R" world!\n");
    // this comment is no longer syntax highlighted!
    return 0;

    Example 2:

    #include <stdio.h>
    #define CR "\r"
    int main(int argc, char **argv)
        printf(CR "\neverything is OK here");
            printf(CR"\nfrom now on no code has syntax highlighting!!!");
            printf(CR"\neven the brackets {} for the if above are not correctly highlighted!!!");
    #undef CR
  • FLS

    FLS - 2013-04-02

    The above syntax highlighting issues are solved with the current Scintilla version 3.3.0 (or even before). Notepad++ uses a slightly modified version based on Scintilla 2.2.7.
    I have updated/merged Scintilla for Notepad++ to 3.3.0 and tested the examples above successfully.
    Therefore, the special patch provided here is not really necessary. In my opinion, an upgrade to the current Scintilla version is more desirable.

    The patch for upgrade/merge of Notepad++ to Scintilla version 3.3.0 is provided at https://sourceforge.net/p/notepad-plus/patches/467/


  • froschbrocken

    froschbrocken - 2013-04-02

    Hi FLS,
    thanks for the info. Updating to a more recent Scintilla version seemed better for me, too, but I didn't know how much work this is and what I might destroy by doing it.
    How are the chances that the new Scintilla version will be included in the next npp release?

  • Don HO

    Don HO - 2013-09-21
    • status: open --> closed
  • Don HO

    Don HO - 2013-09-21

    It's rather a Scintilla bug.
    In order to make update procedure easier, please submit your patch on Scintilla project, so Notepad++ can benefite the fix on the next Scintilla update.

    Thank you,

  • froschbrocken

    froschbrocken - 2013-09-23

    Hi Don! This bug has already been fixed in Scintilla. As I said, I would have preferred updating to a new Scintilla-Version as well, but that seemed too much effort for me, since I did not know how many changes Notepad++ did to the Scintilla library. However, I noticed the discussion in #467, so thanks for your effort on the Scintilla upgrade thing.