diff options
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/ui/util/editor.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libbe/ui/util/editor.py b/libbe/ui/util/editor.py index 83262e7..1a10fa4 100644 --- a/libbe/ui/util/editor.py +++ b/libbe/ui/util/editor.py @@ -56,6 +56,9 @@ def editor_string(comment=None, encoding=None): >>> os.environ["VISUAL"] = "echo baz > " >>> editor_string() u'baz\\n' + >>> os.environ["VISUAL"] = "echo 'baz\\n== Anything below this line will be ignored\\nHi' > " + >>> editor_string() + u'baz\\n' >>> del os.environ["EDITOR"] >>> del os.environ["VISUAL"] """ @@ -79,6 +82,7 @@ def editor_string(comment=None, encoding=None): os.system("%s %s" % (editor, fname)) output = libbe.util.encoding.get_file_contents( fname, encoding=encoding, decode=True) + output = trimmed_string(output) if output.rstrip('\n') == "": output = None finally: |