diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-01-13 15:18:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-13 15:18:47 +0800 |
commit | 2c16c849986794682a4776ff4ec100d00eeba5ca (patch) | |
tree | a62c94d13e0d37230de1f2897555c900ca229fdb /test/functional/ui/popupmenu_spec.lua | |
parent | 99c4bd2f698345fd5706e0ff5d6221b8d3848cfb (diff) | |
download | rneovim-2c16c849986794682a4776ff4ec100d00eeba5ca.tar.gz rneovim-2c16c849986794682a4776ff4ec100d00eeba5ca.tar.bz2 rneovim-2c16c849986794682a4776ff4ec100d00eeba5ca.zip |
vim-patch:9.1.1011: popupmenu internal error with some abbr in completion item (#31988)
Problem: Popup menu internal error with some abbr in completion item.
Solution: Don't compute attributes when there is no corresponding text.
Reduce indent in pum_redraw() while at it (zeertzjq).
fixes: vim/vim#16427
closes: vim/vim#16435
https://github.com/vim/vim/commit/3a0cc36c69744a7727ce34311d39d2d9d8ddc6f9
Diffstat (limited to 'test/functional/ui/popupmenu_spec.lua')
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index b763f4ba6c..5e883d1a92 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -5415,6 +5415,45 @@ describe('builtin popupmenu', function() feed('<C-E><Esc>') end) + -- oldtest: Test_pum_highlights_match_with_abbr() + it('can highlight matched text with abbr', function() + exec([[ + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return { + \ 'words': [ + \ { 'word': 'foobar', 'abbr': "foobar\t\t!" }, + \ { 'word': 'foobaz', 'abbr': "foobaz\t\t!" }, + \]} + endfunc + + set omnifunc=Omni_test + set completeopt=menuone,noinsert + hi PmenuMatchSel guifg=Blue guibg=Grey + hi PmenuMatch guifg=Blue guibg=Plum1 + ]]) + feed('i<C-X><C-O>') + screen:expect([[ + ^ | + {s:foobar ! }{1: }| + {n:foobaz ! }{1: }| + {1:~ }|*16 + {2:-- }{5:match 1 of 2} | + ]]) + feed('foo') + screen:expect([[ + foo^ | + {ms:foo}{s:bar ! }{1: }| + {mn:foo}{n:baz ! }{1: }| + {1:~ }|*16 + {2:-- }{5:match 1 of 2} | + ]]) + + feed('<C-E><Esc>') + end) + -- oldtest: Test_pum_user_abbr_hlgroup() it('custom abbr_hlgroup override', function() exec([[ |