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
pull/226/head
Lars Kellogg-Stedman 2022-11-11 08:19:09 -05:00 zatwierdzone przez Ivan Habunek
rodzic 89585b6761
commit 5c2f9dcf7c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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