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

`redraw` will let the key be discarded #5216

Closed
Yggdroot opened this issue Nov 13, 2019 · 0 comments

Comments

@Yggdroot
Copy link

@Yggdroot Yggdroot commented Nov 13, 2019

Describe the bug
redraw will let the key be discarded

To Reproduce
test.vim

func! Filter(winid, key)
    echom v:mouse_winid v:mouse_lnum v:mouse_col
    if a:key == "\<Esc>"
        call popup_close(a:winid)
        redraw
    endif
    return 0
endf

func! Filter2(winid, key)
    echom v:mouse_winid v:mouse_lnum v:mouse_col
    if a:key == "\<Esc>"
        call popup_close(a:winid)
        redraw   " this redraw should be removed
    endif
    return 0
endf

let id = popup_create(bufnr('%'), {
            \ "title": "test",
            \ "line": 1,
            \ "maxheight": 5,
            \ "padding":   [0, 0, 0, 1],
            \ "scrollbar": 0,
            \ "mapping":   1,
            \ "zindex":    1,
            \ "filter" :   "Filter"
            \})

call win_execute(id, "setlocal nu")

let id2 = popup_create(bufnr('%'), {
            \ "title": "test",
            \ "line": 8,
            \ "maxheight": 5,
            \ "padding":   [0, 0, 0, 1],
            \ "scrollbar": 0,
            \ "mapping":   1,
            \ "zindex":    9,
            \ "filter" :   "Filter2"
            \})
call win_execute(id2, "setlocal nu")
echom id id2
  1. so %
  2. press <ESC>
  3. the two popup windows don't close at once, expected behavior is both are closed at once.
  4. if remove the redraw, the two popup windows are both closed.

Expected behavior
redraw does not affect the behavior.

Environment (please complete the following information):

  • Vim version [e.g. 8.1.2297]
  • OS: centos 7
  • Terminal: GNOME Terminal
Yggdroot added a commit to Yggdroot/LeaderF that referenced this issue Nov 13, 2019
@brammool brammool closed this in afe45b6 Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.