Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 16884:59e4148c0c73 v8.1.1443
patch 8.1.1443: popup window padding and border not implemented yet
commit https://github.com/vim/vim/commit/2fd8e35e16e502c98045c4b4e09a91eca840fb97
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 1 20:16:48 2019 +0200
patch 8.1.1443: popup window padding and border not implemented yet
Problem: Popup window padding and border not implemented yet.
Solution: Implement padding and border. Add core position and size to
popup_getpos().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jun 2019 20:30:05 +0200 |
parents | 998603a243d7 |
children | 2bd51fdcc793 |
comparison
equal
deleted
inserted
replaced
16883:c7c1b4618acb | 16884:59e4148c0c73 |
---|---|
52 call VerifyScreenDump(buf, 'Test_popupwin_06', {}) | 52 call VerifyScreenDump(buf, 'Test_popupwin_06', {}) |
53 | 53 |
54 " clean up | 54 " clean up |
55 call StopVimInTerminal(buf) | 55 call StopVimInTerminal(buf) |
56 call delete('XtestPopup') | 56 call delete('XtestPopup') |
57 endfunc | |
58 | |
59 func Test_popup_with_border_and_padding() | |
60 if !CanRunVimInTerminal() | |
61 return | |
62 endif | |
63 call writefile([ | |
64 \ "call setline(1, range(1, 100))", | |
65 \ "call popup_create('hello border', {'line': 2, 'col': 3, 'border': []})", | |
66 \ "call popup_create('hello padding', {'line': 2, 'col': 23, 'padding': []})", | |
67 \ "call popup_create('hello both', {'line': 2, 'col': 43, 'border': [], 'padding': []})", | |
68 \ "call popup_create('border TL', {'line': 6, 'col': 3, 'border': [1, 0, 0, 4]})", | |
69 \ "call popup_create('paddings', {'line': 6, 'col': 23, 'padding': [1, 3, 2, 4]})", | |
70 \], 'XtestPopupBorder') | |
71 let buf = RunVimInTerminal('-S XtestPopupBorder', {'rows': 15}) | |
72 call VerifyScreenDump(buf, 'Test_popupwin_20', {}) | |
73 | |
74 " clean up | |
75 call StopVimInTerminal(buf) | |
76 call delete('XtestPopupBorder') | |
77 | |
78 let with_border_or_padding = { | |
79 \ 'line': 2, | |
80 \ 'core_line': 3, | |
81 \ 'col': 3, | |
82 \ 'core_col': 4, | |
83 \ 'width': 14, | |
84 \ 'core_width': 12, | |
85 \ 'height': 3, | |
86 \ 'core_height': 1, | |
87 \ 'visible': 1} | |
88 let winid = popup_create('hello border', {'line': 2, 'col': 3, 'border': []})", | |
89 call assert_equal(with_border_or_padding, popup_getpos(winid)) | |
90 | |
91 let winid = popup_create('hello paddng', {'line': 2, 'col': 3, 'padding': []}) | |
92 call assert_equal(with_border_or_padding, popup_getpos(winid)) | |
93 | |
94 let winid = popup_create('hello both', {'line': 3, 'col': 8, 'border': [], 'padding': []}) | |
95 call assert_equal({ | |
96 \ 'line': 3, | |
97 \ 'core_line': 5, | |
98 \ 'col': 8, | |
99 \ 'core_col': 10, | |
100 \ 'width': 14, | |
101 \ 'core_width': 10, | |
102 \ 'height': 5, | |
103 \ 'core_height': 1, | |
104 \ 'visible': 1}, popup_getpos(winid)) | |
57 endfunc | 105 endfunc |
58 | 106 |
59 func Test_popup_with_syntax_win_execute() | 107 func Test_popup_with_syntax_win_execute() |
60 if !CanRunVimInTerminal() | 108 if !CanRunVimInTerminal() |
61 return | 109 return |