aboutsummaryrefslogtreecommitdiff
path: root/src/gui.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-27 16:24:24 +0200
committerMarvin Borner2021-04-27 16:24:24 +0200
commit7c047df78502d53411fef09c6e39540d2b7e796a (patch)
tree00a72bb40f81e7294cb1dde776159ed219ee4967 /src/gui.c
parent60e7b5069d5936546356053f85008a5a02bb473a (diff)
Fixed some overflows and enabled live parsing
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui.c b/src/gui.c
index 020ed47..9f2a590 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -52,8 +52,8 @@ static void gui_call_parser(void)
{
char *buf = gui_text_buffer();
- if (parse(buf, BUFFER_SIZE))
- gui_show_info("Compiled successfully!");
+ if (!parse(buf, BUFFER_SIZE)) {
+ } // Oh, parsing failed :( (TODO: Do something?)
g_free(buf);
}
@@ -139,8 +139,8 @@ static gchar *gui_show_tt(GtkSourceMarkAttributes *attributes, GtkSourceMark *ma
return strdup(message);
}
-void gui_add_line_marker(u32 line_number, const char *message, const char *name, const char *category,
- const char *icon, GdkRGBA rgba)
+void gui_add_line_marker(u32 line_number, const char *message, const char *name,
+ const char *category, const char *icon, GdkRGBA rgba)
{
GtkSourceMarkAttributes *attributes = gtk_source_mark_attributes_new();
gtk_source_mark_attributes_set_background(attributes, &rgba);
@@ -156,7 +156,8 @@ void gui_add_line_marker(u32 line_number, const char *message, const char *name,
strdup(message));
}
-void gui_remove_line_marker(const char *category) {
+void gui_remove_line_marker(const char *category)
+{
GtkTextIter start, end;
GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
@@ -242,7 +243,9 @@ static gboolean gui_key_release_handler(GtkWidget *widget, GdkEventKey *event, g
UNUSED(event);
UNUSED(data);
- gui_call_syntax_highlighter();
+ // TODO: Integrate highlighting into parser?
+ //gui_call_syntax_highlighter();
+ gui_call_parser();
return FALSE;
}