Commit 99b91fea authored by Jacek Sowiński's avatar Jacek Sowiński

Append %d and %t to default list_format

parent 9f0d658a
...@@ -15,7 +15,7 @@ auto_creation_date = 1 ...@@ -15,7 +15,7 @@ auto_creation_date = 1
hide_tags = id,p,ical hide_tags = id,p,ical
indent = 0 indent = 0
list_limit = -1 list_limit = -1
list_format = |%I| %x %{(}p{)} %c %s %k list_format = |%I| %x %{(}p{)} %c %s %k %{due:}d %{t:}t
[tags] [tags]
tag_start = t tag_start = t
......
...@@ -74,7 +74,7 @@ class _Config: ...@@ -74,7 +74,7 @@ class _Config:
'hide_tags': 'id,p,ical', 'hide_tags': 'id,p,ical',
'indent': '0', 'indent': '0',
'list_limit': '-1', 'list_limit': '-1',
'list_format': '|%I| %x %{(}p{)} %c %s %k', 'list_format': '|%I| %x %{(}p{)} %c %s %k %{due:}d %{t:}t',
}, },
'tags': { 'tags': {
......
...@@ -163,15 +163,14 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter): ...@@ -163,15 +163,14 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
# todo ID pre-filled with 1 or 2 spaces if its length is <3 # todo ID pre-filled with 1 or 2 spaces if its length is <3
placeholders['I'] = lambda t: filler(str(self.todolist.number(t)), 3) placeholders['I'] = lambda t: filler(str(self.todolist.number(t)), 3)
# list of tags (spaces) without due: and t: # list of tags (spaces) without hidden ones and due: and t:
placeholders['k'] = lambda t: ' '.join([u('{}:{}').format(tag, value) placeholders['k'] = lambda t: ' '.join([u('{}:{}').format(tag, value)
for tag, value in sorted(p_todo.tags()) if for tag, value in sorted(p_todo.tags()) if
tag not in config().hidden_tags() + [config().tag_start(), config().tag_due()]]) tag not in config().hidden_tags() + [config().tag_start(), config().tag_due()]])
# list of tags (spaces) # list of all tags (spaces)
placeholders['K'] = lambda t: ' '.join([u('{}:{}').format(tag, value) placeholders['K'] = lambda t: ' '.join([u('{}:{}').format(tag, value)
for tag, value in sorted(p_todo.tags()) if for tag, value in sorted(p_todo.tags())])
tag not in config().hidden_tags()])
# priority # priority
placeholders['p'] = lambda t: t.priority() if t.priority() else '' placeholders['p'] = lambda t: t.priority() if t.priority() else ''
...@@ -225,7 +224,8 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter): ...@@ -225,7 +224,8 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
text_lim = line_width - len(p_todo_str) - 4 text_lim = line_width - len(p_todo_str) - 4
p_todo_str = re.sub(re.escape(repl), repl[:text_lim] + '...', p_todo_str) p_todo_str = re.sub(re.escape(repl), repl[:text_lim] + '...', p_todo_str)
return p_todo_str # cut trailing space left when last placeholder in p_todo_str is empty and its predecessor is not
return p_todo_str.rstrip()
class PrettyPrinterAlignFilter(PrettyPrinterFilter): class PrettyPrinterAlignFilter(PrettyPrinterFilter):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment