Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 17811:b5499bf22a97 v8.1.1902
patch 8.1.1902: cannot have an info popup without a border
Commit: https://github.com/vim/vim/commit/bd483b3f577ee1af7c8c8bf440f5d81613336975
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 21 15:13:41 2019 +0200
patch 8.1.1902: cannot have an info popup without a border
Problem: Cannot have an info popup without a border.
Solution: Add the "border" item to 'completepopup'.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Aug 2019 15:15:03 +0200 |
parents | 4bd21046902b |
children | 9ec2526c04c5 |
comparison
equal
deleted
inserted
replaced
17810:e67a904463f9 | 17811:b5499bf22a97 |
---|---|
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() | 2196 func Get_popupmenu_lines() |
2197 CheckScreendump | |
2198 | |
2199 let lines =<< trim END | 2197 let lines =<< trim END |
2200 set completeopt+=preview,popup | 2198 set completeopt+=preview,popup |
2201 set completefunc=CompleteFuncDict | 2199 set completefunc=CompleteFuncDict |
2202 hi InfoPopup ctermbg=yellow | 2200 hi InfoPopup ctermbg=yellow |
2203 set completepopup=height:4,highlight:InfoPopup | |
2204 | 2201 |
2205 func CompleteFuncDict(findstart, base) | 2202 func CompleteFuncDict(findstart, base) |
2206 if a:findstart | 2203 if a:findstart |
2207 if col('.') > 10 | 2204 if col('.') > 10 |
2208 return col('.') - 10 | 2205 return col('.') - 10 |
2247 \ ] | 2244 \ ] |
2248 \ } | 2245 \ } |
2249 endfunc | 2246 endfunc |
2250 call setline(1, 'text text text text text text text ') | 2247 call setline(1, 'text text text text text text text ') |
2251 END | 2248 END |
2249 return lines | |
2250 endfunc | |
2251 | |
2252 func Test_popupmenu_info_border() | |
2253 CheckScreendump | |
2254 | |
2255 let lines = Get_popupmenu_lines() | |
2256 call add(lines, 'set completepopup=height:4,highlight:InfoPopup') | |
2252 call writefile(lines, 'XtestInfoPopup') | 2257 call writefile(lines, 'XtestInfoPopup') |
2258 | |
2253 let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14}) | 2259 let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14}) |
2254 call term_wait(buf, 50) | 2260 call term_wait(buf, 50) |
2255 | 2261 |
2256 call term_sendkeys(buf, "A\<C-X>\<C-U>") | 2262 call term_sendkeys(buf, "A\<C-X>\<C-U>") |
2257 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {}) | 2263 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {}) |
2267 | 2273 |
2268 call StopVimInTerminal(buf) | 2274 call StopVimInTerminal(buf) |
2269 call delete('XtestInfoPopup') | 2275 call delete('XtestInfoPopup') |
2270 endfunc | 2276 endfunc |
2271 | 2277 |
2278 func Test_popupmenu_info_noborder() | |
2279 CheckScreendump | |
2280 | |
2281 let lines = Get_popupmenu_lines() | |
2282 call add(lines, 'set completepopup=height:4,border:off') | |
2283 call writefile(lines, 'XtestInfoPopupNb') | |
2284 | |
2285 let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14}) | |
2286 call term_wait(buf, 50) | |
2287 | |
2288 call term_sendkeys(buf, "A\<C-X>\<C-U>") | |
2289 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_nb_1', {}) | |
2290 | |
2291 call StopVimInTerminal(buf) | |
2292 call delete('XtestInfoPopupNb') | |
2293 endfunc | |
2294 | |
2272 " vim: shiftwidth=2 sts=2 | 2295 " vim: shiftwidth=2 sts=2 |