From 5c2f9dcf7c657c328bcbf914a9877e5368ef3054 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Fri, 11 Nov 2022 08:19:09 -0500 Subject: [PATCH] Add a suffix to temporary files when composing toot in an editor This enable suffix-based configuration in your editor when editing toots. Closes #219 --- toot/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toot/utils.py b/toot/utils.py index 5d26d6e..7053fe4 100644 --- a/toot/utils.py +++ b/toot/utils.py @@ -102,7 +102,7 @@ def editor_input(editor, initial_text): """Lets user input text using an editor.""" initial_text = (initial_text or "") + EDITOR_INPUT_INSTRUCTIONS - with tempfile.NamedTemporaryFile() as f: + with tempfile.NamedTemporaryFile(suffix='.toot') as f: f.write(initial_text.encode()) f.flush()