[latexila] SyncTeX: forward search on Ctrl + left click
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] SyncTeX: forward search on Ctrl + left click
- Date: Sun, 9 Sep 2012 22:15:42 +0000 (UTC)
commit 725e75c181fb6c4ffb725e4b9a86f4d33f482ea2
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Sun Sep 9 19:13:06 2012 +0200
SyncTeX: forward search on Ctrl + left click
src/document_view.vala | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index 8c55659..85291c4 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -100,6 +100,9 @@ public class DocumentView : Gtk.SourceView
// spell checking
if (_editor_settings.get_boolean ("spell-checking"))
activate_spell_checking ();
+
+ // forward search
+ button_release_event.connect (on_button_release_event);
}
public void scroll_to_cursor (double margin = 0.25)
@@ -209,6 +212,20 @@ public class DocumentView : Gtk.SourceView
spell.detach ();
}
+ private bool on_button_release_event (Gdk.EventButton event)
+ {
+ // Forward search on Ctrl + left click
+ if (event.button == 1 &&
+ Gdk.ModifierType.CONTROL_MASK in event.state)
+ {
+ Synctex synctex = new Synctex ();
+ synctex.forward_search (this.buffer as Document);
+ }
+
+ // propagate the event further
+ return false;
+ }
+
private bool on_backspace (Gdk.EventKey event)
{
// See GDK_KEY_BackSpace in gdk/gdkkeysyms.h (not available in Vala)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]