mirror of
https://github.com/Iron-E/nvim-libmodal
synced 2024-11-18 15:25:49 +00:00
22 lines
595 B
VimL
22 lines
595 B
VimL
" This is a counter.
|
|
let s:fooModeRecurse = 1
|
|
|
|
" This is a function to increase the counter every time that 'z' is pressed.
|
|
function! s:fooMode() abort
|
|
let l:userInput = nr2char(g:foo{s:fooModeRecurse}ModeInput)
|
|
|
|
if l:userInput == 'z'
|
|
let s:fooModeRecurse += 1
|
|
call s:enter()
|
|
let s:fooModeRecurse -= 1
|
|
endif
|
|
endfunction
|
|
|
|
" This function wraps around calling libmodal so that the other function can recursively call it.
|
|
function! s:enter() abort
|
|
call luaeval("require('libmodal').mode.enter('FOO'.._A, 's:fooMode')", s:fooModeRecurse)
|
|
endfunction
|
|
|
|
" Begin the recursion.
|
|
call s:enter()
|