Skip to content

Commit eff6659

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 0a1cf2e + fc74d03 commit eff6659

13 files changed

Lines changed: 140 additions & 35 deletions

src/Make_cyg_ming.mak

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,23 +1055,23 @@ install.exe: dosinst.c dosinst.h version.h
10551055
uninstall.exe: uninstall.c dosinst.h version.h
10561056
$(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32
10571057

1058-
$(OBJ): $(OUTDIR)
1058+
$(OBJ): | $(OUTDIR)
10591059

1060-
$(EXEOBJG): $(OUTDIR)
1060+
$(EXEOBJG): | $(OUTDIR)
10611061

1062-
$(EXEOBJC): $(OUTDIR)
1062+
$(EXEOBJC): | $(OUTDIR)
10631063

10641064
ifeq ($(VIMDLL),yes)
1065-
$(TARGET): $(OUTDIR) $(OBJ)
1065+
$(TARGET): $(OBJ)
10661066
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
10671067

1068-
$(GVIMEXE): $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
1068+
$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
10691069
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
10701070

1071-
$(VIMEXE): $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
1071+
$(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
10721072
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
10731073
else
1074-
$(TARGET): $(OUTDIR) $(OBJ)
1074+
$(TARGET): $(OBJ)
10751075
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
10761076
endif
10771077

@@ -1286,7 +1286,7 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
12861286
$(CC) -c $(CFLAGS) $< -o $@
12871287

12881288

1289-
$(PATHDEF_SRC): $(OUTDIR) Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
1289+
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak | $(OUTDIR)
12901290
ifneq (sh.exe, $(SHELL))
12911291
@echo creating $(PATHDEF_SRC)
12921292
@echo '/* pathdef.c */' > $(PATHDEF_SRC)

src/evalfunc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ arg_float_or_nr(type_T *type, argcontext_T *context)
295295
static int
296296
arg_number(type_T *type, argcontext_T *context)
297297
{
298-
return check_type(&t_number, type, TRUE, context->arg_idx + 1);
298+
return check_arg_type(&t_number, type, context->arg_idx + 1);
299299
}
300300

301301
/*
@@ -304,7 +304,7 @@ arg_number(type_T *type, argcontext_T *context)
304304
static int
305305
arg_string(type_T *type, argcontext_T *context)
306306
{
307-
return check_type(&t_string, type, TRUE, context->arg_idx + 1);
307+
return check_arg_type(&t_string, type, context->arg_idx + 1);
308308
}
309309

310310
/*
@@ -342,7 +342,7 @@ arg_same_as_prev(type_T *type, argcontext_T *context)
342342
{
343343
type_T *prev_type = context->arg_types[context->arg_idx - 1];
344344

345-
return check_type(prev_type, type, TRUE, context->arg_idx + 1);
345+
return check_arg_type(prev_type, type, context->arg_idx + 1);
346346
}
347347

348348
/*
@@ -363,7 +363,7 @@ arg_item_of_prev(type_T *type, argcontext_T *context)
363363
// probably VAR_ANY, can't check
364364
return OK;
365365

366-
return check_type(expected, type, TRUE, context->arg_idx + 1);
366+
return check_arg_type(expected, type, context->arg_idx + 1);
367367
}
368368

369369
/*

src/popupmenu.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ pum_display(
361361
// redo the positioning. Limit this to two times, when there is not
362362
// much room the window size will keep changing.
363363
} while (pum_set_selected(selected, redo_count) && ++redo_count <= 2);
364+
365+
pum_redraw();
364366
}
365367

366368
/*
@@ -541,8 +543,23 @@ pum_redraw(void)
541543
{
542544
if (st != NULL)
543545
{
544-
screen_puts_len(st, (int)STRLEN(st), row, col,
545-
attr);
546+
int size = (int)STRLEN(st);
547+
int cells = (*mb_string2cells)(st, size);
548+
549+
// only draw the text that fits
550+
while (size > 0
551+
&& col + cells > pum_width + pum_col)
552+
{
553+
--size;
554+
if (has_mbyte)
555+
{
556+
size -= (*mb_head_off)(st, st + size);
557+
cells -= (*mb_ptr2cells)(st + size);
558+
}
559+
else
560+
--cells;
561+
}
562+
screen_puts_len(st, size, row, col, attr);
546563
vim_free(st);
547564
}
548565
col += width;
@@ -990,9 +1007,6 @@ pum_set_selected(int n, int repeat UNUSED)
9901007
popup_hide_info();
9911008
#endif
9921009

993-
if (!resized)
994-
pum_redraw();
995-
9961010
return resized;
9971011
}
9981012

src/proto/vim9compile.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* vim9compile.c */
22
int check_defined(char_u *p, size_t len, cctx_T *cctx);
33
int check_compare_types(exptype_T type, typval_T *tv1, typval_T *tv2);
4+
int use_typecheck(type_T *actual, type_T *expected);
45
int get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx);
56
imported_T *find_imported(char_u *name, size_t len, cctx_T *cctx);
67
imported_T *find_imported_in_script(char_u *name, size_t len, int sid);

src/proto/vim9type.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ int check_typval_type(type_T *expected, typval_T *actual_tv, int argidx);
1515
void type_mismatch(type_T *expected, type_T *actual);
1616
void arg_type_mismatch(type_T *expected, type_T *actual, int argidx);
1717
int check_type(type_T *expected, type_T *actual, int give_msg, int argidx);
18+
int check_arg_type(type_T *expected, type_T *actual, int argidx);
1819
char_u *skip_type(char_u *start, int optional);
1920
type_T *parse_type(char_u **arg, garray_T *type_gap);
2021
void common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap);

src/testdir/test_netbeans.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func ReadXnetbeans()
3636
let l = readfile("Xnetbeans")
3737
" Xnetbeans may include '0:geometry=' messages in the GUI Vim if the window
3838
" position, size, or z order are changed. Remove these messages because
39-
" these message will break the assert for the output.
39+
" these messages will break the assert for the output.
4040
return filter(l, 'v:val !~ "^0:geometry="')
4141
endfunc
4242

@@ -927,7 +927,7 @@ endfunc
927927
" error.
928928
func Test_nb_bwipe_buffer()
929929
call s:run_server('Nb_bwipe_buffer')
930-
%bwipe!
930+
silent! %bwipe!
931931
sleep 100m
932932
nbclose
933933
endfunc

src/testdir/test_terminal.vim

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,20 +1242,36 @@ func Test_terminal_popup_with_cmd()
12421242
unlet s:winid
12431243
endfunc
12441244

1245+
func Test_terminal_popup_bufload()
1246+
let termbuf = term_start(&shell, #{hidden: v:true, term_finish: 'close'})
1247+
let winid = popup_create(termbuf, {})
1248+
sleep 50m
1249+
1250+
let newbuf = bufadd('')
1251+
call bufload(newbuf)
1252+
call setbufline(newbuf, 1, 'foobar')
1253+
1254+
" must not have switched to another window
1255+
call assert_equal(winid, win_getid())
1256+
1257+
call StopShellInTerminal(termbuf)
1258+
call WaitFor({-> win_getid() != winid})
1259+
exe 'bwipe! ' .. newbuf
1260+
endfunc
1261+
12451262
func Test_terminal_popup_insert_cmd()
12461263
CheckUnix
12471264

12481265
inoremap <F3> <Cmd>call StartTermInPopup()<CR>
12491266
func StartTermInPopup()
1250-
call term_start(['/bin/sh', '-c', 'cat'], #{hidden: v:true})->popup_create(#{highlight: 'Pmenu'})
1267+
call term_start(['/bin/sh', '-c', 'cat'], #{hidden: v:true, term_finish: 'close'})->popup_create(#{highlight: 'Pmenu'})
12511268
endfunc
12521269
call feedkeys("i\<F3>")
12531270
sleep 10m
12541271
call assert_equal('n', mode())
12551272

12561273
call feedkeys("\<C-D>", 'xt')
1257-
sleep 20m
1258-
call feedkeys(":q\<CR>", 'xt')
1274+
sleep 50m
12591275
delfunc StartTermInPopup
12601276
iunmap <F3>
12611277
endfunc

src/testdir/test_vim9_assign.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ def Test_assignment_dict()
408408

409409
# overwrite
410410
dict3['key'] = 'another'
411+
assert_equal(dict3, #{key: 'another'})
412+
dict3.key = 'yet another'
413+
assert_equal(dict3, #{key: 'yet another'})
414+
415+
var lines =<< trim END
416+
var dd = #{one: 1}
417+
dd.one) = 2
418+
END
419+
CheckDefFailure(lines, 'E15:', 2)
411420

412421
# empty key can be used
413422
var dd = {}
@@ -418,7 +427,7 @@ def Test_assignment_dict()
418427
var somedict = rand() > 0 ? #{a: 1, b: 2} : #{a: 'a', b: 'b'}
419428

420429
# assignment to script-local dict
421-
var lines =<< trim END
430+
lines =<< trim END
422431
vim9script
423432
var test: dict<any> = {}
424433
def FillDict(): dict<any>

src/testdir/test_vim9_builtin.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,16 @@ def Test_extend_arg_types()
195195
assert_equal([1, 2, 3], extend([1, 2], [3]))
196196
assert_equal([3, 1, 2], extend([1, 2], [3], 0))
197197
assert_equal([1, 3, 2], extend([1, 2], [3], 1))
198+
assert_equal([1, 3, 2], extend([1, 2], [3], s:number_one))
198199

199200
assert_equal(#{a: 1, b: 2, c: 3}, extend(#{a: 1, b: 2}, #{c: 3}))
200201
assert_equal(#{a: 1, b: 4}, extend(#{a: 1, b: 2}, #{b: 4}))
201202
assert_equal(#{a: 1, b: 2}, extend(#{a: 1, b: 2}, #{b: 4}, 'keep'))
203+
assert_equal(#{a: 1, b: 2}, extend(#{a: 1, b: 2}, #{b: 4}, s:string_keep))
204+
205+
var res: list<dict<any>>
206+
extend(res, map([1, 2], {_, v -> {}}))
207+
assert_equal([{}, {}], res)
202208

203209
CheckDefFailure(['extend([1, 2], 3)'], 'E1013: Argument 2: type mismatch, expected list<number> but got number')
204210
CheckDefFailure(['extend([1, 2], ["x"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>')
@@ -338,6 +344,10 @@ def Test_index()
338344
index(['a', 'b', 'a', 'B'], 'b', 2, true)->assert_equal(3)
339345
enddef
340346

347+
let s:number_one = 1
348+
let s:number_two = 2
349+
let s:string_keep = 'keep'
350+
341351
def Test_insert()
342352
var l = insert([2, 1], 3)
343353
var res = 0
@@ -347,9 +357,12 @@ def Test_insert()
347357
res->assert_equal(6)
348358

349359
assert_equal([1, 2, 3], insert([2, 3], 1))
360+
assert_equal([1, 2, 3], insert([2, 3], s:number_one))
350361
assert_equal([1, 2, 3], insert([1, 2], 3, 2))
362+
assert_equal([1, 2, 3], insert([1, 2], 3, s:number_two))
351363
assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a'))
352364
assert_equal(0z1234, insert(0z34, 0x12))
365+
353366
CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string', 1)
354367
CheckDefFailure(['insert([2, 3], 1, "x")'], 'E1013: Argument 3: type mismatch, expected number but got string', 1)
355368
enddef

src/version.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,22 @@ static char *(features[]) =
765765

766766
static int included_patches[] =
767767
{ /* Add new patch number below this line */
768+
/**/
769+
2000,
770+
/**/
771+
1999,
772+
/**/
773+
1998,
774+
/**/
775+
1997,
776+
/**/
777+
1996,
778+
/**/
779+
1995,
780+
/**/
781+
1994,
782+
/**/
783+
1993,
768784
/**/
769785
1992,
770786
/**/

0 commit comments

Comments
 (0)