aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_ftplugin/lua.lua
diff options
context:
space:
mode:
authorJeremy Fleischman <jeremyfleischman@gmail.com>2025-04-30 04:20:39 -0700
committerGitHub <noreply@github.com>2025-04-30 04:20:39 -0700
commit272dba7f07f82f260567a792ae824e98c52e3709 (patch)
treee60f75e48dc0c7ea6818347c08119256ea513a2d /runtime/lua/vim/_ftplugin/lua.lua
parent0ab0cdb2dabc551f836851aa85d06e927c42d92a (diff)
downloadrneovim-272dba7f07f82f260567a792ae824e98c52e3709.tar.gz
rneovim-272dba7f07f82f260567a792ae824e98c52e3709.tar.bz2
rneovim-272dba7f07f82f260567a792ae824e98c52e3709.zip
fix(trust): support for trusting directories #33617
Problem: Directories that are "trusted" by `vim.secure.read()`, are not detectable later (they will prompt again). https://github.com/neovim/neovim/discussions/33587#discussioncomment-12925887 Solution: `vim.secure.read()` returns `true` if the user trusts a directory. Also fix other bugs: - If `f:read('*a')` returns `nil`, we treat that as a successful read of the file, and hash it. `f:read` returns `nil` for directories, but it's also documented as returning `nil` "if it cannot read data with the specified format". I reworked the implementation so we explicitly treat directories differently. Rather than hashing `nil` to put in the trust database, we now put "directory" in there explicitly*. - `vim.secure.trust` (used by `:trust`) didn't actually work for directories, as it would blindly read the contents of a netrw buffer and hash it. Now it uses the same codepath as `vim.secure.read`, and as a result, works correctly for directories.
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions