From a805d34f123bc8add01bd44ad28f0baf57710083 Mon Sep 17 00:00:00 2001 From: David Elentok <3david@gmail.com> Date: Tue, 14 May 2024 18:15:13 +0300 Subject: Initial commit --- lua/encrypt/helpers.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lua/encrypt/helpers.lua (limited to 'lua/encrypt/helpers.lua') diff --git a/lua/encrypt/helpers.lua b/lua/encrypt/helpers.lua new file mode 100644 index 0000000..37a96b3 --- /dev/null +++ b/lua/encrypt/helpers.lua @@ -0,0 +1,13 @@ +---@return string +local function getPassword() + local password = vim.b["password"] + if password == nil then + password = vim.fn.inputsecret("Enter password: ") + vim.b["password"] = password + end + return password +end + +local ENCRYPTED_PREFIX = "# <<>>" + +return { getPassword = getPassword, ENCRYPTED_PREFIX = ENCRYPTED_PREFIX } -- cgit v1.2.3