From d8bca75e411e17c57fc67d28d2c215c7b47e1dbb Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 27 Mar 2008 17:16:53 +0000 Subject: [PATCH] Check file on disk for changes (with timeout) when pressing a key. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2424 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ src/keybindings.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 46094703..f555fb23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ Split document_create_new_sci() into document_create() and create_new_sci(). Rename filename parameter utf8_filename. + * src/keybindings.c: + Check file on disk for changes (with timeout) when pressing a key. 2008-03-26 Enrico Tröger diff --git a/src/keybindings.c b/src/keybindings.c index 8a48d0b3..c2a79b21 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -842,6 +842,17 @@ static gboolean check_vte(GdkModifierType state, guint keyval) #endif +static void check_disk_status(void) +{ + gint idx = document_get_cur_idx(); + + if (DOC_IDX_VALID(idx)) + { + utils_check_disk_status(idx, FALSE); + } +} + + /* central keypress event handler, almost all keypress events go to this function */ gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data) { @@ -851,6 +862,8 @@ gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *ev, gpointer user if (ev->keyval == 0) return FALSE; + check_disk_status(); + keyval = ev->keyval; state = ev->state & GEANY_KEYS_MODIFIER_MASK;