diff --git a/markdownrunner.py b/markdownrunner.py index 1a8a114..463820a 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -139,8 +139,12 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: import subprocess subprocess.run([editor, tmpfile.name]) # Read the file back + tmpfile.file.seek(0) new_hunk = [] for line in tmpfile.file.readlines(): + line = line.strip() + if line == '': + continue parts = line.split('\t', maxsplit=2) new_hunk.append(Command(user=parts[0],directory=parts[1],command=parts[2],context=None)) # Python has no goto for restarting, but we can recurse