Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent updates breaks compatibility with vim-libmodal by Iron-E #42

Open
sjacobsson opened this issue May 20, 2022 · 0 comments
Open

Recent updates breaks compatibility with vim-libmodal by Iron-E #42

sjacobsson opened this issue May 20, 2022 · 0 comments

Comments

@sjacobsson
Copy link

I use IronE's vim-libmodal to define a "scrollmode" where J and K are mapped to smoothie#upwards() and smoothie#downwards() respectively. This stopped working a couple of weeks ago.
I put this in my init.vim to reproduce the bug:

let g:plugged_home = '~/.vim/plugged'
call plug#begin(g:plugged_home)
    Plug 'Iron-E/vim-libmodal'
    Plug 'terryma/vim-smooth-scroll'
call plug#end()

let g:smoothie_no_default_mappings = 1 

nnoremap <Leader>s :call <sid>scrollMode()<CR>
nnoremap g^U :call smoothie#upwards()<CR>
nnoremap g^D :call smoothie#downwards()<CR>
let s:scrollModeRecurse = 0
let s:scrollModeCombos = {
        \'j': 'normal ^E',
        \'J': 'normal g^D',
        \'k': 'normal ^Y',
        \'K': 'normal g^U'
        \}
function! s:scrollMode()
        let s:scrollModeRecurse += 1
        call libmodal#Enter('SCROLLING', s:scrollModeCombos)
        let s:scrollModeRecurse -= 1
endfunction

Expected behaviour:
Pressing s puts me in scrollmode. Pressing J smoothly scrolls me down half a page and K smoothly scrolls me up half a page.

Actual behaviour:
Pressing s puts me in scrollmode. Pressing J once doesn't do anything. Pressing J twice unsmoothly scrolls me up a page.

If I revert vim-smoothie back to commit 10fd0aa, the bug is no longer present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant