diff options
| author | kongjun <kongjun18@outlook.com> | 2025-05-06 10:14:39 +0000 |
|---|---|---|
| committer | kongjun <kongjun18@outlook.com> | 2025-05-06 18:53:58 +0800 |
| commit | a9e7d700eb546800e3d341bc53667964ac821a38 (patch) | |
| tree | bf21093fa70c8ed8014e70f4841714d622ec651e /lua/encrypt/decrypt.lua | |
| parent | c7a16c626a0379d9304e0337348affb4bde9ba4e (diff) | |
| download | encrypt.nvim-a9e7d700eb546800e3d341bc53667964ac821a38.tar.gz | |
feat: handle the case where the inputsecret() is cancelled
Diffstat (limited to 'lua/encrypt/decrypt.lua')
| -rw-r--r-- | lua/encrypt/decrypt.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/encrypt/decrypt.lua b/lua/encrypt/decrypt.lua index de49019..a1d6b66 100644 --- a/lua/encrypt/decrypt.lua +++ b/lua/encrypt/decrypt.lua @@ -12,6 +12,10 @@ end local function decrypt() local password = helpers.getPassword() + if not password then + vim.notify("Password can not be empty", vim.log.levels.ERROR) + return + end local encrypted_lines = vim.api.nvim_buf_get_lines(0, 1, -1, false) local decrypted_lines = decrypt_lines(encrypted_lines, password) if vim.v.shell_error ~= 0 then |
