under_fg_rgb = char_aep->ae_u.cterm.fg_rgb;
#endif
new_en.ae_u.cterm.fg_color = blend_cterm_colors(
- popup_aep->ae_u.cterm.fg_color, popup_bg_rgb,
+ popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
under_fg, under_fg_rgb, fallback_fg_rgb, blend);
}
// Approximate cterm bg by blending with the underlying bg
under_fg_rgb = char_aep->ae_u.cterm.fg_rgb;
#endif
new_en.ae_u.cterm.fg_color = blend_cterm_colors(
- popup_aep->ae_u.cterm.fg_color, popup_bg_rgb,
+ popup_aep->ae_u.cterm.bg_color, popup_bg_rgb,
under_fg, under_fg_rgb, fallback_fg_rgb, blend);
}
// Approximate cterm bg by blending with the underlying bg
--- /dev/null
+>u+0&#ffffff0|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|u|n|╔+0#0000001#ff40ff14|═@21|╗| +0#0000000#ffffff0@33
+|u|n|║+0#0000001#ff40ff14|e+0#ff40ff14&|r| |u|n|d|e|r| |u|n|d|e|r| @7|║+0#0000001&| +0#0000000#ffffff0@33
+|u|n|║+0#0000001#ff40ff14|e+0#ff40ff14&|P+0#0000001&|o|p|u|p|e+0#ff40ff14&|P+0#0000001&|o|p|u|p|e+0#ff40ff14&|r| @7|║+0#0000001&| +0#0000000#ffffff0@33
+|u|n|║+0#0000001#ff40ff14|e+0#ff40ff14&|r| |u|n|d|e|r| |u|n|d|e|r| @7|║+0#0000001&| +0#0000000#ffffff0@33
+|u|n|║+0#0000001#ff40ff14|e+0#ff40ff14&|r| |u|n|d|e|r| |u|n|d|e|r| @7|║+0#0000001&| +0#0000000#ffffff0@33
+|u|n|╚+0#0000001#ff40ff14|═@21|╝| +0#0000000#ffffff0@33
+|u|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|u|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|u|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|~+0#4040ff13&| @58
+| +0#0000000&@41|1|,|1| @10|A|l@1|
>1+0&#ffffff0| @73
|2| @73
-|3| @7|f+0#ff404010#87d7ff255|o@1| +0#d75f5f255&@1|b+0#0000001&|a|r| +0#0000000#ffffff0@57
-|4| @7|b+0#0000001#87d7ff255|a|z| +0#0000000&@4| +0&#ffffff0@57
+|3| @7|f+0#ff404010#87d7ff255|o@1| +0#5fafd7255&@1|b+0#0000001&|a|r| +0#0000000#ffffff0@57
+|4| @7|b+0#0000001#87d7ff255|a|z| +0#5fafd7255&@4| +0#0000000#ffffff0@57
|5| @73
|6| @73
|7| @73
--- /dev/null
+|i+0&#ffffff0|t|e|m> @55
+|i+0#0000001#e0e0e08|t|e|m|r+0#e0e0e08&| |u|n|d|e|r| |u|n|d|e+0#0000000#ffffff0|r| @42
+|a+0#0000001#ff40ff14|n|o|t|h|e|r| |i|t|e|m|u+0#ff40ff14&|n|d|e+0#0000000#ffffff0|r| @42
+|a+0#0000001#ff40ff14|n|d| |a| |l|a|s|t| |o|n|e|d+0#ff40ff14&|e+0#0000000#ffffff0|r| @42
+|u|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|u|n|d|e|r| |u|n|d|e|r| |u|n|d|e|r| @42
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|~| @58
+|~| @58
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@29|1|,|5| @10|A|l@1|
call StopVimInTerminal(buf)
endfunc
+func Test_pum_opacity_lowcolor()
+ CheckScreendump
+
+ let lines =<< trim END
+ set pumopt=opacity:50
+ call setline(1, '')
+ for i in range(5)
+ call append(line('$'), 'under under under')
+ endfor
+ normal gg
+ inoremap <F5> <Cmd>call complete(col('.'),
+ \ ['item', 'another item', 'and a last one'])<CR>
+ END
+ call writefile(lines, 'XtestPumOpacityLowcolor', 'D')
+ let buf = RunVimInTerminal('-S XtestPumOpacityLowcolor', #{rows: 12, cols: 60, tcolors: 16})
+
+ call term_sendkeys(buf, "i\<F5>")
+ call TermWait(buf, 100)
+ call VerifyScreenDump(buf, 'Test_pum_opacity_lowcolor', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_popup_sandbox()
call assert_fails('sandbox call popup_create("hello", {})', 'E48:')
call assert_fails('sandbox call popup_setoptions(1, {})', 'E48:')
call StopVimInTerminal(buf)
endfunc
+func Test_popup_opacity_lowcolor()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, repeat(['under under under'], 10))
+ call popup_create('Popup Popup', #{
+ \ line: 2, col: 3,
+ \ border: [1, 1, 1, 1],
+ \ padding: [1, 1, 1 ,1],
+ \ minwidth: 20,
+ \ minheight: 2,
+ \ opacity: 70,
+ \ })
+ END
+ call writefile(lines, 'XtestPopupOpacityLowcolor', 'D')
+ let buf = RunVimInTerminal('-S XtestPopupOpacityLowcolor', #{rows: 12, cols: 60, tcolors: 16})
+ call VerifyScreenDump(buf, 'Test_popup_opacity_lowcolor', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_popup_image_update()
CheckFeature image
" "no_clean" - if non-zero then remove "--clean" from the command
" "cmd" - run any other command, e.g. "xxd" (used in xxd test)
" "env" - additional environment variables, e.g. $TERM variable
+" "tcolor" - terminal color number (256 by default)
func RunVimInTerminal(arguments, options)
" If Vim doesn't exit a swap file remains, causing other tests to fail.
" Remove it here.
split
vsplit
- " Always do this with 256 colors and a light background.
- set t_Co=256 background=light
+ " Always do this with light background.
+ set background=light
+ " and 256 colors by default
+ let tcolors = get(a:options, 'tcolors', 256)
+ let &t_Co=tcolors
hi Normal ctermfg=NONE ctermbg=NONE
" Make the window 20 lines high and 75 columns, unless told otherwise or
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 837,
/**/
836,
/**/