diff options
| author | kongjun <kongjun18@outlook.com> | 2025-04-29 04:05:35 +0000 |
|---|---|---|
| committer | kongjun <kongjun18@outlook.com> | 2025-04-29 06:55:46 +0000 |
| commit | e6057b3c13f004477f4963f3cdf054e5ca1bf2f4 (patch) | |
| tree | 3fc89e4d9234a7f6b9b230204c27375849b97685 /lua/encrypt/init.lua | |
| parent | 6a88d734bdb4660945923c3f4a38c14e45847c2c (diff) | |
| download | encrypt.nvim-e6057b3c13f004477f4963f3cdf054e5ca1bf2f4.tar.gz | |
feat: lock the encrypted file to read-only mode to avoid unintended corruption
Diffstat (limited to 'lua/encrypt/init.lua')
| -rw-r--r-- | lua/encrypt/init.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/encrypt/init.lua b/lua/encrypt/init.lua index 53fc259..cfa1aa6 100644 --- a/lua/encrypt/init.lua +++ b/lua/encrypt/init.lua @@ -5,7 +5,7 @@ local helpers = require("encrypt.helpers") local function setup() vim.api.nvim_create_user_command("X", function() - setupBuffer() + setupBuffer(helpers.BUFTYPE.decrypted) encrypt() end, {}) @@ -13,7 +13,7 @@ local function setup() callback = function() local first_line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] if first_line == helpers.ENCRYPTED_PREFIX then - setupBuffer() + setupBuffer(helpers.BUFTYPE.encrypted) decrypt() end end, |
