aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-01-13 15:18:47 +0800
committerGitHub <noreply@github.com>2025-01-13 15:18:47 +0800
commit2c16c849986794682a4776ff4ec100d00eeba5ca (patch)
treea62c94d13e0d37230de1f2897555c900ca229fdb /test/old/testdir
parent99c4bd2f698345fd5706e0ff5d6221b8d3848cfb (diff)
downloadrneovim-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/old/testdir')
-rw-r--r--test/old/testdir/test_popup.vim33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim
index 31cfc2d096..e4abf978ab 100644
--- a/test/old/testdir/test_popup.vim
+++ b/test/old/testdir/test_popup.vim
@@ -1519,6 +1519,39 @@ func Test_pum_highlights_match()
call StopVimInTerminal(buf)
endfunc
+func Test_pum_highlights_match_with_abbr()
+ CheckScreendump
+ let lines =<< trim END
+ 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 ctermfg=6 ctermbg=7
+ hi PmenuMatch ctermfg=4 ctermbg=225
+ END
+ call writefile(lines, 'Xscript', 'D')
+ let buf = RunVimInTerminal('-S Xscript', {})
+ call TermWait(buf)
+ call term_sendkeys(buf, "i\<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "foo")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_19', {})
+
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+ call TermWait(buf)
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_pum_user_abbr_hlgroup()
CheckScreendump
let lines =<< trim END