From b15b22fc73bed0629f0a95fdc1aa9f9160ad215c Mon Sep 17 00:00:00 2001 From: Andrey Starodubtsev Date: Wed, 12 Nov 2025 07:57:09 +0200 Subject: [PATCH] fix(trust): :trust command on Windows #36509 `:trust` command calculated SHA-256 on file content reading it as a text. While it doesn't matter on Unices, on Windows hash was calculated incorectly. SHA-256 for buffer content was calculated fine though. After this fix hashes in `%LOCALAPPDATA%/nvim-data/trust` are the same as in output of `sha256sum -t`. --- runtime/lua/vim/secure.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/lua/vim/secure.lua b/runtime/lua/vim/secure.lua index e5d567ba0c..a2884f84dc 100644 --- a/runtime/lua/vim/secure.lua +++ b/runtime/lua/vim/secure.lua @@ -47,7 +47,7 @@ local function compute_hash(fullpath, bufnr) end else do - local f = io.open(fullpath, 'r') + local f = io.open(fullpath, 'rb') if not f then return nil, nil end