Skip to content

Commit 946e219

Browse files
committed
Merge branch 'vim'
Conflicts: src/auto/configure
2 parents f72d696 + debd2cc commit 946e219

File tree

12 files changed

+193
-133
lines changed

12 files changed

+193
-133
lines changed

.hgtags

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,3 +2521,12 @@ b7bb20390111b75616eb66558aa9517901eb0144 v7-3-1181
25212521
fa98c2b030ed5ac8d8c8139405d20ad6c611c065 v7-3-1182
25222522
044d23a64c177549b4b5e3183642f3a5b286d14f v7-3-1183
25232523
9e36c6b1ebf4554a24bd879965f348b81ad5ca6a v7-3-1184
2524+
6d935f45c489b346f06aef5b1bdd87cb98b8400b v7-3-1185
2525+
7b8991e084f9bea2dde9ceef7a245254d656b6f9 v7-3-1186
2526+
fefd8d33a7ea43f86d6e5a2ab30440140ada14f6 v7-3-1187
2527+
6f7ed9b799a3db282f0fc076d8232752716a4e00 v7-3-1188
2528+
dc78a26f6f64bb1330b9027559ce0c8fe54ba1de v7-3-1189
2529+
25d64a4edc0b0f3f17330a7b12f3c1ca141ccfb3 v7-3-1190
2530+
4c42efb4c0982d305ec9ee99bb3bddfaeec2cf87 v7-3-1191
2531+
07b9c48a30e973833ee70d38633934f6fc2177d8 v7-3-1192
2532+
8b46c37c4b843039e5a543be98978e79ff6f3d31 v7-3-1193

src/auto/configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6089,6 +6089,11 @@ _ACEOF
60896089
echo "${ECHO_T}too old" >&6; }
60906090
fi
60916091
fi
6092+
if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then
6093+
{ { echo "$as_me:$LINENO: error: could not configure python3" >&5
6094+
echo "$as_me: error: could not configure python3" >&2;}
6095+
{ (exit 1); exit 1; }; }
6096+
fi
60926097
fi
60936098

60946099

src/configure.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,9 @@ eof
12631263
AC_MSG_RESULT(too old)
12641264
fi
12651265
fi
1266+
if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then
1267+
AC_MSG_ERROR([could not configure python3])
1268+
fi
12661269
fi
12671270

12681271
AC_SUBST(PYTHON3_CONFDIR)

src/eval.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10977,21 +10977,22 @@ f_function(argvars, rettv)
1097710977
EMSG2(_("E700: Unknown function: %s"), s);
1097810978
else
1097910979
{
10980-
if (STRNCMP(s, "s:", 2) == 0)
10980+
if (STRNCMP(s, "s:", 2) == 0 || STRNCMP(s, "<SID>", 5) == 0)
1098110981
{
1098210982
char sid_buf[25];
10983+
int off = *s == 's' ? 2 : 5;
1098310984

10984-
/* Expand s: into <SNR>nr_, so that the function can also be
10985-
* called from another script. Using trans_function_name() would
10986-
* also work, but some plugins depend on the name being printable
10987-
* text. */
10985+
/* Expand s: and <SID> into <SNR>nr_, so that the function can
10986+
* also be called from another script. Using trans_function_name()
10987+
* would also work, but some plugins depend on the name being
10988+
* printable text. */
1098810989
sprintf(sid_buf, "<SNR>%ld_", (long)current_SID);
1098910990
rettv->vval.v_string =
10990-
alloc((int)(STRLEN(sid_buf) + STRLEN(s + 2) + 1));
10991+
alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1));
1099110992
if (rettv->vval.v_string != NULL)
1099210993
{
1099310994
STRCPY(rettv->vval.v_string, sid_buf);
10994-
STRCAT(rettv->vval.v_string, s + 2);
10995+
STRCAT(rettv->vval.v_string, s + off);
1099510996
}
1099610997
}
1099710998
else

src/ex_docmd.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8587,11 +8587,13 @@ ex_operators(eap)
85878587
break;
85888588

85898589
default: /* CMD_rshift or CMD_lshift */
8590-
if ((eap->cmdidx == CMD_rshift)
8590+
if (
85918591
#ifdef FEAT_RIGHTLEFT
8592-
^ curwin->w_p_rl
8592+
(eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl
8593+
#else
8594+
eap->cmdidx == CMD_rshift
85938595
#endif
8594-
)
8596+
)
85958597
oa.op_type = OP_RSHIFT;
85968598
else
85978599
oa.op_type = OP_LSHIFT;

src/gui_x11.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,12 +2197,12 @@ check_fontset_sanity(fs)
21972197
if ( xfs[i]->max_bounds.width != 2 * min_width
21982198
&& xfs[i]->max_bounds.width != min_width)
21992199
{
2200-
EMSG2(_("E253: Fontset name: %s\n"), base_name);
2201-
EMSG2(_("Font0: %s\n"), font_name[min_font_idx]);
2202-
EMSG2(_("Font1: %s\n"), font_name[i]);
2203-
EMSGN(_("Font%ld width is not twice that of font0\n"), i);
2204-
EMSGN(_("Font0 width: %ld\n"), xfs[min_font_idx]->max_bounds.width);
2205-
EMSGN(_("Font1 width: %ld\n\n"), xfs[i]->max_bounds.width);
2200+
EMSG2(_("E253: Fontset name: %s"), base_name);
2201+
EMSG2(_("Font0: %s"), font_name[min_font_idx]);
2202+
EMSG2(_("Font1: %s"), font_name[i]);
2203+
EMSGN(_("Font%ld width is not twice that of font0"), i);
2204+
EMSGN(_("Font0 width: %ld"), xfs[min_font_idx]->max_bounds.width);
2205+
EMSGN(_("Font1 width: %ld"), xfs[i]->max_bounds.width);
22062206
return FAIL;
22072207
}
22082208
}

src/if_python3.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,8 @@ static struct
425425
{"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
426426
{"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
427427
{"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
428-
# ifndef PY_SSIZE_T_CLEAN
429-
{"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
430-
{"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
431-
# else
432428
{"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
433429
{"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
434-
# endif
435430
{"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
436431
{"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
437432
{"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
@@ -488,7 +483,7 @@ static struct
488483
{"PyEval_InitThreads", (PYTHON_PROC*)&py3_PyEval_InitThreads},
489484
{"PyEval_RestoreThread", (PYTHON_PROC*)&py3_PyEval_RestoreThread},
490485
{"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread},
491-
{"PyArg_Parse", (PYTHON_PROC*)&py3_PyArg_Parse},
486+
{"_PyArg_Parse_SizeT", (PYTHON_PROC*)&py3_PyArg_Parse},
492487
{"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized},
493488
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented},
494489
{"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct},

src/regexp.c

Lines changed: 76 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,6 +3519,7 @@ static void save_se_one __ARGS((save_se_T *savep, char_u **pp));
35193519
*(pp) = (savep)->se_u.ptr; }
35203520

35213521
static int re_num_cmp __ARGS((long_u val, char_u *scan));
3522+
static int match_with_backref __ARGS((linenr_T start_lnum, colnr_T start_col, linenr_T end_lnum, colnr_T end_col, int *bytelen));
35223523
static int regmatch __ARGS((char_u *prog));
35233524
static int regrepeat __ARGS((char_u *p, long maxcount));
35243525

@@ -4979,9 +4980,6 @@ regmatch(scan)
49794980
case BACKREF + 9:
49804981
{
49814982
int len;
4982-
linenr_T clnum;
4983-
colnr_T ccol;
4984-
char_u *p;
49854983

49864984
no = op - BACKREF;
49874985
cleanup_subexpr();
@@ -5023,67 +5021,12 @@ regmatch(scan)
50235021
{
50245022
/* Messy situation: Need to compare between two
50255023
* lines. */
5026-
ccol = reg_startpos[no].col;
5027-
clnum = reg_startpos[no].lnum;
5028-
for (;;)
5029-
{
5030-
/* Since getting one line may invalidate
5031-
* the other, need to make copy. Slow! */
5032-
if (regline != reg_tofree)
5033-
{
5034-
len = (int)STRLEN(regline);
5035-
if (reg_tofree == NULL
5036-
|| len >= (int)reg_tofreelen)
5037-
{
5038-
len += 50; /* get some extra */
5039-
vim_free(reg_tofree);
5040-
reg_tofree = alloc(len);
5041-
if (reg_tofree == NULL)
5042-
{
5043-
status = RA_FAIL; /* outof memory!*/
5044-
break;
5045-
}
5046-
reg_tofreelen = len;
5047-
}
5048-
STRCPY(reg_tofree, regline);
5049-
reginput = reg_tofree
5050-
+ (reginput - regline);
5051-
regline = reg_tofree;
5052-
}
5053-
5054-
/* Get the line to compare with. */
5055-
p = reg_getline(clnum);
5056-
if (clnum == reg_endpos[no].lnum)
5057-
len = reg_endpos[no].col - ccol;
5058-
else
5059-
len = (int)STRLEN(p + ccol);
5060-
5061-
if (cstrncmp(p + ccol, reginput, &len) != 0)
5062-
{
5063-
status = RA_NOMATCH; /* doesn't match */
5064-
break;
5065-
}
5066-
if (clnum == reg_endpos[no].lnum)
5067-
break; /* match and at end! */
5068-
if (reglnum >= reg_maxline)
5069-
{
5070-
status = RA_NOMATCH; /* text too short */
5071-
break;
5072-
}
5073-
5074-
/* Advance to next line. */
5075-
reg_nextline();
5076-
++clnum;
5077-
ccol = 0;
5078-
if (got_int)
5079-
{
5080-
status = RA_FAIL;
5081-
break;
5082-
}
5083-
}
5084-
5085-
/* found a match! Note that regline may now point
5086-
* to a copy of the line, that should not matter. */
5024+
status = match_with_backref(
5025+
reg_startpos[no].lnum,
5026+
reg_startpos[no].col,
5027+
reg_endpos[no].lnum,
5028+
reg_endpos[no].col,
5029+
NULL);
50875030
}
50885031
}
50895032
}
@@ -6505,6 +6448,75 @@ re_num_cmp(val, scan)
65056448
return val == n;
65066449
}
65076450

6451+
/*
6452+
* Check whether a backreference matches.
6453+
* Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
6454+
* If "bytelen" is not NULL, it is set to the bytelength of the whole match.
6455+
*/
6456+
static int
6457+
match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
6458+
linenr_T start_lnum;
6459+
colnr_T start_col;
6460+
linenr_T end_lnum;
6461+
colnr_T end_col;
6462+
int *bytelen;
6463+
{
6464+
linenr_T clnum = start_lnum;
6465+
colnr_T ccol = start_col;
6466+
int len;
6467+
char_u *p;
6468+
6469+
if (bytelen != NULL)
6470+
*bytelen = 0;
6471+
for (;;)
6472+
{
6473+
/* Since getting one line may invalidate the other, need to make copy.
6474+
* Slow! */
6475+
if (regline != reg_tofree)
6476+
{
6477+
len = (int)STRLEN(regline);
6478+
if (reg_tofree == NULL || len >= (int)reg_tofreelen)
6479+
{
6480+
len += 50; /* get some extra */
6481+
vim_free(reg_tofree);
6482+
reg_tofree = alloc(len);
6483+
if (reg_tofree == NULL)
6484+
return RA_FAIL; /* out of memory!*/
6485+
reg_tofreelen = len;
6486+
}
6487+
STRCPY(reg_tofree, regline);
6488+
reginput = reg_tofree + (reginput - regline);
6489+
regline = reg_tofree;
6490+
}
6491+
6492+
/* Get the line to compare with. */
6493+
p = reg_getline(clnum);
6494+
if (clnum == end_lnum)
6495+
len = end_col - ccol;
6496+
else
6497+
len = (int)STRLEN(p + ccol);
6498+
6499+
if (cstrncmp(p + ccol, reginput, &len) != 0)
6500+
return RA_NOMATCH; /* doesn't match */
6501+
if (bytelen != NULL)
6502+
*bytelen += len;
6503+
if (clnum == end_lnum)
6504+
break; /* match and at end! */
6505+
if (reglnum >= reg_maxline)
6506+
return RA_NOMATCH; /* text too short */
6507+
6508+
/* Advance to next line. */
6509+
reg_nextline();
6510+
++clnum;
6511+
ccol = 0;
6512+
if (got_int)
6513+
return RA_FAIL;
6514+
}
6515+
6516+
/* found a match! Note that regline may now point to a copy of the line,
6517+
* that should not matter. */
6518+
return RA_MATCH;
6519+
}
65086520

65096521
#ifdef BT_REGEXP_DUMP
65106522

0 commit comments

Comments
 (0)