Kaydet (Commit) d3eb239d authored tarafından Nick Treleaven's avatar Nick Treleaven

Show parsable errors in red; stderr and compile failure in dark red

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@800 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 0f9f0490
2006-09-08 Nick Treleaven <nick.treleaven@btinternet.com>
* src/build.c, src/msgwindow.c, src/msgwindow.h:
Show parsable errors in red; stderr and compile failure in dark red.
* src/callbacks.c: Fix compilation problem with sci_cb_do_comment.
* src/document.c: Quick fix for C89 compatibility.
2006-09-07 Enrico Tröger <enrico.troeger@uvena.de>
* src/socket.c, src/main.c, src/callbacks.c:
......
......@@ -468,31 +468,29 @@ static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data)
{
//GIOStatus s;
gchar *msg;
guint x = 1;
while (g_io_channel_read_line(ioc, &msg, NULL, NULL, NULL) && msg)
{
//if (s != G_IO_STATUS_NORMAL && s != G_IO_STATUS_EOF) break;
if (GPOINTER_TO_INT(data))
msgwin_compiler_add(COLOR_RED, FALSE, g_strstrip(msg));
else
msgwin_compiler_add(COLOR_BLACK, FALSE, g_strstrip(msg));
gint color;
color = (GPOINTER_TO_INT(data)) ? COLOR_DARK_RED : COLOR_BLACK;
g_strstrip(msg);
if (app->pref_editor_use_indicators)
{
gchar *filename;
gint line;
msgwin_parse_compiler_error_line(g_strstrip(msg), &filename, &line);
if (line != -1)
msgwin_parse_compiler_error_line(msg, &filename, &line);
if (line != -1 && filename != NULL)
{
gint idx = document_find_by_filename(filename, FALSE);
// document_set_indicator will check valid idx
document_set_indicator(idx, line - 1);
document_set_indicator(idx, line - 1); // will check valid idx
color = COLOR_RED; // error message parsed on the line
}
g_free(filename);
}
msgwin_compiler_add(color, FALSE, msg);
x++;
g_free(msg);
}
}
......@@ -526,11 +524,11 @@ void build_exit_cb(GPid child_pid, gint status, gpointer user_data)
if (failure)
{
msgwin_compiler_add(COLOR_BLUE, TRUE, _("compilation finished unsuccessful"));
msgwin_compiler_add(COLOR_DARK_RED, TRUE, _("Compilation failed."));
}
else
{
msgwin_compiler_add(COLOR_BLUE, TRUE, _("compilation finished successful"));
msgwin_compiler_add(COLOR_BLUE, TRUE, _("Compilation finished successfully."));
}
#endif
......
......@@ -2468,7 +2468,7 @@ on_menu_comment_line1_activate (GtkMenuItem *menuitem,
{
gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_do_comment(idx, -1);
sci_cb_do_comment(idx);
}
......@@ -2478,7 +2478,7 @@ on_menu_uncomment_line1_activate (GtkMenuItem *menuitem,
{
gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_do_uncomment(idx, -1);
sci_cb_do_uncomment(idx);
}
......
......@@ -1566,10 +1566,12 @@ gboolean document_can_redo(gint idx)
void document_undo(gint idx)
{
undo_action *action;
#if 1
sci_undo(doc_list[idx].sci);
return;
undo_action *action;
#endif
if (idx == -1 || ! doc_list[idx].is_valid) return;
......
......@@ -171,6 +171,7 @@ void msgwin_compiler_add(gint msg_color, gboolean scroll, gchar const *format, .
GdkColor *color;
GtkTreePath *path;
static GdkColor red = {0, 65535, 0, 0};
static GdkColor dark_red = {0, 65535 / 2, 0, 0};
static GdkColor blue = {0, 0, 0, 65535};
static GdkColor black = {0, 0, 0, 0};
static gchar string[512];
......@@ -185,6 +186,7 @@ void msgwin_compiler_add(gint msg_color, gboolean scroll, gchar const *format, .
switch (msg_color)
{
case COLOR_RED: color = &red; break;
case COLOR_DARK_RED: color = &dark_red; break;
case COLOR_BLUE: color = &blue; break;
default: color = &black;
}
......
......@@ -28,6 +28,7 @@
enum
{
COLOR_RED,
COLOR_DARK_RED,
COLOR_BLACK,
COLOR_BLUE
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment