[gedit-latex] Use snippets format for the autocompletion of builtin commands
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-latex] Use snippets format for the autocompletion of builtin commands
- Date: Sun, 11 Nov 2012 09:47:00 +0000 (UTC)
commit dd27e00c37830aa267ba36d9e7297fd8aade7799
Author: Aleksei Lissitsin <aldgracil gmail com>
Date: Sun Nov 11 10:45:50 2012 +0100
Use snippets format for the autocompletion of builtin commands
latex/latex/completion.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/latex/latex/completion.py b/latex/latex/completion.py
index bca2c7c..3e4a5d9 100644
--- a/latex/latex/completion.py
+++ b/latex/latex/completion.py
@@ -248,13 +248,13 @@ class PrefixModelParser(object):
label = command.name
snippet = "\\" + command.name
- for argument in command.children:
+ for idx, argument in enumerate(command.children):
if type(argument) is MandatoryArgument:
label += "{<span color='%s'>%s</span>}" % (self.__light_foreground, argument.label)
- snippet += "{${%s}}" % argument.label
+ snippet += "{${%s:%s}}" % (idx+1, argument.label)
elif type(argument) is OptionalArgument:
label += "[<span color='%s'>%s</span>]" % (self.__light_foreground, argument.label)
- snippet += "[${%s}]" % argument.label
+ snippet += "[${%s:%s}]" % (idx+1, argument.label)
if command.package:
label += " <small><b>%s</b></small>" % command.package
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]