You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim-libmodal/examples/lua/supress-exit.lua

17 lines
385 B
Lua

This file contains invisible Unicode characters!

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.

local libmodal = require('libmodal')
function fooMode()
local userInput = string.char(
vim.api.nvim_get_var('fooModeInput')
)
if userInput == '' then
vim.api.nvim_command("echom 'You cant leave using <Esc>.'")
elseif userInput == 'q' then
vim.api.nvim_set_var('fooModeExit', true)
end
end
vim.api.nvim_set_var('fooModeExit', 0)
libmodal.mode.enter('FOO', fooMode, true)