comparison src/channel.c @ 13626:ab89131d30e0 v8.0.1685

patch 8.0.1685: can't set ANSI colors of a terminal window commit https://github.com/vim/vim/commit/f59c6e8cee092433d325ba21a107654a8d84f776 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 10 15:59:11 2018 +0200 patch 8.0.1685: can't set ANSI colors of a terminal window Problem: Can't set ANSI colors of a terminal window. Solution: Add term_setansicolors(), term_getansicolors() and g:term_ansi_colors. (Andy Massimino, closes #2747)
author Christian Brabandt <cb@256bit.org>
date Tue, 10 Apr 2018 16:00:09 +0200
parents ea4f2a8040b4
children 1feeefd8cddb
comparison
equal deleted inserted replaced
13625:2caac884de74 13626:ab89131d30e0
4800 if (!(supported2 & JO2_TERM_KILL)) 4800 if (!(supported2 & JO2_TERM_KILL))
4801 break; 4801 break;
4802 opt->jo_set2 |= JO2_TERM_KILL; 4802 opt->jo_set2 |= JO2_TERM_KILL;
4803 opt->jo_term_kill = get_tv_string_chk(item); 4803 opt->jo_term_kill = get_tv_string_chk(item);
4804 } 4804 }
4805 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
4806 else if (STRCMP(hi->hi_key, "ansi_colors") == 0)
4807 {
4808 int n = 0;
4809 listitem_T *li;
4810 long_u rgb[16];
4811
4812 if (!(supported2 & JO2_ANSI_COLORS))
4813 break;
4814
4815 if (item == NULL || item->v_type != VAR_LIST
4816 || item->vval.v_list == NULL)
4817 {
4818 EMSG2(_(e_invargval), "ansi_colors");
4819 return FAIL;
4820 }
4821
4822 li = item->vval.v_list->lv_first;
4823 for (; li != NULL && n < 16; li = li->li_next, n++)
4824 {
4825 char_u *color_name;
4826 guicolor_T guicolor;
4827
4828 color_name = get_tv_string_chk(&li->li_tv);
4829 if (color_name == NULL)
4830 return FAIL;
4831
4832 guicolor = GUI_GET_COLOR(color_name);
4833 if (guicolor == INVALCOLOR)
4834 return FAIL;
4835
4836 rgb[n] = GUI_MCH_GET_RGB(guicolor);
4837 }
4838
4839 if (n != 16 || li != NULL)
4840 {
4841 EMSG2(_(e_invargval), "ansi_colors");
4842 return FAIL;
4843 }
4844
4845 opt->jo_set2 |= JO2_ANSI_COLORS;
4846 memcpy(opt->jo_ansi_colors, rgb, sizeof(rgb));
4847 }
4848 # endif
4805 #endif 4849 #endif
4806 else if (STRCMP(hi->hi_key, "env") == 0) 4850 else if (STRCMP(hi->hi_key, "env") == 0)
4807 { 4851 {
4808 if (!(supported2 & JO2_ENV)) 4852 if (!(supported2 & JO2_ENV))
4809 break; 4853 break;