Use a specific 'qutebrowser_editor_' prefix for <C-e> instead of 'tmp'.

Why does this matter? In my vimrc I have this:

	" When using dwb <C-e>; 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'
This commit is contained in:
Martin Tournoij 2015-05-29 02:07:20 +02:00
parent 534dbfc4c2
commit c76221c14e

View File

@ -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: