This commit is contained in:
Philip Douglass 2017-03-09 22:55:55 +00:00 committed by GitHub
commit 0cf0535ce6
2 changed files with 5 additions and 4 deletions

View file

@ -48,11 +48,11 @@ class Entry:
if not short and self.journal.config['linewrap']: if not short and self.journal.config['linewrap']:
title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap']) title = textwrap.fill(date_str + " " + self.title, self.journal.config['linewrap'])
body = "\n".join([ body = "\n".join([
textwrap.fill((line + " ") if (len(line) == 0) else line, textwrap.fill(line,
self.journal.config['linewrap'], self.journal.config['linewrap'],
initial_indent="| ", initial_indent=self.journal.config['indent'] + " ",
subsequent_indent="| ", subsequent_indent=self.journal.config['indent'] + " ")
drop_whitespace=False) or self.journal.config['indent']
for line in self.body.rstrip(" \n").splitlines() for line in self.body.rstrip(" \n").splitlines()
]) ])
else: else:

View file

@ -29,6 +29,7 @@ class Journal(object):
'tagsymbols': '@', 'tagsymbols': '@',
'highlight': True, 'highlight': True,
'linewrap': 80, 'linewrap': 80,
'indent': "|"
} }
self.config.update(kwargs) self.config.update(kwargs)
# Set up date parser # Set up date parser