Menu

#1207 LexCPP C++0x raw strings glitch

Bug
closed-fixed
Scintilla (812)
5
2011-09-16
2011-08-08
No

Failed for this kind of snippet (from luaconf.h, Lua 5.2 beta):

LUA_LDIR"?.lua;"

The raw string tests in SCE_C_IDENTIFIER work, but once it switches back to SCE_C_DEFAULT, the SCE_C_DEFAULT to SCE_C_STRINGRAW transition seems to be too permissive. Recent hg build.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2011-08-08
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2011-08-08

    Possibly a check that the 'R' is in SCE_C_STRINGRAW state.

     
  • Kein-Hong Man

    Kein-Hong Man - 2011-08-08

    Changing the line to:

    if (sc.chPrev == 'R' && styler.StyleAt(sc.currentPos - 1) == SCE_C_STRINGRAW) {

    Works, but one glitch when editing: add a space or char between R and the "(string)", then delete the char. Then "(string)" stays a regular string. Possibly need something like the HEREDOC refresh you did for the Perl lexer...

     
  • Neil Hodgson

    Neil Hodgson - 2011-08-08

    Because the style of the previous byte is still in a buffer, it isn't seen by StyleAt. Adding in a Flush fixes this:

    if (sc.chPrev == 'R') {
    styler.Flush();
    if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) {

    It may be better to either improve StyleAt so it looks into the buffered styles or add another method.

     
  • Kein-Hong Man

    Kein-Hong Man - 2011-08-08

    Good catch, editing work fine now.

     
  • Neil Hodgson

    Neil Hodgson - 2011-08-08
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2011-08-08

    Committed fix.

     
  • Neil Hodgson

    Neil Hodgson - 2011-09-16
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.