mirror of
https://github.com/Iron-E/nvim-libmodal
synced 2024-11-10 13:10:29 +00:00
16 lines
424 B
VimL
16 lines
424 B
VimL
" Function which is called every time the user presses a button.
|
||
function! s:fooMode() abort
|
||
let l:userInput = nr2char(g:fooModeInput)
|
||
|
||
if l:userInput == ''
|
||
echom 'You cant leave using <Esc>.'
|
||
elseif l:userInput == 'q'
|
||
let g:fooModeExit = v:true
|
||
endif
|
||
endfunction
|
||
|
||
" Tell the mode not to exit automatically.
|
||
let g:fooModeExit = v:false
|
||
" Begin the mode.
|
||
lua require('libmodal').mode.enter('FOO', 's:fooMode', true)
|