From ed909c867a036365a545643c64078afc7181c0ec Mon Sep 17 00:00:00 2001 From: aikooo7 Date: Sat, 2 Dec 2023 17:48:39 +0000 Subject: [PATCH] feat(lua): checks if user give input and if not warns the user and asks input again until user gives something --- lua/funnyfiles/utils.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/funnyfiles/utils.lua b/lua/funnyfiles/utils.lua index 9bb3095..d938c3f 100644 --- a/lua/funnyfiles/utils.lua +++ b/lua/funnyfiles/utils.lua @@ -1,7 +1,13 @@ local M = {} function M.input(message) + repeat local user_input = vim.fn.input(message) + if user_input ~= "" then + print("Input should not be empty") + end + + until user_input ~= "" return user_input end