[gedit] Allow tabstops cycling with selection
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Allow tabstops cycling with selection
- Date: Wed, 15 Aug 2012 07:20:27 +0000 (UTC)
commit 463595838b7a0a30fa2f88b07b9e27085da7a901
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Wed Aug 15 09:20:10 2012 +0200
Allow tabstops cycling with selection
plugins/snippets/snippets/document.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/snippets/snippets/document.py b/plugins/snippets/snippets/document.py
index 81e5030..e1de12a 100644
--- a/plugins/snippets/snippets/document.py
+++ b/plugins/snippets/snippets/document.py
@@ -637,9 +637,13 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
if not self.view.get_editable():
return False
- snippets = Library().from_tag(trigger, self.language_id)
buf = self.view.get_buffer()
+ if buf.get_has_selection():
+ return False
+
+ snippets = Library().from_tag(trigger, self.language_id)
+
if snippets:
if len(snippets) == 1:
return self.apply_snippet(snippets[0], bounds[0], bounds[1])
@@ -819,8 +823,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
if not (state & Gdk.ModifierType.CONTROL_MASK) and \
not (state & Gdk.ModifierType.MOD1_MASK) and \
- event.keyval in self.TAB_KEY_VAL and \
- not view.get_buffer().get_has_selection():
+ event.keyval in self.TAB_KEY_VAL:
if not state & Gdk.ModifierType.SHIFT_MASK:
return self.run_snippet()
else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]