Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 32782:abf161ce0c77 v9.0.1707
patch 9.0.1707: Cannot wrap around in popup_filter_menu()
Commit: https://github.com/vim/vim/commit/badeedd913d9d6456ad8087911d024fd36800743
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Aug 13 19:25:28 2023 +0200
patch 9.0.1707: Cannot wrap around in popup_filter_menu()
Problem: Cannot wrap around in popup_filter_menu()
Solution: Allow to wrap around by default
Currently, it is not possible, to wrap around at the end of the list
using e.g. down (and go back to the top) or up at the beginning of the
list and go directly to the last item. This is not consistent behaviour
with e.g. how the pum-menu currently works, so let's just allow this.
Also adjust tests about it.
closes: #12689
closes: #12693
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 Aug 2023 19:30:04 +0200 |
parents | 19a9b8fe3b85 |
children | 28c2f681ec33 |
comparison
equal
deleted
inserted
replaced
32781:52ca35ed2907 | 32782:abf161ce0c77 |
---|---|
1792 map j k | 1792 map j k |
1793 | 1793 |
1794 let winid = ShowMenu(" ", 1) | 1794 let winid = ShowMenu(" ", 1) |
1795 let winid = ShowMenu("j \<CR>", 2) | 1795 let winid = ShowMenu("j \<CR>", 2) |
1796 let winid = ShowMenu("JjK \<CR>", 2) | 1796 let winid = ShowMenu("JjK \<CR>", 2) |
1797 let winid = ShowMenu("jjjjjj ", 3) | 1797 " wraps around |
1798 let winid = ShowMenu("jjjjjj ", 1) | |
1798 let winid = ShowMenu("kkk ", 1) | 1799 let winid = ShowMenu("kkk ", 1) |
1799 let winid = ShowMenu("x", -1) | 1800 let winid = ShowMenu("x", -1) |
1800 let winid = ShowMenu("X", -1) | 1801 let winid = ShowMenu("X", -1) |
1801 let winid = ShowMenu("\<Esc>", -1) | 1802 let winid = ShowMenu("\<Esc>", -1) |
1802 let winid = ShowMenu("\<C-C>", -1) | 1803 let winid = ShowMenu("\<C-C>", -1) |
3051 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_1', {}) | 3052 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_1', {}) |
3052 | 3053 |
3053 call term_sendkeys(buf, "jjj") | 3054 call term_sendkeys(buf, "jjj") |
3054 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_2', {}) | 3055 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_2', {}) |
3055 | 3056 |
3056 " if the cursor is the bottom line, it stays at the bottom line. | 3057 " the cursor wraps around at the bottom |
3057 call term_sendkeys(buf, repeat("j", 20)) | 3058 call term_sendkeys(buf, repeat("j", 20)) |
3058 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_3', {}) | 3059 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_3', {}) |
3059 | 3060 |
3061 " if the cursor is again at the bottom line | |
3062 call term_sendkeys(buf, repeat("j", 2)) | |
3063 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_3a', {}) | |
3064 | |
3060 call term_sendkeys(buf, "kk") | 3065 call term_sendkeys(buf, "kk") |
3061 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_4', {}) | 3066 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_4', {}) |
3062 | 3067 |
3063 call term_sendkeys(buf, "k") | 3068 call term_sendkeys(buf, "k") |
3064 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_5', {}) | 3069 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_5', {}) |
3065 | 3070 |
3066 " if the cursor is in the top line, it stays in the top line. | 3071 " the cursor wraps around at the top |
3067 call term_sendkeys(buf, repeat("k", 20)) | 3072 call term_sendkeys(buf, repeat("k", 20)) |
3068 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_6', {}) | 3073 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_6', {}) |
3074 | |
3075 " the cursor at the top of the window again | |
3076 call term_sendkeys(buf, repeat("k", 3)) | |
3077 call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_6a', {}) | |
3069 | 3078 |
3070 " close the menu popupwin. | 3079 " close the menu popupwin. |
3071 call term_sendkeys(buf, " ") | 3080 call term_sendkeys(buf, " ") |
3072 | 3081 |
3073 " clean up | 3082 " clean up |