This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
locallibmodal=require'libmodal'
-- function which is called whenever the user presses a button
localfunctionfooMode()
-- append to the input history, the latest button press
localuserInput=string.char(
-- the input is a character number
vim.g.fooModeInput
)
ifuserInput==''then
vim.api.nvim_command"echom 'You cant leave using <Esc>.'"
elseifuserInput=='q'then
-- if the user presses 'q', libmodal will exit the mode