From 20b7da7245f72d732b57538ee64f3ed16dbd6fec Mon Sep 17 00:00:00 2001 From: dvklopfenstein Date: Thu, 18 Jul 2019 23:12:10 -0400 Subject: [PATCH] Add newline to appended note text after evaluating note text --- pubs/commands/note_cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubs/commands/note_cmd.py b/pubs/commands/note_cmd.py index 43aeb2f..6018876 100644 --- a/pubs/commands/note_cmd.py +++ b/pubs/commands/note_cmd.py @@ -21,11 +21,11 @@ def command(conf, args): ui = get_ui() rp = repo.Repository(conf) citekey = resolve_citekey(rp, args.citekey, ui=ui, exit_on_fail=True) - latestnote = '{TXT}\n'.format(TXT=args.append) notepath = rp.databroker.real_notepath(citekey, rp.conf['main']['note_extension']) - if latestnote is None: + if args.append is None: ui.edit_file(notepath, temporary=False) else: + latestnote = '{TXT}\n'.format(TXT=args.append) write_file(notepath, latestnote, 'a') NoteEvent(citekey).send() rp.close()