From cec029dbee435e7f608b9f6a4a3d8e98f2c5a398 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Wed, 16 Sep 2020 09:33:24 -0700 Subject: Rewrite CodeEditor syntax highlighting for issue #135 --- fluid/CodeEditor.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'fluid/CodeEditor.h') diff --git a/fluid/CodeEditor.h b/fluid/CodeEditor.h index e865ac63e..617f61413 100644 --- a/fluid/CodeEditor.h +++ b/fluid/CodeEditor.h @@ -15,29 +15,30 @@ // #ifndef CodeEditor_h -# define CodeEditor_h +#define CodeEditor_h // // Include necessary headers... // -# include -# include -# include -# include -# include -# include -# include - +#include +#include +#include +#include +#include +#include +#include +#include "StyleParse.h" class CodeEditor : public Fl_Text_Editor { static Fl_Text_Display::Style_Table_Entry styletable[]; static const char * const code_keywords[]; static const char * const code_types[]; - + static void* search_types(char *find); + static void* search_keywords(char *find); // 'style_parse()' - Parse text and produce style data. - static void style_parse(const char *text, char *style, int length); + static void style_parse(const char *tbuff, char *sbuff, int len, char style); // 'style_unfinished_cb()' - Update unfinished styles. static void style_unfinished_cb(int, void*); @@ -58,6 +59,7 @@ class CodeEditor : public Fl_Text_Editor { // attempt to make the fluid code editor widget honour textsize setting void textsize(Fl_Fontsize s); + friend class StyleParse; }; class CodeViewer : public CodeEditor { -- cgit v1.2.3