From c76221c14e15e5339e06e793d98c964a494dbf72 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Fri, 29 May 2015 02:07:20 +0200 Subject: [PATCH] Use a specific 'qutebrowser_editor_' prefix for instead of 'tmp'. Why does this matter? In my vimrc I have this: " When using dwb ; assume markdown, and don't store in viminfo since these are " temporary files autocmd BufRead,BufNewFile /home/martin/.cache/dwb/edit* setlocal ft=markdown viminfo= I would like to do the same with qutebrowser, but this is not possible with a file name like '/tmp/tmpSJsgSG4' --- qutebrowser/misc/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/misc/editor.py b/qutebrowser/misc/editor.py index 81323bf5e..fc27b922c 100644 --- a/qutebrowser/misc/editor.py +++ b/qutebrowser/misc/editor.py @@ -122,7 +122,8 @@ class ExternalEditor(QObject): raise ValueError("Already editing a file!") self._text = text try: - self._oshandle, self._filename = tempfile.mkstemp(text=True) + self._oshandle, self._filename = tempfile.mkstemp(text=True, + prefix='qutebrowser_editor_') if text: encoding = config.get('general', 'editor-encoding') with open(self._filename, 'w', encoding=encoding) as f: