diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-03-09 08:07:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-09 05:07:36 -0800 |
commit | ce0fddf5ae334f0c79dcd95b379999e11df1486b (patch) | |
tree | 9d431a4941ec1aa03cb4bccb5ab170ea91749135 /runtime/lua/vim/treesitter/_range.lua | |
parent | 46d4d420e56bb0b4aec696fd8164bffde02d2758 (diff) | |
download | rneovim-ce0fddf5ae334f0c79dcd95b379999e11df1486b.tar.gz rneovim-ce0fddf5ae334f0c79dcd95b379999e11df1486b.tar.bz2 rneovim-ce0fddf5ae334f0c79dcd95b379999e11df1486b.zip |
feat: try to recover from missing tempdir #22573
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432 #9833 https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
mkdir foo
TMPDIR=./foo nvim
:echo tempname()
!rm -r foo
:echo tempname()
tempname() still uses the foo path even though it was deleted.
Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.
Rejected in Vim for performance reasons:
https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0J
https://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.
Fixes #1432
Fixes #9833
Fixes #11250
Related: stdpath("run") f50135a32e11c535e1dc3a8e9460c5b4e640ee86
Diffstat (limited to 'runtime/lua/vim/treesitter/_range.lua')
0 files changed, 0 insertions, 0 deletions