Skip to content

Commit

Permalink
feat(lua): checks if user give input and if not warns the user and asks
Browse files Browse the repository at this point in the history
input again until user gives something
  • Loading branch information
aikooo7 committed Dec 5, 2023
1 parent 16d9d70 commit ed909c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/funnyfiles/utils.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ed909c8

Please sign in to comment.