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/helpers.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua/encrypt/helpers.lua') diff --git a/lua/encrypt/helpers.lua b/lua/encrypt/helpers.lua index ff8baef..a2ccc51 100644 --- a/lua/encrypt/helpers.lua +++ b/lua/encrypt/helpers.lua @@ -15,4 +15,10 @@ end local getPassword = getPasswordFactory() local ENCRYPTED_PREFIX = "# <<>>" -return { getPassword = getPassword, ENCRYPTED_PREFIX = ENCRYPTED_PREFIX } +---@enum buftype +local BUFTYPE = { + encrypted = 1, + plaintext = 2, +} + +return { getPassword = getPassword, ENCRYPTED_PREFIX = ENCRYPTED_PREFIX, BUFTYPE = BUFTYPE} -- cgit v1.2.3