Skip to content

Commit d5069d6

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 40bc4e9 + fe6ce33 commit d5069d6

File tree

16 files changed

+135
-33
lines changed

16 files changed

+135
-33
lines changed

runtime/doc/options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3430,7 +3430,7 @@ A jump table for the options with a short description can be found at |Q_op|.
34303430

34313431
*'formatprg'* *'fp'*
34323432
'formatprg' 'fp' string (default "")
3433-
global
3433+
global or local to buffer |global-local|
34343434
{not in Vi}
34353435
The name of an external program that will be used to format the lines
34363436
selected with the |gq| operator. The program must take the input on

src/channel.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,14 @@ channel_open(
731731
channel_free(channel);
732732
return NULL;
733733
}
734-
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
734+
{
735+
char *p;
736+
737+
/* When using host->h_addr directly ubsan warns for it to not be
738+
* aligned. First copy the pointer to aviod that. */
739+
memcpy(&p, &host->h_addr, sizeof(p));
740+
memcpy((char *)&server.sin_addr, p, host->h_length);
741+
}
735742

736743
/* On Mac and Solaris a zero timeout almost never works. At least wait
737744
* one millisecond. Let's do it for all systems, because we don't know why

src/eval.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9256,6 +9256,8 @@ fill_assert_error(
92569256
{
92579257
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
92589258
ga_concat(gap, (char_u *)"Pattern ");
9259+
else if (atype == ASSERT_NOTEQUAL)
9260+
ga_concat(gap, (char_u *)"Expected not equal to ");
92599261
else
92609262
ga_concat(gap, (char_u *)"Expected ");
92619263
if (exp_str == NULL)
@@ -9265,16 +9267,17 @@ fill_assert_error(
92659267
}
92669268
else
92679269
ga_concat_esc(gap, exp_str);
9268-
if (atype == ASSERT_MATCH)
9269-
ga_concat(gap, (char_u *)" does not match ");
9270-
else if (atype == ASSERT_NOTMATCH)
9271-
ga_concat(gap, (char_u *)" does match ");
9272-
else if (atype == ASSERT_NOTEQUAL)
9273-
ga_concat(gap, (char_u *)" differs from ");
9274-
else
9275-
ga_concat(gap, (char_u *)" but got ");
9276-
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
9277-
vim_free(tofree);
9270+
if (atype != ASSERT_NOTEQUAL)
9271+
{
9272+
if (atype == ASSERT_MATCH)
9273+
ga_concat(gap, (char_u *)" does not match ");
9274+
else if (atype == ASSERT_NOTMATCH)
9275+
ga_concat(gap, (char_u *)" does match ");
9276+
else
9277+
ga_concat(gap, (char_u *)" but got ");
9278+
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
9279+
vim_free(tofree);
9280+
}
92789281
}
92799282
}
92809283

src/if_ruby.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,11 @@ static int ensure_ruby_initialized(void)
871871
int argc = 1;
872872
char *argv[] = {"gvim.exe"};
873873
char **argvp = argv;
874+
# ifdef RUBY19_OR_LATER
875+
ruby_sysinit(&argc, &argvp);
876+
# else
874877
NtInitialize(&argc, &argvp);
878+
# endif
875879
#endif
876880
{
877881
#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)

src/json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
936936
&& dict_find(top_item->jd_tv.vval.v_dict,
937937
top_item->jd_key, -1) != NULL)
938938
{
939-
EMSG2(_("E937: Duplicate key in JSON: \"%s\""),
939+
EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
940940
top_item->jd_key);
941941
clear_tv(&top_item->jd_key_tv);
942942
clear_tv(cur_item);

src/message.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,6 @@ emsg(char_u *s)
578578
return TRUE;
579579

580580
called_emsg = TRUE;
581-
if (emsg_silent == 0)
582-
ex_exitval = 1;
583581

584582
/*
585583
* If "emsg_severe" is TRUE: When an error exception is to be thrown,
@@ -642,6 +640,8 @@ emsg(char_u *s)
642640
return TRUE;
643641
}
644642

643+
ex_exitval = 1;
644+
645645
/* Reset msg_silent, an error causes messages to be switched back on. */
646646
msg_silent = 0;
647647
cmd_silent = FALSE;

src/move.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2870,13 +2870,17 @@ do_check_cursorbind(void)
28702870
restart_edit_save = restart_edit;
28712871
restart_edit = TRUE;
28722872
check_cursor();
2873+
# ifdef FEAT_SYN_HL
2874+
if (curwin->w_p_cuc)
2875+
validate_cursor();
2876+
# endif
28732877
restart_edit = restart_edit_save;
28742878
# ifdef FEAT_MBYTE
28752879
/* Correct cursor for multi-byte character. */
28762880
if (has_mbyte)
28772881
mb_adjust_cursor();
28782882
# endif
2879-
redraw_later(VALID);
2883+
redraw_later(curwin->w_p_cul ? NOT_VALID : VALID);
28802884

28812885
/* Only scroll when 'scrollbind' hasn't done this. */
28822886
if (!curwin->w_p_scb)

src/normal.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
19841984
op_formatexpr(oap); /* use expression */
19851985
else
19861986
#endif
1987-
if (*p_fp != NUL)
1987+
if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
19881988
op_colon(oap); /* use external command */
19891989
else
19901990
op_format(oap, FALSE); /* use internal function */
@@ -2197,10 +2197,12 @@ op_colon(oparg_T *oap)
21972197
}
21982198
else if (oap->op_type == OP_FORMAT)
21992199
{
2200-
if (*p_fp == NUL)
2201-
stuffReadbuff((char_u *)"fmt");
2202-
else
2200+
if (*curbuf->b_p_fp != NUL)
2201+
stuffReadbuff(curbuf->b_p_fp);
2202+
else if (*p_fp != NUL)
22032203
stuffReadbuff(p_fp);
2204+
else
2205+
stuffReadbuff((char_u *)"fmt");
22042206
stuffReadbuff((char_u *)"\n']");
22052207
}
22062208

src/option.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
108108
# define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
109109
#endif
110+
#define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
110111
#ifdef FEAT_EVAL
111112
# define PV_FEX OPT_BUF(BV_FEX)
112113
#endif
@@ -1270,7 +1271,7 @@ static struct vimoption options[] =
12701271
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
12711272
(char_u *)0L} SCRIPTID_INIT},
12721273
{"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
1273-
(char_u *)&p_fp, PV_NONE,
1274+
(char_u *)&p_fp, PV_FP,
12741275
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
12751276
{"fsync", "fs", P_BOOL|P_SECURE|P_VI_DEF,
12761277
#ifdef HAVE_FSYNC
@@ -5574,6 +5575,7 @@ check_buf_options(buf_T *buf)
55745575
#if defined(FEAT_CRYPT)
55755576
check_string_option(&buf->b_p_cm);
55765577
#endif
5578+
check_string_option(&buf->b_p_fp);
55775579
#if defined(FEAT_EVAL)
55785580
check_string_option(&buf->b_p_fex);
55795581
#endif
@@ -10358,6 +10360,9 @@ unset_global_local_option(char_u *name, void *from)
1035810360
clear_string_option(&buf->b_p_tsr);
1035910361
break;
1036010362
#endif
10363+
case PV_FP:
10364+
clear_string_option(&buf->b_p_fp);
10365+
break;
1036110366
#ifdef FEAT_QUICKFIX
1036210367
case PV_EFM:
1036310368
clear_string_option(&buf->b_p_efm);
@@ -10411,6 +10416,7 @@ get_varp_scope(struct vimoption *p, int opt_flags)
1041110416
{
1041210417
switch ((int)p->indir)
1041310418
{
10419+
case PV_FP: return (char_u *)&(curbuf->b_p_fp);
1041410420
#ifdef FEAT_QUICKFIX
1041510421
case PV_EFM: return (char_u *)&(curbuf->b_p_efm);
1041610422
case PV_GP: return (char_u *)&(curbuf->b_p_gp);
@@ -10491,6 +10497,8 @@ get_varp(struct vimoption *p)
1049110497
case PV_TSR: return *curbuf->b_p_tsr != NUL
1049210498
? (char_u *)&(curbuf->b_p_tsr) : p->var;
1049310499
#endif
10500+
case PV_FP: return *curbuf->b_p_fp != NUL
10501+
? (char_u *)&(curbuf->b_p_fp) : p->var;
1049410502
#ifdef FEAT_QUICKFIX
1049510503
case PV_EFM: return *curbuf->b_p_efm != NUL
1049610504
? (char_u *)&(curbuf->b_p_efm) : p->var;
@@ -11059,6 +11067,7 @@ buf_copy_options(buf_T *buf, int flags)
1105911067
buf->b_p_inde = vim_strsave(p_inde);
1106011068
buf->b_p_indk = vim_strsave(p_indk);
1106111069
#endif
11070+
buf->b_p_fp = empty_option;
1106211071
#if defined(FEAT_EVAL)
1106311072
buf->b_p_fex = vim_strsave(p_fex);
1106411073
#endif

src/option.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ enum
10511051
, BV_EP
10521052
, BV_ET
10531053
, BV_FENC
1054+
, BV_FP
10541055
#ifdef FEAT_EVAL
10551056
, BV_BEXPR
10561057
, BV_FEX

0 commit comments

Comments
 (0)