From a86ccc67973ce9752e0c052592584bd2bd0d99ed Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 2 Jun 2008 15:50:56 +0000 Subject: [PATCH] Reload a changed document immediately on user clicking reload (waiting was not related to the now fixed reload-colourise problem). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2632 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- src/utils.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/utils.c b/src/utils.c index 8c4cd04ae..7b4861a8a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -278,19 +278,6 @@ gchar *utils_find_open_xml_tag(const gchar sel[], gint size, gboolean check_tag) } -static gboolean reload_idx(gpointer data) -{ - gint idx = GPOINTER_TO_INT(data); - - /* check idx is still valid now we're idle, in case it was closed */ - if (DOC_IDX_VALID(idx)) - { - document_reload_file(idx, NULL); - } - return FALSE; -} - - static gboolean check_reload(gint idx) { gchar *base_name = g_path_get_basename(documents[idx]->file_name); @@ -302,10 +289,7 @@ static gboolean check_reload(gint idx) "the current buffer."), base_name); if (want_reload) { - /* delay reloading because we need to wait for any pending scintilla messages - * to be processed, otherwise the reloaded document might not be colourised - * properly */ - g_idle_add(reload_idx, GINT_TO_POINTER(idx)); + document_reload_file(idx, NULL); } g_free(base_name); return want_reload; @@ -343,7 +327,7 @@ gboolean utils_check_disk_status(gint idx, gboolean force) { if (check_reload(idx)) { - /* Disable checking until after reload, so ignore this change for now */ + /* Update the modification time */ documents[idx]->mtime = st.st_mtime; } else