[gedit] Fix regression of cursor placement after snippet insertion
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fix regression of cursor placement after snippet insertion
- Date: Sat, 1 Aug 2009 20:54:58 +0000 (UTC)
commit 44e27e8427e99971cd0c20d61c9c925914e96ef2
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat Aug 1 22:54:51 2009 +0200
Fix regression of cursor placement after snippet insertion
This fixes a regression introduced by commit 6efd048. This previous fix
would always skip to the end placeholder even if there were other
placeholders present.
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 2f14736..658f954 100644
--- a/plugins/snippets/snippets/Document.py
+++ b/plugins/snippets/snippets/Document.py
@@ -501,10 +501,13 @@ class Document:
self.active_snippets.append(sn)
# Put cursor at first tab placeholder
- keys = filter(lambda x: x >= 0, sn.placeholders.keys())
-
+ keys = filter(lambda x: x > 0, sn.placeholders.keys())
+
if len(keys) == 0:
- buf.place_cursor(sn.begin_iter())
+ if 0 in sn.placeholders:
+ self.goto_placeholder(self.active_placeholder, sn.placeholders[0])
+ else:
+ buf.place_cursor(sn.begin_iter())
else:
self.goto_placeholder(self.active_placeholder, sn.placeholders[keys[0]])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]