diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-21 20:57:40 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-12-22 19:33:48 +0300 |
commit | c174f9be70855e89f606547cfa5471942d238038 (patch) | |
tree | f7e000c4168b8b9ac1ab76330b09c87a6e845955 /src/error.h | |
parent | 157f4235a0cb2d6a37b131e0c52fecef9566f32c (diff) | |
download | sciteco-c174f9be70855e89f606547cfa5471942d238038.tar.gz |
support external Scintilla lexer libraries and Scintillua in particular
* @ES/SCI_SETILEXER/lib^@name/ now opens the lexer <name> in library <lib>.
* You need to define the environment variable $SCITECO_SCINTILLUA_LEXERS to point
to the lexers/ subdirectory (containing the *.lua files).
Perhaps this should default to the dirname of <lib>?
* The semantics of SCI_NAMEOFSTYLE have been changed:
It now returns style ids when given style names, so you can actually write
Scintillua lexer *.tes files.
This will be superfluous if we had a way to return strings from Scintilla messages into
Q-Registers, e.g. 23@EPq/SCI_NAMEOFSTYLE/.
* We now depend on gmodule as well, but it should always be part of glib.
It does not change the library dependencies of any package.
It might result in gmodule shared libraries to be bundled in the Win32 and Mac OS
packages if they weren't already.
Diffstat (limited to 'src/error.h')
-rw-r--r-- | src/error.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.h b/src/error.h index c51f528..021f759 100644 --- a/src/error.h +++ b/src/error.h @@ -17,6 +17,7 @@ #pragma once #include <glib.h> +#include <gmodule.h> #include "sciteco.h" #include "string-utils.h" @@ -53,6 +54,7 @@ typedef enum { TECO_ERROR_MEMLIMIT, TECO_ERROR_CLIPBOARD, TECO_ERROR_WIN32, + TECO_ERROR_MODULE, /** Interrupt current operation */ TECO_ERROR_INTERRUPTED, @@ -165,6 +167,13 @@ teco_error_win32_set(GError **error, const gchar *prefix, gint err) #endif static inline void +teco_error_module_set(GError **error, const gchar *prefix) +{ + g_set_error(error, TECO_ERROR, TECO_ERROR_MODULE, "%s: %s", + prefix, g_module_error()); +} + +static inline void teco_error_interrupted_set(GError **error) { g_set_error_literal(error, TECO_ERROR, TECO_ERROR_INTERRUPTED, "Interrupted"); |