Skip to content

Commit 96a68b5

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents fd41a38 + f545269 commit 96a68b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+742
-195
lines changed

.github/workflows/ci-windows.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ jobs:
215215
:: Wait about 10 minutes.
216216
for /L %%i in (1,1,60) do (
217217
if exist done.txt goto exitloop
218-
timeout 10
218+
timeout 10 > NUL 2>&1
219+
if ERRORLEVEL 1 ping -n 11 localhost > NUL
219220
)
220221
set timeout=1
221222
:exitloop

src/auto/configure

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12513,10 +12513,18 @@ if test -c /dev/ptmx ; then
1251312513
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1251412514
/* end confdefs.h. */
1251512515
12516+
// These should be in stdlib.h, but it depends on _XOPEN_SOURCE.
12517+
char *ptsname(int);
12518+
int unlockpt(int);
12519+
int grantpt(int);
12520+
1251612521
int
1251712522
main ()
1251812523
{
12519-
ptsname(0);grantpt(0);unlockpt(0);
12524+
12525+
ptsname(0);
12526+
grantpt(0);
12527+
unlockpt(0);
1252012528
;
1252112529
return 0;
1252212530
}

src/clipboard.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,6 +2029,9 @@ clip_get_selection(Clipboard_T *cbd)
20292029
&& get_y_register(STAR_REGISTER)->y_array != NULL))
20302030
return;
20312031

2032+
// Avoid triggering autocmds such as TextYankPost.
2033+
block_autocmds();
2034+
20322035
// Get the text between clip_star.start & clip_star.end
20332036
old_y_previous = get_y_previous();
20342037
old_y_current = get_y_current();
@@ -2058,6 +2061,8 @@ clip_get_selection(Clipboard_T *cbd)
20582061
curbuf->b_op_end = old_op_end;
20592062
VIsual = old_visual;
20602063
VIsual_mode = old_visual_mode;
2064+
2065+
unblock_autocmds();
20612066
}
20622067
else if (!is_clipboard_needs_update())
20632068
{

src/configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3723,7 +3723,15 @@ fi
37233723

37243724
AC_MSG_CHECKING(for SVR4 ptys)
37253725
if test -c /dev/ptmx ; then
3726-
AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
3726+
AC_TRY_LINK([
3727+
// These should be in stdlib.h, but it depends on _XOPEN_SOURCE.
3728+
char *ptsname(int);
3729+
int unlockpt(int);
3730+
int grantpt(int);
3731+
], [
3732+
ptsname(0);
3733+
grantpt(0);
3734+
unlockpt(0);],
37273735
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
37283736
AC_MSG_RESULT(no))
37293737
else

src/drawline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ win_line(
641641
else
642642
tocol = MAXCOL;
643643
// do at least one character; happens when past end of line
644-
if (fromcol == tocol)
644+
if (fromcol == tocol && search_match_endcol)
645645
tocol = fromcol + 1;
646646
area_highlighting = TRUE;
647647
vi_attr = HL_ATTR(HLF_I);

src/errors.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,5 @@ EXTERN char e_missing_matching_bracket_after_dict_key[]
311311
INIT(= N_("E1139: Missing matching bracket after dict key"));
312312
EXTERN char e_for_argument_must_be_sequence_of_lists[]
313313
INIT(= N_("E1140: For argument must be a sequence of lists"));
314+
EXTERN char e_indexable_type_required[]
315+
INIT(= N_("E1141: Indexable type required"));

src/eval.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,10 +2769,11 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
27692769
int vim9script = in_vim9script();
27702770

27712771
// "." is only string concatenation when scriptversion is 1
2772+
// "+=" and "-=" are assignment
27722773
p = eval_next_non_blank(*arg, evalarg, &getnext);
27732774
op = *p;
27742775
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
2775-
if (op != '+' && op != '-' && !concat)
2776+
if ((op != '+' && op != '-' && !concat) || p[1] == '=')
27762777
break;
27772778

27782779
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
@@ -3266,7 +3267,7 @@ eval7(
32663267
* Lambda: {arg, arg -> expr}
32673268
* Dictionary: {'key': val, 'key': val}
32683269
*/
3269-
case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
3270+
case '{': ret = get_lambda_tv(arg, rettv, in_vim9script(), evalarg);
32703271
if (ret == NOTDONE)
32713272
ret = eval_dict(arg, rettv, evalarg, FALSE);
32723273
break;

src/ex_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,7 @@ do_ecmd(
31233123
#endif
31243124

31253125
if (command != NULL)
3126-
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE);
3126+
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE|DOCMD_RANGEOK);
31273127

31283128
#ifdef FEAT_KEYMAP
31293129
if (curbuf->b_kmap_state & KEYMAP_INIT)

src/ex_docmd.c

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,17 @@ do_cmdline_cmd(char_u *cmd)
600600
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
601601
}
602602

603+
/*
604+
* Execute the "+cmd" argument of "edit +cmd fname" and the like.
605+
* This allows for using a range without ":" in Vim9 script.
606+
*/
607+
int
608+
do_cmd_argument(char_u *cmd)
609+
{
610+
return do_cmdline(cmd, NULL, NULL,
611+
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED|DOCMD_RANGEOK);
612+
}
613+
603614
/*
604615
* do_cmdline(): execute one Ex command line
605616
*
@@ -995,7 +1006,7 @@ do_cmdline(
9951006
* "cmdline_copy" can change, e.g. for '%' and '#' expansion.
9961007
*/
9971008
++recursive;
998-
next_cmdline = do_one_cmd(&cmdline_copy, flags & DOCMD_VERBOSE,
1009+
next_cmdline = do_one_cmd(&cmdline_copy, flags,
9991010
#ifdef FEAT_EVAL
10001011
&cstack,
10011012
#endif
@@ -1691,7 +1702,8 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
16911702
/*
16921703
* Execute one Ex command.
16931704
*
1694-
* If 'sourcing' is TRUE, the command will be included in the error message.
1705+
* If "flags" has DOCMD_VERBOSE, the command will be included in the error
1706+
* message.
16951707
*
16961708
* 1. skip comment lines and leading space
16971709
* 2. handle command modifiers
@@ -1714,7 +1726,7 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
17141726
static char_u *
17151727
do_one_cmd(
17161728
char_u **cmdlinep,
1717-
int sourcing,
1729+
int flags,
17181730
#ifdef FEAT_EVAL
17191731
cstack_T *cstack,
17201732
#endif
@@ -1737,6 +1749,7 @@ do_one_cmd(
17371749
int vim9script = in_vim9script();
17381750
int did_set_expr_line = FALSE;
17391751
#endif
1752+
int sourcing = flags & DOCMD_VERBOSE;
17401753

17411754
CLEAR_FIELD(ea);
17421755
ea.line1 = 1;
@@ -1800,7 +1813,7 @@ do_one_cmd(
18001813
#ifdef FEAT_EVAL
18011814
// In Vim9 script a colon is required before the range. This may also be
18021815
// after command modifiers.
1803-
if (vim9script)
1816+
if (vim9script && (flags & DOCMD_RANGEOK) == 0)
18041817
{
18051818
may_have_range = FALSE;
18061819
for (p = ea.cmd; p >= *cmdlinep; --p)
@@ -3325,9 +3338,13 @@ find_ex_command(
33253338

33263339
// When followed by "=" or "+=" then it is an assignment.
33273340
++emsg_silent;
3328-
if (skip_expr(&after, NULL) == OK
3329-
&& (*after == '='
3330-
|| (*after != NUL && after[1] == '=')))
3341+
if (skip_expr(&after, NULL) == OK)
3342+
after = skipwhite(after);
3343+
else
3344+
after = (char_u *)"";
3345+
if (*after == '=' || (*after != NUL && after[1] == '=')
3346+
|| (after[0] == '.' && after[1] == '.'
3347+
&& after[2] == '='))
33313348
eap->cmdidx = CMD_var;
33323349
else
33333350
eap->cmdidx = CMD_eval;
@@ -5015,7 +5032,7 @@ ex_buffer(exarg_T *eap)
50155032
else
50165033
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
50175034
if (eap->do_ecmd_cmd != NULL)
5018-
do_cmdline_cmd(eap->do_ecmd_cmd);
5035+
do_cmd_argument(eap->do_ecmd_cmd);
50195036
}
50205037
}
50215038

@@ -5028,7 +5045,7 @@ ex_bmodified(exarg_T *eap)
50285045
{
50295046
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
50305047
if (eap->do_ecmd_cmd != NULL)
5031-
do_cmdline_cmd(eap->do_ecmd_cmd);
5048+
do_cmd_argument(eap->do_ecmd_cmd);
50325049
}
50335050

50345051
/*
@@ -5043,7 +5060,7 @@ ex_bnext(exarg_T *eap)
50435060

50445061
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
50455062
if (eap->do_ecmd_cmd != NULL)
5046-
do_cmdline_cmd(eap->do_ecmd_cmd);
5063+
do_cmd_argument(eap->do_ecmd_cmd);
50475064
}
50485065

50495066
/*
@@ -5060,7 +5077,7 @@ ex_bprevious(exarg_T *eap)
50605077

50615078
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
50625079
if (eap->do_ecmd_cmd != NULL)
5063-
do_cmdline_cmd(eap->do_ecmd_cmd);
5080+
do_cmd_argument(eap->do_ecmd_cmd);
50645081
}
50655082

50665083
/*
@@ -5077,7 +5094,7 @@ ex_brewind(exarg_T *eap)
50775094

50785095
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
50795096
if (eap->do_ecmd_cmd != NULL)
5080-
do_cmdline_cmd(eap->do_ecmd_cmd);
5097+
do_cmd_argument(eap->do_ecmd_cmd);
50815098
}
50825099

50835100
/*
@@ -5092,7 +5109,7 @@ ex_blast(exarg_T *eap)
50925109

50935110
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
50945111
if (eap->do_ecmd_cmd != NULL)
5095-
do_cmdline_cmd(eap->do_ecmd_cmd);
5112+
do_cmd_argument(eap->do_ecmd_cmd);
50965113
}
50975114

50985115
/*
@@ -6631,7 +6648,8 @@ do_exedit(
66316648
else if (eap->cmdidx == CMD_enew)
66326649
readonlymode = FALSE; // 'readonly' doesn't make sense in an
66336650
// empty buffer
6634-
setpcmark();
6651+
if (eap->cmdidx != CMD_balt && eap->cmdidx != CMD_badd)
6652+
setpcmark();
66356653
if (do_ecmd(0, (eap->cmdidx == CMD_enew ? NULL : eap->arg),
66366654
NULL, eap,
66376655
// ":edit" goes to first line if Vi compatible
@@ -6686,7 +6704,7 @@ do_exedit(
66866704
else
66876705
{
66886706
if (eap->do_ecmd_cmd != NULL)
6689-
do_cmdline_cmd(eap->do_ecmd_cmd);
6707+
do_cmd_argument(eap->do_ecmd_cmd);
66906708
#ifdef FEAT_TITLE
66916709
n = curwin->w_arg_idx_invalid;
66926710
#endif

src/feature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,11 +1107,11 @@
11071107
/*
11081108
* +ARP Amiga only. Use arp.library, DOS 2.0 is not required.
11091109
*/
1110-
#if !defined(NO_ARP) && !defined(__amigaos4__)
1110+
#if defined(AMIGA) && !defined(NO_ARP) && !defined(__amigaos4__) \
1111+
&& !defined(__MORPHOS__) && !defined(__AROS__)
11111112
# define FEAT_ARP
11121113
#endif
11131114

1114-
11151115
/*
11161116
* +ole Win32 OLE automation: Use Makefile.ovc.
11171117
*/

0 commit comments

Comments
 (0)