Skip to content

Instantly share code, notes, and snippets.

View codebrainz's full-sized avatar

Matthew Brush codebrainz

View GitHub Profile
#define GEANY_DEFINE_PLUGIN(name, \
description, \
version, \
author, \
api, \
init_func, \
cleanup_func, \
config_func, \
help_func) \
G_MODULE_EXPORT void geany_load_module (GeanyPlugin *plugin) \
diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx
index 92fc064..bf66928 100644
--- a/scintilla/gtk/ScintillaGTK.cxx
+++ b/scintilla/gtk/ScintillaGTK.cxx
@@ -546,8 +546,10 @@ void ScintillaGTK::UnRealizeThis(GtkWidget *widget) {
GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);
#endif
gtk_widget_unrealize(PWidget(wText));
- gtk_widget_unrealize(PWidget(scrollbarv));
- gtk_widget_unrealize(PWidget(scrollbarh));
diff --git a/src/project.c b/src/project.c
index b235160..6a488e0 100644
--- a/src/project.c
+++ b/src/project.c
@@ -319,54 +319,59 @@ void project_open(void)
if (! project_ask_close()) return;
#ifdef G_OS_WIN32
- file = win32_show_project_open_dialog(main_widgets.window, _("Open Project"), dir, FALSE, TRUE);
- if (file != NULL)
diff --git a/src/editor.c b/src/editor.c
index 595cd54..35105bc 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -2626,7 +2626,7 @@ static gboolean snippets_complete_constructs(GeanyEditor *editor, gint pos, cons
gchar *str;
const gchar *completion;
gint str_len;
- gint ft_id = editor->document->file_type->id;
+ GeanyFiletypeID ft_id = editor->document->file_type->id;
#0 0x00007ffff53a4443 in g_private_get ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007ffff537ceec in g_slice_free1 ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff634746d in pango_attr_list_unref ()
from /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
#3 0x00007ffff63542a8 in ?? ()
from /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
#4 0x00007ffff6356238 in pango_layout_get_iter ()
from /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0
^C
Program received signal SIGINT, Interrupt.
0x00007ffff744e8dd in poll () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0 0x00007ffff744e8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff2398bd2 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2 0x00007ffff239a4df in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3 0x00007ffff239a5f1 in xcb_wait_for_reply ()
from /usr/lib/x86_64-linux-gnu/libxcb.so.1
@codebrainz
codebrainz / win32-unicode.patch
Last active December 13, 2015 23:10
Make Geany agnostic to Win32 API text encoding
diff --git a/src/win32.c b/src/win32.c
index 34b7d93..f5ffc9a 100644
--- a/src/win32.c
+++ b/src/win32.c
@@ -32,6 +32,10 @@
/* Needed for SHGFP_TYPE */
#define _WIN32_IE 0x0500
+#ifndef UNICODE
+# define UNICODE
@codebrainz
codebrainz / libsig.h
Last active February 10, 2022 08:08
Trivial C++ signal/callback mechanism
/*
* libsig.h - Trivial signal/callback library.
*
* Copyright (c) 2015 Matthew Brush <mbrush@codebrainz.ca>
* You can use this code under the MIT license as described here:
* https://opensource.org/licenses/MIT
*
* To create a signal, declare member variables of type
* `libsig::signal<...>` in your class. The template parameter is the
* argument types that will be passed to the callback functions.
@codebrainz
codebrainz / lex.py
Last active March 20, 2021 20:56
Simple tokenizing in Python
#!/usr/bin/env python3
import re
from collections import namedtuple
class Tokenizer:
Token = namedtuple('Token', 'name text span')
def __init__(self, tokens):
@codebrainz
codebrainz / license.txt
Last active May 16, 2025 16:46
MJPEG Player in JavaScript
Copyright 2015 Matthew Brush
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: