clicking on a compiler error message jumps to the correct file, if it is not the current one

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@232 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-03-02 23:28:52 +00:00
parent c180b05345
commit 4971898681
3 changed files with 14 additions and 7 deletions

View File

@ -303,6 +303,7 @@ GPid build_spawn_cmd(gint idx, gchar **cmd)
gint stdout_fd;
gint stderr_fd;
app->cur_idx = idx;
cmd_string = g_strjoinv(" ", cmd);
argv = g_new(gchar *, 4);
@ -323,6 +324,7 @@ GPid build_spawn_cmd(gint idx, gchar **cmd)
msgwin_status_add(_("Process failed (%s)"), error->message);
g_strfreev(argv);
g_error_free(error);
g_free(working_dir);
error = NULL;
return (GPid) 0;
}
@ -469,7 +471,7 @@ gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data)
}
GIOChannel *build_set_up_io_channel (gint fd, GIOCondition cond, GIOFunc func, gpointer data)
GIOChannel *build_set_up_io_channel(gint fd, GIOCondition cond, GIOFunc func, gpointer data)
{
GIOChannel *ioc;
GError *error = NULL;
@ -498,7 +500,7 @@ GIOChannel *build_set_up_io_channel (gint fd, GIOCondition cond, GIOFunc func, g
}
void build_exit_cb (GPid child_pid, gint status, gpointer user_data)
void build_exit_cb(GPid child_pid, gint status, gpointer user_data)
{
#ifdef G_OS_UNIX
gboolean failure = FALSE;

View File

@ -1657,15 +1657,19 @@ on_tree_view_button_press_event (GtkWidget *widget,
if (gdk_color_equal(&red, color))
{
gchar **array = g_strsplit(string, ":", 3);
gint idx = document_get_cur_idx();
gchar *file = g_path_get_basename(doc_list[idx].file_name);
gint line = strtol(array[1], NULL, 10);
gint idx = document_get_cur_idx();
if (line && utils_strcmp(array[0], file))
if (line)
{
utils_goto_line(idx, line);
if (idx != app->cur_idx)
{
gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook),
gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook),
GTK_WIDGET(doc_list[app->cur_idx].sci)));
}
utils_goto_line(app->cur_idx, line);
}
g_free(file);
g_strfreev(array);
}
g_free(string);

View File

@ -145,6 +145,7 @@ typedef struct MyApp
gboolean pref_main_confirm_exit;
gboolean pref_main_show_search;
gboolean pref_main_show_goto;
gint cur_idx; // currently only used by he build system (build_spawn_cmd)
gint mru_length;
gint long_line_column;
#ifdef HAVE_FIFO