Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 17634:6e6a84993444 v8.1.1814
patch 8.1.1814: a long title in a popup window overflows
commit https://github.com/vim/vim/commit/5d458a7b3d1819d51bff6f3682b81bf943c7e9d0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 4 21:12:15 2019 +0200
patch 8.1.1814: a long title in a popup window overflows
Problem: A long title in a popup window overflows.
Solution: Truncate the title. (closes https://github.com/vim/vim/issues/4770)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Aug 2019 21:15:04 +0200 |
parents | 6146b10714de |
children | daa1dea1c1b3 |
comparison
equal
deleted
inserted
replaced
17633:a965a73ab797 | 17634:6e6a84993444 |
---|---|
1280 | 1280 |
1281 " Create a popup without title or border, a line of padding will be added to | 1281 " Create a popup without title or border, a line of padding will be added to |
1282 " put the title on. | 1282 " put the title on. |
1283 let lines =<< trim END | 1283 let lines =<< trim END |
1284 call setline(1, range(1, 20)) | 1284 call setline(1, range(1, 20)) |
1285 call popup_create(['one', 'two', 'another'], #{title: 'Title String'}) | 1285 let winid = popup_create(['one', 'two', 'another'], #{title: 'Title String'}) |
1286 END | 1286 END |
1287 call writefile(lines, 'XtestPopupTitle') | 1287 call writefile(lines, 'XtestPopupTitle') |
1288 let buf = RunVimInTerminal('-S XtestPopupTitle', #{rows: 10}) | 1288 let buf = RunVimInTerminal('-S XtestPopupTitle', #{rows: 10}) |
1289 call VerifyScreenDump(buf, 'Test_popupwin_title', {}) | 1289 call VerifyScreenDump(buf, 'Test_popupwin_title', {}) |
1290 | |
1291 call term_sendkeys(buf, ":call popup_setoptions(winid, #{maxwidth: 20, title: 'a very long title that is not going to fit'})\<CR>") | |
1292 call term_sendkeys(buf, ":\<CR>") | |
1293 call VerifyScreenDump(buf, 'Test_popupwin_longtitle_1', {}) | |
1294 | |
1295 call term_sendkeys(buf, ":call popup_setoptions(winid, #{border: []})\<CR>") | |
1296 call term_sendkeys(buf, ":\<CR>") | |
1297 call VerifyScreenDump(buf, 'Test_popupwin_longtitle_2', {}) | |
1290 | 1298 |
1291 " clean up | 1299 " clean up |
1292 call StopVimInTerminal(buf) | 1300 call StopVimInTerminal(buf) |
1293 call delete('XtestPopupTitle') | 1301 call delete('XtestPopupTitle') |
1294 | 1302 |