Skip to content

Commit 07b340e

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents f6c6992 + b2fa54a commit 07b340e

6 files changed

Lines changed: 60 additions & 33 deletions

File tree

src/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,9 @@ SYS_DELMENU_FILE = $(DESTDIR)$(SCRIPTLOC)/delmenu.vim
10761076
### Name of the bugreport file target.
10771077
SYS_BUGR_FILE = $(DESTDIR)$(SCRIPTLOC)/bugreport.vim
10781078

1079+
### Name of the rgb.txt file target.
1080+
SYS_RGB_FILE = $(DESTDIR)$(SCRIPTLOC)/rgb.txt
1081+
10791082
### Name of the file type detection file target.
10801083
SYS_FILETYPE_FILE = $(DESTDIR)$(SCRIPTLOC)/filetype.vim
10811084

@@ -2184,6 +2187,9 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \
21842187
chmod $(VIMSCRIPTMOD) $(MSWIN_FILE)
21852188
$(INSTALL_DATA) $(SCRIPTSOURCE)/evim.vim $(EVIM_FILE)
21862189
chmod $(VIMSCRIPTMOD) $(EVIM_FILE)
2190+
# install the rgb.txt file
2191+
$(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(SYS_RGB_FILE)
2192+
chmod $(VIMSCRIPTMOD) $(SYS_RGB_FILE)
21872193
# install the bugreport file
21882194
$(INSTALL_DATA) $(SCRIPTSOURCE)/bugreport.vim $(SYS_BUGR_FILE)
21892195
chmod $(VIMSCRIPTMOD) $(SYS_BUGR_FILE)
@@ -2380,7 +2386,7 @@ install-icons:
23802386
if test -d $(ICON48PATH) -a -w $(ICON48PATH) \
23812387
-a ! -f $(ICON48PATH)/gvim.png; then \
23822388
$(INSTALL_DATA) $(SCRIPTSOURCE)/vim48x48.png $(ICON48PATH)/gvim.png; \
2383-
if test -z "$(DESTDIR)" -a -x $(GTK_UPDATE_ICON_CACHE) \
2389+
if test -z "$(DESTDIR)" -a -x "$(GTK_UPDATE_ICON_CACHE)" \
23842390
-a -w $(ICONTHEMEPATH) \
23852391
-a -f $(ICONTHEMEPATH)/index.theme; then \
23862392
$(GTK_UPDATE_ICON_CACHE) -q $(ICONTHEMEPATH); \
@@ -2398,7 +2404,7 @@ install-icons:
23982404
$(INSTALL_DATA) $(SCRIPTSOURCE)/vim.desktop \
23992405
$(SCRIPTSOURCE)/gvim.desktop \
24002406
$(DESKTOPPATH); \
2401-
if test -z "$(DESTDIR)" -a -x $(UPDATE_DESKTOP_DATABASE); then \
2407+
if test -z "$(DESTDIR)" -a -x "$(UPDATE_DESKTOP_DATABASE)"; then \
24022408
$(UPDATE_DESKTOP_DATABASE) -q $(DESKTOPPATH); \
24032409
fi \
24042410
fi

src/eval.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ static char *e_listarg = N_("E686: Argument of %s must be a List");
9898
static char *e_listdictarg = N_("E712: Argument of %s must be a List or Dictionary");
9999
static char *e_listreq = N_("E714: List required");
100100
static char *e_dictreq = N_("E715: Dictionary required");
101+
#ifdef FEAT_QUICKFIX
101102
static char *e_stringreq = N_("E928: String required");
103+
#endif
102104
static char *e_toomanyarg = N_("E118: Too many arguments for function: %s");
103105
static char *e_dictkey = N_("E716: Key not present in Dictionary: %s");
104106
static char *e_funcexts = N_("E122: Function %s already exists, add ! to replace it");
@@ -10406,6 +10408,8 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
1040610408
f_ch_open(typval_T *argvars, typval_T *rettv)
1040710409
{
1040810410
rettv->v_type = VAR_CHANNEL;
10411+
if (check_restricted() || check_secure())
10412+
return;
1040910413
rettv->vval.v_channel = channel_open_func(argvars);
1041010414
}
1041110415

@@ -15095,6 +15099,8 @@ f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
1509515099
f_job_start(typval_T *argvars, typval_T *rettv)
1509615100
{
1509715101
rettv->v_type = VAR_JOB;
15102+
if (check_restricted() || check_secure())
15103+
return;
1509815104
rettv->vval.v_job = job_start(argvars);
1509915105
}
1510015106

@@ -16838,8 +16844,6 @@ check_connection(void)
1683816844
#endif
1683916845

1684016846
#ifdef FEAT_CLIENTSERVER
16841-
static void remote_common(typval_T *argvars, typval_T *rettv, int expr);
16842-
1684316847
static void
1684416848
remote_common(typval_T *argvars, typval_T *rettv, int expr)
1684516849
{
@@ -20708,6 +20712,8 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
2070820712
char_u *callback;
2070920713
dict_T *dict;
2071020714

20715+
if (check_secure())
20716+
return;
2071120717
if (argvars[2].v_type != VAR_UNKNOWN)
2071220718
{
2071320719
if (argvars[2].v_type != VAR_DICT

src/screen.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7855,7 +7855,7 @@ screen_start_highlight(int attr)
78557855
else if (aep != NULL && cterm_normal_fg_bold &&
78567856
#ifdef FEAT_TERMTRUECOLOR
78577857
(p_guicolors ?
7858-
(aep->ae_u.cterm.fg_rgb != INVALCOLOR):
7858+
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR):
78597859
#endif
78607860
(t_colors > 1 && aep->ae_u.cterm.fg_color)
78617861
#ifdef FEAT_TERMTRUECOLOR
@@ -7884,9 +7884,9 @@ screen_start_highlight(int attr)
78847884
#ifdef FEAT_TERMTRUECOLOR
78857885
if (p_guicolors)
78867886
{
7887-
if (aep->ae_u.cterm.fg_rgb != INVALCOLOR)
7887+
if (aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
78887888
term_fg_rgb_color(aep->ae_u.cterm.fg_rgb);
7889-
if (aep->ae_u.cterm.bg_rgb != INVALCOLOR)
7889+
if (aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
78907890
term_bg_rgb_color(aep->ae_u.cterm.bg_rgb);
78917891
}
78927892
else
@@ -7946,8 +7946,8 @@ screen_stop_highlight(void)
79467946
if (aep != NULL &&
79477947
#ifdef FEAT_TERMTRUECOLOR
79487948
(p_guicolors ?
7949-
(aep->ae_u.cterm.fg_rgb != INVALCOLOR ||
7950-
aep->ae_u.cterm.bg_rgb != INVALCOLOR):
7949+
(aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR ||
7950+
aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR):
79517951
#endif
79527952
(aep->ae_u.cterm.fg_color || aep->ae_u.cterm.bg_color)
79537953
#ifdef FEAT_TERMTRUECOLOR
@@ -8004,9 +8004,9 @@ screen_stop_highlight(void)
80048004
#ifdef FEAT_TERMTRUECOLOR
80058005
if (p_guicolors)
80068006
{
8007-
if (cterm_normal_fg_gui_color != INVALCOLOR)
8007+
if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
80088008
term_fg_rgb_color(cterm_normal_fg_gui_color);
8009-
if (cterm_normal_bg_gui_color != INVALCOLOR)
8009+
if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
80108010
term_bg_rgb_color(cterm_normal_bg_gui_color);
80118011
}
80128012
else
@@ -8040,8 +8040,8 @@ reset_cterm_colors(void)
80408040
/* set Normal cterm colors */
80418041
#ifdef FEAT_TERMTRUECOLOR
80428042
if (p_guicolors ?
8043-
(cterm_normal_fg_gui_color != INVALCOLOR
8044-
|| cterm_normal_bg_gui_color != INVALCOLOR):
8043+
(cterm_normal_fg_gui_color != (long_u)INVALCOLOR
8044+
|| cterm_normal_bg_gui_color != (long_u)INVALCOLOR):
80458045
(cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0))
80468046
#else
80478047
if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)
@@ -8988,7 +8988,7 @@ can_clear(char_u *p)
89888988
|| gui.in_use
89898989
#endif
89908990
#ifdef FEAT_TERMTRUECOLOR
8991-
|| (p_guicolors && cterm_normal_bg_gui_color != INVALCOLOR)
8991+
|| (p_guicolors && cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
89928992
#endif
89938993
|| cterm_normal_bg_color == 0 || *T_UT != NUL));
89948994
}

src/syntax.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8789,9 +8789,9 @@ hl_combine_attr(int char_attr, int prim_attr)
87898789
if (spell_aep->ae_u.cterm.bg_color > 0)
87908790
new_en.ae_u.cterm.bg_color = spell_aep->ae_u.cterm.bg_color;
87918791
#ifdef FEAT_TERMTRUECOLOR
8792-
if (spell_aep->ae_u.cterm.fg_rgb != INVALCOLOR)
8792+
if (spell_aep->ae_u.cterm.fg_rgb != (long_u)INVALCOLOR)
87938793
new_en.ae_u.cterm.fg_rgb = spell_aep->ae_u.cterm.fg_rgb;
8794-
if (spell_aep->ae_u.cterm.bg_rgb != INVALCOLOR)
8794+
if (spell_aep->ae_u.cterm.bg_rgb != (long_u)INVALCOLOR)
87958795
new_en.ae_u.cterm.bg_rgb = spell_aep->ae_u.cterm.bg_rgb;
87968796
#endif
87978797
}
@@ -9546,8 +9546,8 @@ highlight_gui_started(void)
95469546
static void
95479547
gui_do_one_color(
95489548
int idx,
9549-
int do_menu, /* TRUE: might set the menu font */
9550-
int do_tooltip) /* TRUE: might set the tooltip font */
9549+
int do_menu UNUSED, /* TRUE: might set the menu font */
9550+
int do_tooltip UNUSED) /* TRUE: might set the tooltip font */
95519551
{
95529552
int didit = FALSE;
95539553

src/term.c

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,8 @@ static struct builtin_term builtin_termcaps[] =
793793
# endif
794794
# endif
795795

796-
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS) || defined(__EMX__) || defined(FEAT_TERMTRUECOLOR)
797-
{(int)KS_NAME, "xterm"},
798-
# endif
799796
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS) || defined(__EMX__)
797+
{(int)KS_NAME, "xterm"},
800798
{(int)KS_CE, IF_EB("\033[K", ESC_STR "[K")},
801799
{(int)KS_AL, IF_EB("\033[L", ESC_STR "[L")},
802800
# ifdef TERMINFO
@@ -861,6 +859,11 @@ static struct builtin_term builtin_termcaps[] =
861859
{(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
862860
{(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
863861
{(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")},
862+
# ifdef FEAT_TERMTRUECOLOR
863+
/* These are printf strings, not terminal codes. */
864+
{(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
865+
{(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
866+
# endif
864867

865868
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
866869
{K_DOWN, IF_EB("\033O*B", ESC_STR "O*B")},
@@ -944,10 +947,6 @@ static struct builtin_term builtin_termcaps[] =
944947
{TERMCAP2KEY('F', 'Q'), IF_EB("\033[57;*~", ESC_STR "[57;*~")}, /* F36 */
945948
{TERMCAP2KEY('F', 'R'), IF_EB("\033[58;*~", ESC_STR "[58;*~")}, /* F37 */
946949
# endif
947-
# ifdef FEAT_TERMTRUECOLOR
948-
{(int)KS_8F, IF_EB("\033[38;2;%lu;%lu;%lum", ESC_STR "[38;2;%lu;%lu;%lum")},
949-
{(int)KS_8B, IF_EB("\033[48;2;%lu;%lu;%lum", ESC_STR "[48;2;%lu;%lu;%lum")},
950-
# endif
951950

952951
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS)
953952
/*
@@ -1272,6 +1271,7 @@ struct rgbcolor_table_S {
12721271
char_u *color_name;
12731272
guicolor_T color;
12741273
};
1274+
12751275
static struct rgbcolor_table_S rgb_table[] = {
12761276
{(char_u *)"black", RGB(0x00, 0x00, 0x00)},
12771277
{(char_u *)"blue", RGB(0x00, 0x00, 0xD4)},
@@ -1354,7 +1354,7 @@ termtrue_mch_get_color(char_u *name)
13541354
else
13551355
{
13561356
/* Check if the name is one of the colors we know */
1357-
for (i = 0; i < sizeof(rgb_table) / sizeof(rgb_table[0]); i++)
1357+
for (i = 0; i < (int)(sizeof(rgb_table) / sizeof(rgb_table[0])); i++)
13581358
if (STRICMP(name, rgb_table[i].color_name) == 0)
13591359
return rgb_table[i].color;
13601360
}
@@ -1382,9 +1382,8 @@ termtrue_mch_get_color(char_u *name)
13821382
{
13831383
int len;
13841384
int pos;
1385-
char *color;
13861385

1387-
fgets(line, LINE_LEN, fd);
1386+
(void)fgets(line, LINE_LEN, fd);
13881387
len = strlen(line);
13891388

13901389
if (len <= 1 || line[len-1] != '\n')
@@ -1396,9 +1395,7 @@ termtrue_mch_get_color(char_u *name)
13961395
if (i != 3)
13971396
continue;
13981397

1399-
color = line + pos;
1400-
1401-
if (STRICMP(color, name) == 0)
1398+
if (STRICMP(line + pos, name) == 0)
14021399
{
14031400
fclose(fd);
14041401
return (guicolor_T) RGB(r, g, b);
@@ -2803,9 +2800,11 @@ term_bg_rgb_color(long_u rgb)
28032800
static void
28042801
term_rgb_color(char_u *s, long_u rgb)
28052802
{
2806-
char buf[7+3*3+2+1+1];
2803+
#define MAX_COLOR_STR_LEN 100
2804+
char buf[MAX_COLOR_STR_LEN];
28072805

2808-
sprintf(buf, (char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
2806+
vim_snprintf(buf, MAX_COLOR_STR_LEN,
2807+
(char *)s, RED(rgb), GREEN(rgb), BLUE(rgb));
28092808
OUT_STR(buf);
28102809
}
28112810
#endif

src/version.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,22 @@ static char *(features[]) =
768768

769769
static int included_patches[] =
770770
{ /* Add new patch number below this line */
771+
/**/
772+
1778,
773+
/**/
774+
1777,
775+
/**/
776+
1776,
777+
/**/
778+
1775,
779+
/**/
780+
1774,
781+
/**/
782+
1773,
783+
/**/
784+
1772,
785+
/**/
786+
1771,
771787
/**/
772788
1770,
773789
/**/

0 commit comments

Comments
 (0)