Thursday, August 13, 2020

Re: popup menu / does not seem to work ?

Hi,

I resolved this by adding this to my .vimrc -

  exec "set <xHome>=\e[1;*H"
  exec "set <xEnd>=\e[1;*F"

Not exactly sure why but its all good :-)

thx and take care,
-m

On Thursday, August 13, 2020 at 2:08:59 PM UTC-4 mckel...@gmail.com wrote:
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/36e1de5a-f633-43e9-8bbf-80c1df582682n%40googlegroups.com.

No comments: