Thursday, August 13, 2020

popup menu / does not seem to work ?

Hi,

running -

vim test.vim -S test.vim

my <C-Up> / <C-Down> do not work in the popup, but they do in the normal mapping.

Does anyone know why or what I am doing wrong ?

thx for all things vim,
-m

test.vim file -

" test.vim
function s:popup_filter(winid, key) abort
    if a:key ==# "\<C-Up>"
        call win_execute(a:winid, "normal! \<c-y>")
    elseif a:key ==# "\<C-Down>"
        call win_execute(a:winid, "normal! \<c-e>")
    elseif a:key ==# "\<C-k>"
        call win_execute(a:winid, "normal! \<c-y>")
    elseif a:key ==# "\<C-j>"
        call win_execute(a:winid, "normal! \<c-e>")
    elseif a:key ==# 'q'
        call popup_close(a:winid)
    endif
    return v:true
endfunction

call range(1, 20)
        \ ->map({_, i -> string(i)})
        \ ->popup_create({
        \   'close': 'button',
        \   'minwidth': 50,
        \   'maxwidth': 50,
        \   'minheight': 5,
        \   'maxheight': 5,
        \   'border': [],
        \   'mapping': v:false,
        \   'filter': funcref('s:popup_filter'),
        \   'filtermode': 'n'
        \ })

noremap <C-Up>   :echomsg "CTRL-Up"<CR>
noremap <C-Down> :echomsg "CTRL-Down"<CR>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/c923a600-d4d4-4e5a-8f95-53dff49b2778n%40googlegroups.com.

No comments: