[anjuta-extras] scintilla: Fix reload comparison when removing trailing space
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta-extras] scintilla: Fix reload comparison when removing trailing space
- Date: Sun, 2 Oct 2011 10:30:57 +0000 (UTC)
commit 2e2e275ef4129c54072811028fde8853a6200eec
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sun Oct 2 12:30:38 2011 +0200
scintilla: Fix reload comparison when removing trailing space
The last saved content wasn't terminated with '\0' which make the comparison falling when getting the change notification.
plugins/scintilla/text_editor.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c
index 0c54c42..adad16a 100644
--- a/plugins/scintilla/text_editor.c
+++ b/plugins/scintilla/text_editor.c
@@ -87,6 +87,8 @@
#define TEXT_EDITOR_PROGRAM_COUNTER 3
#define TEXT_EDITOR_LINEMARKER 4
+#define RATE_LIMIT_IN_MS 2000
+
/* Include marker pixmaps */
#include "anjuta-bookmark-16.xpm"
#include "anjuta-breakpoint-disabled-16.xpm"
@@ -556,6 +558,7 @@ text_editor_update_monitor (TextEditor *te, gboolean disable_it)
G_FILE_MONITOR_NONE,
NULL,
&error);
+ g_file_monitor_set_rate_limit (te->monitor, RATE_LIMIT_IN_MS);
g_signal_connect (te->monitor, "changed",
G_CALLBACK (on_text_editor_uri_changed), te);
g_object_unref (gio_uri);
@@ -1718,6 +1721,7 @@ save_to_file (TextEditor *te, gchar *uri, GError **error)
}
/* Set last content saved to data */
+ data[size] = '\0';
g_free (te->last_saved_content);
te->last_saved_content = data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]