diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-01-27 23:50:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-27 23:50:06 +0100 |
| commit | cdb51045dda7076be33147cc8e9138035ad9b97e (patch) | |
| tree | bdb05911b0514aa39ab442d0caac761c529f8c53 /test | |
| parent | 84c0b7495b0859cce8b79fc6e4ceee19bc4f2f35 (diff) | |
Background color attribute for Fl_Text_Display. (#378)
* Background color attribute for Fl_Text_Display.
* Adding attributes.
* Avoid clipping horizontal
* Fl_Text_Display underlining.
* Better line positions
* Typos, testing.
* Documentation.
Diffstat (limited to 'test')
| -rw-r--r-- | test/editor.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/editor.cxx b/test/editor.cxx index eb45de7aa..478bd3ebe 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -57,6 +57,15 @@ const int line_num_width = 75; Fl_Text_Buffer *stylebuf = 0; Fl_Text_Display::Style_Table_Entry styletable[] = { // Style table +#ifdef TESTING_ATTRIBUTES + { FL_BLACK, FL_COURIER, TS }, // A - Plain + { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS, Fl_Text_Display::ATTR_BGCOLOR, FL_LIGHT2 }, // B - Line comments + { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS, Fl_Text_Display::ATTR_BGCOLOR_EXT, FL_LIGHT2 }, // C - Block comments + { FL_BLUE, FL_COURIER, TS, Fl_Text_Display::ATTR_UNDERLINE }, // D - Strings + { FL_DARK_RED, FL_COURIER, TS, Fl_Text_Display::ATTR_GRAMMAR }, // E - Directives + { FL_DARK_RED, FL_COURIER_BOLD, TS, Fl_Text_Display::ATTR_STRIKE_THROUGH }, // F - Types + { FL_BLUE, FL_COURIER_BOLD, TS, Fl_Text_Display::ATTR_SPELLING }, // G - Keywords +#else { FL_BLACK, FL_COURIER, TS }, // A - Plain { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // B - Line comments { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // C - Block comments @@ -64,6 +73,7 @@ Fl_Text_Display::Style_Table_Entry { FL_DARK_RED, FL_COURIER, TS }, // E - Directives { FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types { FL_BLUE, FL_COURIER_BOLD, TS }, // G - Keywords +#endif }; const char *code_keywords[] = { // List of known C/C++ keywords... "and", @@ -188,7 +198,6 @@ style_parse(const char *text, } else if (strncmp(text, "//", 2) == 0) { current = 'B'; for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B'; - if (length == 0) break; } else if (strncmp(text, "/*", 2) == 0) { current = 'C'; |
