Skip to content

Commit e7a1361

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 432411c + 5ea38d1 commit e7a1361

36 files changed

Lines changed: 223 additions & 97 deletions

runtime/autoload/dist/script.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ def DetectFromHashBang(firstline: string)
189189
elseif name =~ 'gforth\>'
190190
set ft=forth
191191

192+
# Icon
193+
elseif name =~ 'icon\>'
194+
set ft=icon
195+
192196
endif
193197
enddef
194198

src/channel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5338,7 +5338,7 @@ f_ch_info(typval_T *argvars, typval_T *rettv UNUSED)
53385338
return;
53395339

53405340
channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
5341-
if (channel != NULL && rettv_dict_alloc(rettv) != FAIL)
5341+
if (channel != NULL && rettv_dict_alloc(rettv) == OK)
53425342
channel_info(channel, rettv->vval.v_dict);
53435343
}
53445344

src/cmdexpand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
37663766
else
37673767
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
37683768

3769-
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))
3769+
if (rettv_list_alloc(rettv) == OK && pat != NULL)
37703770
{
37713771
int i;
37723772

src/digraph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,7 +2567,7 @@ ex_loadkeymap(exarg_T *eap)
25672567
vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s %s",
25682568
((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from,
25692569
((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].to);
2570-
(void)do_map(2, buf, MODE_LANGMAP, FALSE);
2570+
(void)do_map(MAPTYPE_NOREMAP, buf, MODE_LANGMAP, FALSE);
25712571
}
25722572

25732573
p_cpo = save_cpo;
@@ -2598,7 +2598,7 @@ keymap_unload(void)
25982598
for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
25992599
{
26002600
vim_snprintf((char *)buf, sizeof(buf), "<buffer> %s", kp[i].from);
2601-
(void)do_map(1, buf, MODE_LANGMAP, FALSE);
2601+
(void)do_map(MAPTYPE_UNMAP, buf, MODE_LANGMAP, FALSE);
26022602
}
26032603
keymap_clear(&curbuf->b_kmap_ga);
26042604

src/evalbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ f_getbufinfo(typval_T *argvars, typval_T *rettv)
680680
int sel_bufloaded = FALSE;
681681
int sel_bufmodified = FALSE;
682682

683-
if (rettv_list_alloc(rettv) != OK)
683+
if (rettv_list_alloc(rettv) == FAIL)
684684
return;
685685

686686
if (in_vim9script()

src/evalfunc.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,7 +3732,7 @@ f_environ(typval_T *argvars UNUSED, typval_T *rettv)
37323732
extern char **environ;
37333733
# endif
37343734

3735-
if (rettv_dict_alloc(rettv) != OK)
3735+
if (rettv_dict_alloc(rettv) == FAIL)
37363736
return;
37373737

37383738
# ifdef MSWIN
@@ -4159,7 +4159,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
41594159
emsg(errormsg);
41604160
if (rettv->v_type == VAR_LIST)
41614161
{
4162-
if (rettv_list_alloc(rettv) != FAIL && result != NULL)
4162+
if (rettv_list_alloc(rettv) == OK && result != NULL)
41634163
list_append_string(rettv->vval.v_list, result, -1);
41644164
vim_free(result);
41654165
}
@@ -4182,7 +4182,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
41824182
if (rettv->v_type == VAR_STRING)
41834183
rettv->vval.v_string = ExpandOne(&xpc, s, NULL,
41844184
options, WILD_ALL);
4185-
else if (rettv_list_alloc(rettv) != FAIL)
4185+
else if (rettv_list_alloc(rettv) == OK)
41864186
{
41874187
int i;
41884188

@@ -4784,7 +4784,7 @@ f_getchangelist(typval_T *argvars, typval_T *rettv)
47844784
dict_T *d;
47854785
int changelistindex;
47864786

4787-
if (rettv_list_alloc(rettv) != OK)
4787+
if (rettv_list_alloc(rettv) == FAIL)
47884788
return;
47894789

47904790
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL)
@@ -4929,7 +4929,7 @@ f_getcharpos(typval_T *argvars UNUSED, typval_T *rettv)
49294929
static void
49304930
f_getcharsearch(typval_T *argvars UNUSED, typval_T *rettv)
49314931
{
4932-
if (rettv_dict_alloc(rettv) != FAIL)
4932+
if (rettv_dict_alloc(rettv) == OK)
49334933
{
49344934
dict_T *dict = rettv->vval.v_dict;
49354935

@@ -5016,7 +5016,7 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
50165016
list_T *l;
50175017
dict_T *d;
50185018

5019-
if (rettv_list_alloc(rettv) != OK)
5019+
if (rettv_list_alloc(rettv) == FAIL)
50205020
return;
50215021

50225022
if (in_vim9script()
@@ -5221,7 +5221,7 @@ f_gettagstack(typval_T *argvars, typval_T *rettv)
52215221
{
52225222
win_T *wp = curwin; // default is current window
52235223

5224-
if (rettv_dict_alloc(rettv) != OK)
5224+
if (rettv_dict_alloc(rettv) == FAIL)
52255225
return;
52265226

52275227
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
@@ -7879,7 +7879,7 @@ f_printf(typval_T *argvars, typval_T *rettv)
78797879
static void
78807880
f_pum_getpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
78817881
{
7882-
if (rettv_dict_alloc(rettv) != OK)
7882+
if (rettv_dict_alloc(rettv) == FAIL)
78837883
return;
78847884
pum_set_event_info(rettv->vval.v_dict);
78857885
}
@@ -8168,7 +8168,7 @@ f_range(typval_T *argvars, typval_T *rettv)
81688168
varnumber_T stride = 1;
81698169
int error = FALSE;
81708170

8171-
if (rettv_list_alloc(rettv) != OK)
8171+
if (rettv_list_alloc(rettv) == FAIL)
81728172
return;
81738173

81748174
if (in_vim9script()
@@ -9010,6 +9010,10 @@ do_searchpair(
90109010
if (skip != NULL)
90119011
use_skip = eval_expr_valid_arg(skip);
90129012

9013+
#ifdef FEAT_RELTIME
9014+
if (time_limit > 0)
9015+
init_regexp_timeout(time_limit);
9016+
#endif
90139017
save_cursor = curwin->w_cursor;
90149018
pos = curwin->w_cursor;
90159019
CLEAR_POS(&firstpos);
@@ -9021,9 +9025,6 @@ do_searchpair(
90219025

90229026
CLEAR_FIELD(sia);
90239027
sia.sa_stop_lnum = lnum_stop;
9024-
#ifdef FEAT_RELTIME
9025-
sia.sa_tm = time_limit;
9026-
#endif
90279028
n = searchit(curwin, curbuf, &pos, NULL, dir, pat, 1L,
90289029
options, RE_SEARCH, &sia);
90299030
if (n == FAIL || (firstpos.lnum != 0 && EQUAL_POS(pos, firstpos)))
@@ -9109,6 +9110,9 @@ do_searchpair(
91099110
curwin->w_cursor = save_cursor;
91109111

91119112
theend:
9113+
#ifdef FEAT_RELTIME
9114+
disable_regexp_timeout();
9115+
#endif
91129116
vim_free(pat2);
91139117
vim_free(pat3);
91149118
if (p_cpo == empty_option)
@@ -10232,7 +10236,7 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
1023210236

1023310237
CLEAR_FIELD(str);
1023410238

10235-
if (rettv_list_alloc(rettv) != FAIL)
10239+
if (rettv_list_alloc(rettv) == OK)
1023610240
{
1023710241
if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
1023810242
&& col >= 0 && col <= (long)STRLEN(ml_get(lnum))
@@ -10293,7 +10297,7 @@ f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
1029310297

1029410298
if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
1029510299
&& col >= 0 && col <= (long)STRLEN(ml_get(lnum))
10296-
&& rettv_list_alloc(rettv) != FAIL)
10300+
&& rettv_list_alloc(rettv) == OK)
1029710301
{
1029810302
(void)syn_get_id(curwin, lnum, col, FALSE, NULL, TRUE);
1029910303
for (i = 0; ; ++i)
@@ -10328,7 +10332,7 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
1032810332
if (tp != NULL)
1032910333
wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
1033010334
}
10331-
if (wp != NULL && rettv_list_alloc(rettv) != FAIL)
10335+
if (wp != NULL && rettv_list_alloc(rettv) == OK)
1033210336
{
1033310337
for (; wp != NULL; wp = wp->w_next)
1033410338
if (list_append_number(rettv->vval.v_list,

src/evalwindow.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ f_gettabinfo(typval_T *argvars, typval_T *rettv)
471471
dict_T *d;
472472
int tpnr = 0;
473473

474-
if (rettv_list_alloc(rettv) != OK)
474+
if (rettv_list_alloc(rettv) == FAIL)
475475
return;
476476

477477
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
@@ -510,7 +510,7 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
510510
dict_T *d;
511511
short tabnr = 0, winnr;
512512

513-
if (rettv_list_alloc(rettv) != OK)
513+
if (rettv_list_alloc(rettv) == FAIL)
514514
return;
515515

516516
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
@@ -779,7 +779,7 @@ f_win_findbuf(typval_T *argvars, typval_T *rettv)
779779
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
780780
return;
781781

782-
if (rettv_list_alloc(rettv) != FAIL)
782+
if (rettv_list_alloc(rettv) == OK)
783783
win_findbuf(argvars, rettv->vval.v_list);
784784
}
785785

@@ -847,7 +847,7 @@ f_win_id2tabwin(typval_T *argvars, typval_T *rettv)
847847
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
848848
return;
849849

850-
if (rettv_list_alloc(rettv) != FAIL)
850+
if (rettv_list_alloc(rettv) == OK)
851851
win_id2tabwin(argvars, rettv->vval.v_list);
852852
}
853853

@@ -1143,7 +1143,7 @@ f_winlayout(typval_T *argvars, typval_T *rettv)
11431143
{
11441144
tabpage_T *tp;
11451145

1146-
if (rettv_list_alloc(rettv) != OK)
1146+
if (rettv_list_alloc(rettv) == FAIL)
11471147
return;
11481148

11491149
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)

src/ex_getln.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4475,8 +4475,8 @@ open_cmdwin(void)
44754475
{
44764476
if (p_wc == TAB)
44774477
{
4478-
add_map((char_u *)"<buffer> <Tab> <C-X><C-V>", MODE_INSERT);
4479-
add_map((char_u *)"<buffer> <Tab> a<C-X><C-V>", MODE_NORMAL);
4478+
add_map((char_u *)"<buffer> <Tab> <C-X><C-V>", MODE_INSERT, TRUE);
4479+
add_map((char_u *)"<buffer> <Tab> a<C-X><C-V>", MODE_NORMAL, TRUE);
44804480
}
44814481
set_option_value_give_err((char_u *)"ft",
44824482
0L, (char_u *)"vim", OPT_LOCAL);

src/gui.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ gui_do_fork(void)
226226
int exit_status;
227227
pid_t pid = -1;
228228

229+
#if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE)
230+
// a timer is not carried forward
231+
delete_timer();
232+
#endif
233+
229234
// Setup a pipe between the child and the parent, so that the parent
230235
// knows when the child has done the setsid() call and is allowed to
231236
// exit.

src/indent.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,20 @@ copy_indent(int size, char_u *src)
16121612
return TRUE;
16131613
}
16141614

1615+
/*
1616+
* Give a "resulting text too long" error and maybe set got_int.
1617+
*/
1618+
static void
1619+
emsg_text_too_long(void)
1620+
{
1621+
emsg(_(e_resulting_text_too_long));
1622+
#ifdef FEAT_EVAL
1623+
// when not inside a try/catch set got_int to break out of any loop
1624+
if (trylevel == 0)
1625+
#endif
1626+
got_int = TRUE;
1627+
}
1628+
16151629
/*
16161630
* ":retab".
16171631
*/
@@ -1749,7 +1763,7 @@ ex_retab(exarg_T *eap)
17491763
new_len = old_len - col + start_col + len + 1;
17501764
if (new_len <= 0 || new_len >= MAXCOL)
17511765
{
1752-
emsg(_(e_resulting_text_too_long));
1766+
emsg_text_too_long();
17531767
break;
17541768
}
17551769
new_line = alloc(new_len);
@@ -1780,13 +1794,7 @@ ex_retab(exarg_T *eap)
17801794
vcol += chartabsize(ptr + col, (colnr_T)vcol);
17811795
if (vcol >= MAXCOL)
17821796
{
1783-
emsg(_(e_resulting_text_too_long));
1784-
// when not inside a try/catch set got_int to break out of any
1785-
// loop
1786-
#ifdef FEAT_EVAL
1787-
if (trylevel == 0)
1788-
#endif
1789-
got_int = TRUE;
1797+
emsg_text_too_long();
17901798
break;
17911799
}
17921800
if (has_mbyte)

0 commit comments

Comments
 (0)