Open tmp.R files in readonly mode?
Hallo,
This is a feature request. Sometimes when I am debugging, I unintentionally edit the **R.tmp.R file, which can be annoying if I don't realize this, because then changes can be lost and I have to fix bugs again. Is it possible to enable a flag that allows to open these temporary files in read-only mode?
Thank you for Nvim-R! :)
Actually, the file should be immediately deleted after being sourced. See the source code of nvimcom:::source.and.clean:
function (f, ...)
{
on.exit(unlink(f))
source(f, ...)
}
You could write an auto command in your vimrc/init.vim to do something (echo a warning message, turn the buffer read-only...) if the file name ends in ".R.tmp.R", but this will not be necessary if we discover why the temporary file isn't being deleted.
But this is only relevant when I send the code to the console, right? I am tallking about the debugging scenario, where the source-files for the debugged functions are opened.