comparison src/testdir/test_popupwin.vim @ 18613:fa995154904e v8.1.2300

patch 8.1.2300: redraw breaks going through list of popup windows Commit: https://github.com/vim/vim/commit/afe45b68a67769a61b44a96b0ffe3bfce4e9316e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 13 22:35:19 2019 +0100 patch 8.1.2300: redraw breaks going through list of popup windows Problem: Redraw breaks going through list of popup windows. Solution: Use different flags for popup_reset_handled(). (closes https://github.com/vim/vim/issues/5216)
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 Nov 2019 22:45:03 +0100
parents f249b44039e0
children 3089b422b9dc
comparison
equal deleted inserted replaced
18612:29a5273d0270 18613:fa995154904e
2947 call assert_equal({}, popup_getpos(win1)) 2947 call assert_equal({}, popup_getpos(win1))
2948 call assert_equal({}, popup_getpos(win2)) 2948 call assert_equal({}, popup_getpos(win2))
2949 call assert_equal({}, popup_getpos(win3)) 2949 call assert_equal({}, popup_getpos(win3))
2950 endfunc 2950 endfunc
2951 2951
2952 func Test_popupwin_filter_redraw()
2953 " Create two popups with a filter that closes the popup when typing "0".
2954 " Both popups should close, even though the redraw also calls
2955 " popup_reset_handled()
2956
2957 func CloseFilter(winid, key)
2958 if a:key == '0'
2959 call popup_close(a:winid)
2960 redraw
2961 endif
2962 return 0 " pass the key
2963 endfunc
2964
2965 let id1 = popup_create('first one', #{
2966 \ line: 1,
2967 \ col: 1,
2968 \ filter: 'CloseFilter',
2969 \ })
2970 let id2 = popup_create('second one', #{
2971 \ line: 9,
2972 \ col: 1,
2973 \ filter: 'CloseFilter',
2974 \ })
2975 call assert_equal(1, popup_getpos(id1).line)
2976 call assert_equal(9, popup_getpos(id2).line)
2977
2978 call feedkeys('0', 'xt')
2979 call assert_equal({}, popup_getpos(id1))
2980 call assert_equal({}, popup_getpos(id2))
2981
2982 call popup_clear()
2983 delfunc CloseFilter
2984 endfunc
2985
2952 " vim: shiftwidth=2 sts=2 2986 " vim: shiftwidth=2 sts=2