geany/scintilla/scintilla_changes.patch
David Yu Yang f59e52008e Add GDScript file type
Heavily borrowed from python due to GDScript's syntax being heavily borrowed from python
2022-01-14 12:01:41 +08:00

135 lines
3.1 KiB
Diff

A patch to Scintilla 3.54 containing our changes to Scintilla
(removing unused lexers, exporting symbols).
diff --git scintilla/gtk/ScintillaGTK.cxx scintilla/gtk/ScintillaGTK.cxx
index 0871ca2..49dc278 100644
--- scintilla/gtk/ScintillaGTK.cxx
+++ scintilla/gtk/ScintillaGTK.cxx
@@ -3046,11 +3046,13 @@ sptr_t ScintillaGTK::DirectFunction(
}
/* legacy name for scintilla_object_send_message */
+GEANY_API_SYMBOL
sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
ScintillaGTK *psci = static_cast<ScintillaGTK *>(sci->pscin);
return psci->WndProc(static_cast<Message>(iMessage), wParam, lParam);
}
+GEANY_API_SYMBOL
gintptr scintilla_object_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return scintilla_send_message(sci, iMessage, wParam, lParam);
}
@@ -3062,6 +3064,7 @@ extern void Platform_Initialise();
static void scintilla_init(ScintillaObject *sci);
/* legacy name for scintilla_object_get_type */
+GEANY_API_SYMBOL
GType scintilla_get_type() {
static GType scintilla_type = 0;
try {
@@ -3091,6 +3094,7 @@ GType scintilla_get_type() {
return scintilla_type;
}
+GEANY_API_SYMBOL
GType scintilla_object_get_type() {
return scintilla_get_type();
}
@@ -3200,6 +3204,7 @@ static void scintilla_init(ScintillaObje
}
/* legacy name for scintilla_object_new */
+GEANY_API_SYMBOL
GtkWidget *scintilla_new() {
GtkWidget *widget = GTK_WIDGET(g_object_new(scintilla_get_type(), nullptr));
gtk_widget_set_direction(widget, GTK_TEXT_DIR_LTR);
@@ -3207,6 +3212,7 @@ GtkWidget* scintilla_new() {
return widget;
}
+GEANY_API_SYMBOL
GtkWidget *scintilla_object_new() {
return scintilla_new();
}
@@ -3250,6 +3250,7 @@ void scintilla_release_resources(void) {
static void *copy_(void *src) { return src; }
static void free_(void *) { }
+GEANY_API_SYMBOL
GType scnotification_get_type(void) {
static gsize type_id = 0;
if (g_once_init_enter(&type_id)) {
diff --git scintilla/lexilla/src/Lexilla.cxx scintilla/lexilla/src/Lexilla.cxx
index cd4b23617..af4a73db4 100644
--- scintilla/lexilla/src/Lexilla.cxx
+++ scintilla/lexilla/src/Lexilla.cxx
@@ -165,12 +165,68 @@ namespace {
CatalogueModules catalogueLexilla;
+static void AddGeanyLexers()
+{
+ catalogueLexilla.AddLexerModules({
+ &lmAbaqus,
+ &lmAda,
+ &lmAsm,
+ &lmBash,
+ &lmBatch,
+ &lmCaml,
+ &lmCmake,
+ &lmCOBOL,
+ &lmCoffeeScript,
+ &lmCPP,
+ &lmCss,
+ &lmD,
+ &lmDiff,
+ &lmErlang,
+ &lmF77,
+ &lmForth,
+ &lmFortran,
+ &lmFreeBasic,
+ &lmGDScript,
+ &lmHaskell,
+ &lmHTML,
+ &lmJulia,
+ &lmLatex,
+ &lmLISP,
+ &lmLua,
+ &lmMake,
+ &lmMarkdown,
+ &lmNsis,
+ &lmNull,
+ &lmOctave,
+ &lmPascal,
+ &lmPerl,
+ &lmPHPSCRIPT,
+ &lmPO,
+ &lmPowerShell,
+ &lmProps,
+ &lmPython,
+ &lmR,
+ &lmRuby,
+ &lmRust,
+ &lmSmalltalk,
+ &lmSQL,
+ &lmTCL,
+ &lmTxt2tags,
+ &lmVerilog,
+ &lmVHDL,
+ &lmXML,
+ &lmYAML,
+ });
+}
+
void AddEachLexer() {
if (catalogueLexilla.Count() > 0) {
return;
}
+ AddGeanyLexers();
+ return;
+
catalogueLexilla.AddLexerModules({
//++Autogenerated -- run scripts/LexillaGen.py to regenerate
//**\(\t\t&\*,\n\)