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.
-- Imports
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.
vim.g.fooModeExit=true
end
end
-- Tell libmodal not to exit the mode immediately.