Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 17767:c75da1064e33 v8.1.1880
patch 8.1.1880: cannot show extra info for completion in a popup window
commit https://github.com/vim/vim/commit/576a4a6ff14da876d7c4418e5f27e926fcfa8d2a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 18 15:25:17 2019 +0200
patch 8.1.1880: cannot show extra info for completion in a popup window
Problem: Cannot show extra info for completion in a popup window.
Solution: Add the "popup" entry in 'completeopt'.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Aug 2019 15:30:06 +0200 |
parents | 65b89c9eb946 |
children | b6c82748f9e1 |
comparison
equal
deleted
inserted
replaced
17766:be00d5dad3f5 | 17767:c75da1064e33 |
---|---|
2191 call delete('Xtagfile') | 2191 call delete('Xtagfile') |
2192 call delete('XtestPreviewPopup') | 2192 call delete('XtestPreviewPopup') |
2193 call delete('Xheader.h') | 2193 call delete('Xheader.h') |
2194 endfunc | 2194 endfunc |
2195 | 2195 |
2196 func Test_popupmenu_info() | |
2197 let lines =<< trim END | |
2198 set completeopt+=preview,popup | |
2199 set completefunc=CompleteFuncDict | |
2200 | |
2201 func CompleteFuncDict(findstart, base) | |
2202 if a:findstart | |
2203 if col('.') > 10 | |
2204 return col('.') - 10 | |
2205 endif | |
2206 return 0 | |
2207 endif | |
2208 | |
2209 return { | |
2210 \ 'words': [ | |
2211 \ { | |
2212 \ 'word': 'aword', | |
2213 \ 'abbr': 'wrd', | |
2214 \ 'menu': 'extra text', | |
2215 \ 'info': 'words are cool', | |
2216 \ 'kind': 'W', | |
2217 \ 'user_data': 'test' | |
2218 \ }, | |
2219 \ { | |
2220 \ 'word': 'anotherword', | |
2221 \ 'abbr': 'anotwrd', | |
2222 \ 'menu': 'extra text', | |
2223 \ 'info': "other words are\ncooler than this and some more text\nto make wrap", | |
2224 \ 'kind': 'W', | |
2225 \ 'user_data': 'notest' | |
2226 \ }, | |
2227 \ { | |
2228 \ 'word': 'noinfo', | |
2229 \ 'abbr': 'noawrd', | |
2230 \ 'menu': 'extra text', | |
2231 \ 'info': 'no words here', | |
2232 \ 'kind': 'W', | |
2233 \ 'user_data': 'notest' | |
2234 \ }, | |
2235 \ { | |
2236 \ 'word': 'thatword', | |
2237 \ 'abbr': 'thatwrd', | |
2238 \ 'menu': 'extra text', | |
2239 \ 'info': 'that word is cool', | |
2240 \ 'kind': 'W', | |
2241 \ 'user_data': 'notest' | |
2242 \ }, | |
2243 \ ] | |
2244 \ } | |
2245 endfunc | |
2246 call setline(1, 'text text text text text text text ') | |
2247 END | |
2248 call writefile(lines, 'XtestInfoPopup') | |
2249 let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14}) | |
2250 call term_wait(buf, 50) | |
2251 | |
2252 call term_sendkeys(buf, "A\<C-X>\<C-U>") | |
2253 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {}) | |
2254 | |
2255 call term_sendkeys(buf, "\<C-N>") | |
2256 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_2', {}) | |
2257 | |
2258 call term_sendkeys(buf, "\<C-N>") | |
2259 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_3', {}) | |
2260 | |
2261 call term_sendkeys(buf, "\<C-N>\<C-N>") | |
2262 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_4', {}) | |
2263 | |
2264 call StopVimInTerminal(buf) | |
2265 call delete('XtestInfoPopup') | |
2266 endfunc | |
2267 | |
2196 " vim: shiftwidth=2 sts=2 | 2268 " vim: shiftwidth=2 sts=2 |