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
This commit is contained in:
Lars Kellogg-Stedman 2022-11-11 08:19:09 -05:00 committed by Ivan Habunek
parent 89585b6761
commit 5c2f9dcf7c
1 changed files with 1 additions and 1 deletions

View File

@ -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()