[gedit-code-assistance] Reparse without timeout when changing focus
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-code-assistance] Reparse without timeout when changing focus
- Date: Tue, 24 Dec 2013 11:52:27 +0000 (UTC)
commit a2cf772593808c96fee076d93ac551507d63819f
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Tue Dec 24 12:52:19 2013 +0100
Reparse without timeout when changing focus
src/gca-view.vala | 12 +++++++++++-
src/gca-window-activatable.vala | 2 +-
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/gca-view.vala b/src/gca-view.vala
index 228e9d1..b511b7e 100644
--- a/src/gca-view.vala
+++ b/src/gca-view.vala
@@ -142,6 +142,17 @@ class View : Object
path_changed(prevpath);
}
+ public void reparse_now()
+ {
+ if (d_timeout != 0)
+ {
+ Source.remove(d_timeout);
+ d_timeout = 0;
+ }
+
+ changed();
+ }
+
public void reparse()
{
if (d_timeout != 0)
@@ -160,7 +171,6 @@ class View : Object
{
d_scrollbar_marker.max_line = d_document.document.get_line_count();
reparse();
-
}
private void update_backend()
diff --git a/src/gca-window-activatable.vala b/src/gca-window-activatable.vala
index 18df8e7..2884167 100644
--- a/src/gca-window-activatable.vala
+++ b/src/gca-window-activatable.vala
@@ -46,7 +46,7 @@ class WindowActivatable : GLib.Object, Gedit.WindowActivatable
if (v != null)
{
- v.reparse();
+ v.reparse_now();
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]