Mercurial > vim
diff src/terminal.c @ 11755:12fa6072977a v8.0.0760
patch 8.0.0760: terminal window colors wrong with 'termguicolors'
commit https://github.com/vim/vim/commit/065f41c8143271d1af7c8f5d14a59e29bf7ecdf3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 23 18:07:56 2017 +0200
patch 8.0.0760: terminal window colors wrong with 'termguicolors'
Problem: Terminal window colors wrong with 'termguicolors'.
Solution: Add 'termguicolors' support.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 23 Jul 2017 18:15:03 +0200 |
parents | f7c2473796b7 |
children | 74abb6c84984 |
line wrap: on
line diff
--- a/src/terminal.c +++ b/src/terminal.c @@ -33,7 +33,6 @@ * while, if the terminal window is visible, the screen contents is drawn. * * TODO: - * - color for 'termguicolors' * - cursor flickers when moving the cursor * - set buffer options to be scratch, hidden, nomodifiable, etc. * - set buffer name to command, add (1) to avoid duplicates. @@ -731,8 +730,14 @@ cell2attr(VTermScreenCell *cell) #ifdef FEAT_TERMGUICOLORS if (p_tgc) { - /* TODO */ + guicolor_T fg, bg; + + fg = gui_get_rgb_color_cmn(cell->fg.red, cell->fg.green, cell->fg.blue); + bg = gui_get_rgb_color_cmn(cell->bg.red, cell->bg.green, cell->bg.blue); + + return get_tgc_attr_idx(attr, fg, bg); } + else #endif { return get_cterm_attr_idx(attr, color2index(&cell->fg),