From e6057b3c13f004477f4963f3cdf054e5ca1bf2f4 Mon Sep 17 00:00:00 2001 From: kongjun Date: Tue, 29 Apr 2025 04:05:35 +0000 Subject: feat: lock the encrypted file to read-only mode to avoid unintended corruption --- lua/encrypt/decrypt.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'lua/encrypt/decrypt.lua') diff --git a/lua/encrypt/decrypt.lua b/lua/encrypt/decrypt.lua index 2ae4e2a..72e93c3 100644 --- a/lua/encrypt/decrypt.lua +++ b/lua/encrypt/decrypt.lua @@ -20,6 +20,7 @@ local function decrypt() end vim.fn.timer_start(0, function() + vim.bo.modifiable = true vim.api.nvim_buf_set_lines(0, 0, -1, false, decrypted_lines) vim.bo.modified = false end) -- cgit v1.2.3