diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-30 18:40:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-30 18:40:53 +0200 |
commit | b42301247d85d60b64c2cc23f5cdf30da2342827 (patch) | |
tree | f60be158c0ce87af3b57f355dd7c9fb6fb1e3330 /src | |
parent | 89adc3a1371d211f7766f3dbc0975ecb2f862327 (diff) | |
download | vim-git-b42301247d85d60b64c2cc23f5cdf30da2342827.tar.gz |
patch 8.1.1426: no test for syntax highlight in popup windowv8.1.1426
Problem: No test for syntax highlight in popup window.
Solution: Add a screenshot test. Update associated documentation. Avoid
'buftype' being reset by setbufvar().
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/dumps/Test_popupwin_10.dump | 10 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_11.dump | 10 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 48 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 70 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_popupwin_10.dump b/src/testdir/dumps/Test_popupwin_10.dump new file mode 100644 index 000000000..2d80e0aa1 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_10.dump @@ -0,0 +1,10 @@ +>1+0&#ffffff0| @73 +|2| @73 +|3| @22|#+0#e000e06#5fd7ff255|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000#ffffff0@32 +|4| @22|i+0#00e0003#5fd7ff255|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @3| +0&#ffffff0@32 +|5| @22|{+0fd7ff255| @16| +0&#ffffff0@32 +|6| @22| +0fd7ff255@3|p|r|i|n|t|f|(|1+0#e000002&|2|3|)+0#0000000&|;| @1| +0&#ffffff0@32 +|7| @22|}+0fd7ff255| @16| +0&#ffffff0@32 +|8| @73 +|9| @73 +@57|1|,|1| @10|T|o|p| diff --git a/src/testdir/dumps/Test_popupwin_11.dump b/src/testdir/dumps/Test_popupwin_11.dump new file mode 100644 index 000000000..21460ddb8 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_11.dump @@ -0,0 +1,10 @@ +>1+0&#ffffff0| @73 +|2| @73 +|3| @18|#+0#e000e06#e0e0e08|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000#ffffff0@36 +|4| @18|i+0#00e0003#e0e0e08|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @3| +0&#ffffff0@36 +|5| @18|{+0&#e0e0e08| @16| +0&#ffffff0@36 +|6| @18| +0&#e0e0e08@3|p|r|i|n|t|f|(|5+0#e000002&|6|7|)+0#0000000&|;| @1| +0&#ffffff0@36 +|7| @18|}+0&#e0e0e08| @16| +0&#ffffff0@36 +|8| @73 +|9| @73 +@57|1|,|1| @10|T|o|p| diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 3e71c97ea..d92d8b12a 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -56,6 +56,54 @@ func Test_simple_popup() call delete('XtestPopup') endfunc +func Test_popup_with_syntax_win_execute() + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ "call setline(1, range(1, 100))", + \ "hi PopupColor ctermbg=lightblue", + \ "let winid = popup_create([", + \ "\\ '#include <stdio.h>',", + \ "\\ 'int main(void)',", + \ "\\ '{',", + \ "\\ ' printf(123);',", + \ "\\ '}',", + \ "\\], {'line': 3, 'col': 25, 'highlight': 'PopupColor'})", + \ "call win_execute(winid, 'set syntax=cpp')", + \], 'XtestPopup') + let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) + call VerifyScreenDump(buf, 'Test_popupwin_10', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestPopup') +endfunc + +func Test_popup_with_syntax_setbufvar() + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ "call setline(1, range(1, 100))", + \ "hi PopupColor ctermbg=lightgrey", + \ "let winid = popup_create([", + \ "\\ '#include <stdio.h>',", + \ "\\ 'int main(void)',", + \ "\\ '{',", + \ "\\ ' printf(567);',", + \ "\\ '}',", + \ "\\], {'line': 3, 'col': 21, 'highlight': 'PopupColor'})", + \ "call setbufvar(winbufnr(winid), '&syntax', 'cpp')", + \], 'XtestPopup') + let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) + call VerifyScreenDump(buf, 'Test_popupwin_11', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestPopup') +endfunc + func Test_popup_time() if !has('timers') return diff --git a/src/version.c b/src/version.c index fa42ac260..0420cb60b 100644 --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1426, +/**/ 1425, /**/ 1424, |