FLTK logo

Re: [fltk/fltk] FLUID syntax highlighting bug with quotes (#135)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] FLUID syntax highlighting bug with quotes (#135) Jon Foster Sep 15, 2020  
 

Looks like you need to escape your backslash in the comment about trailing ones. I'm sure you weren't concerned with trailing apostrophe esses. :-)

I gave it a quick test spin and I couldn't break it. Well, except for one teensy minor thing: Leaving a quote off the end of a quoted string the highlight spills over to the next line. My g++ will bark about that missing quote, so it seems that the syntax highlight should end with the line, unless other commonly used C++ compilers accept multi-line strings. I've been contemplating various syntactic elements and I think without a trailing '\' the only C++ format that crosses lines is the /* ... */ remark format.

I suppose one could always debate whether the directive highlight should extend beyond the directive. You turned on quote highlighting in there but what about other C++ syntactic elements? For example:

#define MyWonderMacro(WIN) \
WIN *appwin; \
int main(int argc, char **argv) { \
  appwin = new WIN(); \
  appwin->show(argc, argv); \
  return Fl::run(); \
}

OK not very wonderful, but you often see some significant C/C++ code tucked in macros. C++ templates reduce some of that. So... do you highlight the whole as language syntax or paint it in the directive color?

I think my preference would be to limit the directive highlight to the directive itself, and paint the remainder with standard syntax highlights. But others probably have different takes on that.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.