Skip to content

Commit 0e351c1

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 5cbe25f + fc1f201 commit 0e351c1

17 files changed

Lines changed: 339 additions & 185 deletions

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ test1 \
20592059
test11 test12 test13 test14 test15 test16 test17 test18 test19 \
20602060
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
20612061
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
2062-
test40 test41 test42 test43 test44 test45 test46 test47 test48 test49 \
2062+
test40 test41 test42 test43 test44 test45 test46 test48 test49 \
20632063
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
20642064
test60 test62 test63 test64 test65 test66 test67 test68 test69 \
20652065
test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \
@@ -2081,6 +2081,7 @@ test_arglist \
20812081
test_cscope \
20822082
test_cursor_func \
20832083
test_delete \
2084+
test_diffmode \
20842085
test_digraph \
20852086
test_ex_undo \
20862087
test_execute_func \

src/channel.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,10 +1293,14 @@ channel_set_req_callback(
12931293

12941294
if (item != NULL)
12951295
{
1296-
item->cq_callback = vim_strsave(callback);
12971296
item->cq_partial = partial;
12981297
if (partial != NULL)
1298+
{
12991299
++partial->pt_refcount;
1300+
item->cq_callback = callback;
1301+
}
1302+
else
1303+
item->cq_callback = vim_strsave(callback);
13001304
item->cq_seq_nr = id;
13011305
item->cq_prev = head->cq_prev;
13021306
head->cq_prev = item;
@@ -4490,10 +4494,14 @@ job_set_options(job_T *job, jobopt_T *opt)
44904494
}
44914495
else
44924496
{
4493-
job->jv_exit_cb = vim_strsave(opt->jo_exit_cb);
44944497
job->jv_exit_partial = opt->jo_exit_partial;
44954498
if (job->jv_exit_partial != NULL)
4499+
{
4500+
job->jv_exit_cb = opt->jo_exit_cb;
44964501
++job->jv_exit_partial->pt_refcount;
4502+
}
4503+
else
4504+
job->jv_exit_cb = vim_strsave(opt->jo_exit_cb);
44974505
}
44984506
}
44994507
}

src/evalfunc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11958,7 +11958,11 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
1195811958
}
1195911959
else
1196011960
{
11961-
timer->tr_callback = vim_strsave(callback);
11961+
if (timer->tr_partial == NULL)
11962+
timer->tr_callback = vim_strsave(callback);
11963+
else
11964+
/* pointer into the partial */
11965+
timer->tr_callback = callback;
1196211966
rettv->vval.v_number = timer->tr_id;
1196311967
}
1196411968
}

src/ex_cmds.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4091,7 +4091,12 @@ do_ecmd(
40914091
u_sync(FALSE);
40924092
if (u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE)
40934093
== FAIL)
4094+
{
4095+
#ifdef FEAT_AUTOCMD
4096+
vim_free(new_name);
4097+
#endif
40944098
goto theend;
4099+
}
40954100
u_unchanged(curbuf);
40964101
buf_freeall(curbuf, BFA_KEEP_UNDO);
40974102

src/ex_cmds2.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,21 @@ set_ref_in_timer(int copyID)
12791279
}
12801280
return abort;
12811281
}
1282+
1283+
# if defined(EXITFREE) || defined(PROTO)
1284+
void
1285+
timer_free_all()
1286+
{
1287+
timer_T *timer;
1288+
1289+
while (first_timer != NULL)
1290+
{
1291+
timer = first_timer;
1292+
remove_timer(timer);
1293+
free_timer(timer);
1294+
}
1295+
}
1296+
# endif
12821297
# endif
12831298

12841299
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ do_one_cmd(
19611961
#endif
19621962
continue;
19631963
}
1964-
if (!checkforcmd(&ea.cmd, "noswapfile", 6))
1964+
if (!checkforcmd(&ea.cmd, "noswapfile", 3))
19651965
break;
19661966
cmdmod.noswapfile = TRUE;
19671967
continue;

src/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ trunc_string(
304304
if (len + n > room || half == 0)
305305
break;
306306
len += n;
307-
i = half;
307+
i = (int)half;
308308
}
309309
}
310310
else

src/misc2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,9 @@ free_all_mem(void)
12241224
channel_free_all();
12251225
job_free_all();
12261226
# endif
1227+
#ifdef FEAT_TIMERS
1228+
timer_free_all();
1229+
#endif
12271230

12281231
free_termoptions();
12291232

src/proto/ex_cmds2.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ float_T profile_float(proftime_T *tm);
1818
void profile_setlimit(long msec, proftime_T *tm);
1919
int profile_passed_limit(proftime_T *tm);
2020
void profile_zero(proftime_T *tm);
21-
timer_T *create_timer(long msec, int repeats);
21+
timer_T *create_timer(long msec, int repeat);
2222
long check_due_timer(void);
2323
timer_T *find_timer(int id);
2424
void stop_timer(timer_T *timer);
2525
int set_ref_in_timer(int copyID);
26+
void timer_free_all(void);
2627
void profile_divide(proftime_T *tm, int count, proftime_T *tm2);
2728
void profile_add(proftime_T *tm, proftime_T *tm2);
2829
void profile_self(proftime_T *self, proftime_T *total, proftime_T *children);

src/testdir/Make_all.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ SCRIPTS_ALL = \
4343
test44.out \
4444
test45.out \
4545
test46.out \
46-
test47.out \
4746
test48.out \
4847
test51.out \
4948
test53.out \
@@ -168,6 +167,7 @@ NEW_TESTS = test_arglist.res \
168167
test_channel.res \
169168
test_cmdline.res \
170169
test_cscope.res \
170+
test_diffmode.res \
171171
test_digraph.res \
172172
test_farsi.res \
173173
test_gn.res \

0 commit comments

Comments
 (0)