Kaydet (Commit) 5321e14d authored tarafından Enrico Tröger's avatar Enrico Tröger

Change the current working directory within the VTE also when a new file is saved.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@774 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst f4507528
......@@ -3,6 +3,9 @@
* configure.in, src/callbacks.c, src/geany.h, src/main.c:
Removed the whole FIFO code and replaced it with support for
(Unix Domain) Sockets(including Windows support, but not yet done).
* src/vte.c, src/callbacks.c, src/document.c:
Change the current working directory within the VTE also when a new
file is saved.
2006-08-29 Enrico Tröger <enrico.troeger@uvena.de>
......
......@@ -770,21 +770,7 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
utils_check_disk_status(idx);
#ifdef HAVE_VTE
if (vte_info.have_vte && vc->follow_path && doc_list[idx].file_name != NULL)
{
gchar *path;
gchar *cmd;
path = g_path_get_dirname(doc_list[idx].file_name);
vte_get_working_directory(); // refresh vte_info.dir
if (! g_str_equal(path, vte_info.dir))
{
cmd = g_strconcat("cd ", path, "\n", NULL);
vte_send_cmd(cmd);
g_free(cmd);
}
g_free(path);
}
vte_cwd(doc_list[idx].file_name);
#endif
}
}
......
......@@ -788,6 +788,10 @@ void document_save_file(gint idx, gboolean force)
utils_update_statusbar(idx, -1);
treeviews_openfiles_update(doc_list[idx].iter, basename);
g_free(basename);
#ifdef HAVE_VTE
vte_cwd(doc_list[idx].file_name);
#endif
}
}
......
......@@ -422,6 +422,25 @@ const gchar* vte_get_working_directory()
}
void vte_cwd(const gchar *filename)
{
if (vte_info.have_vte && vc->follow_path && filename != NULL)
{
gchar *path;
gchar *cmd;
path = g_path_get_dirname(filename);
vte_get_working_directory(); // refresh vte_info.dir
if (! g_str_equal(path, vte_info.dir))
{
cmd = g_strconcat("cd ", path, "\n", NULL);
vte_send_cmd(cmd);
g_free(cmd);
}
g_free(path);
}
}
/*
void vte_drag_data_received(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y,
GtkSelectionData *data, guint info, guint time)
......
......@@ -70,7 +70,9 @@ void vte_apply_user_settings(void);
void vte_send_cmd(const gchar *cmd);
const gchar* vte_get_working_directory();
const gchar* vte_get_working_directory(void);
void vte_cwd(const gchar *filename);
/*
void vte_drag_data_received(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y,
......
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