From 2344b11599ce696ebc0bd7773befada44246897c Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 16 Apr 2023 12:59:50 +0300 Subject: updated Scintilla to v5.3.4, Scinterm to v4.1 and Lexilla to v5.2.4 * actually everything is updated to their current HEADs but the aforementioned versions are close. * Scintilla uses threads now, so we added checks for pthread. To be on the safe side, we imported AX_PTHREAD from the Autoconf archives. The flags are kept out of the ordinary build system, though and used only for compiling Scintilla and for linking. SciTECO may also use threads, but via Glib. * Scinterm removed SCI_COLOR_PAIR(), so we re-added it to src/interface-curses/interface.c. * There is an Asciidoc lexer now. * The interruption bug (see TODO) is not fixed by this upgrade. Perhaps the Mac OS version runs better now. Feedback is needed (refs #12). --- src/interface-curses/interface.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index ec98093..6e6fb75 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -158,6 +158,17 @@ static gint teco_xterm_version(void) G_GNUC_UNUSED; #define COLOR_LCYAN COLOR_LIGHT(COLOR_CYAN) #define COLOR_LWHITE COLOR_LIGHT(COLOR_WHITE) +/** + * Returns the curses `COLOR_PAIR` for the given curses foreground and background `COLOR`s. + * This is used simply to enumerate every possible color combination. + * Note: only 256 combinations are possible due to curses portability. + * Note: This references the global curses variable `COLORS` and is not a constant expression. + * @param f The curses foreground `COLOR`. + * @param b The curses background `COLOR`. + * @return int number for defining a curses `COLOR_PAIR`. + */ +#define SCI_COLOR_PAIR(f, b) ((b) * ((COLORS < 16) ? 8 : 16) + (f) + 1) + /** * Curses attribute for the color combination * `f` (foreground) and `b` (background) -- cgit v1.2.3