Skip to content

Commit 9f2b9b3

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents a1f7d77 + 5154a88 commit 9f2b9b3

File tree

9 files changed

+85
-4
lines changed

9 files changed

+85
-4
lines changed

runtime/autoload/dist/ft.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,14 @@ export def FTinc()
519519
# headers so assume POV-Ray
520520
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? ft_pascal_keywords
521521
setf pascal
522+
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '\w\+ = '
523+
setf bitbake
522524
else
523525
FTasmsyntax()
524526
if exists("b:asmsyntax")
525-
exe "setf " .. fnameescape(b:asmsyntax)
527+
exe "setf " .. fnameescape(b:asmsyntax)
526528
else
527-
setf pov
529+
setf pov
528530
endif
529531
endif
530532
endif

runtime/filetype.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('')
252252
" Blank
253253
au BufNewFile,BufRead *.bl setf blank
254254

255+
" Bitbake
256+
au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake
257+
255258
" Blkid cache file
256259
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
257260

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6508,7 +6508,7 @@ f_has(typval_T *argvars, typval_T *rettv)
65086508
|| (minor == VIM_VERSION_MINOR
65096509
&& has_patch(atoi((char *)name + 10))))));
65106510
}
6511-
else
6511+
else if (isdigit(name[5]))
65126512
n = has_patch(atoi((char *)name + 5));
65136513
}
65146514
else if (STRICMP(name, "vim_starting") == 0)

src/insexpand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ ins_compl_infercase_gettext(
643643
if (ga_grow(&gap, IOSIZE) == FAIL)
644644
return (char_u *)"[failed]";
645645
STRCPY(gap.ga_data, IObuff);
646-
gap.ga_len = STRLEN(IObuff);
646+
gap.ga_len = (int)STRLEN(IObuff);
647647
}
648648
else if (has_mbyte)
649649
p += (*mb_char2bytes)(wca[i++], p);

src/testdir/test_expr.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func Test_version()
4141
call assert_false(has('patch-7.4.'))
4242
call assert_false(has('patch-9.1.0'))
4343
call assert_false(has('patch-9.9.1'))
44+
call assert_false(has('patch-abc'))
4445
endfunc
4546

4647
func Test_op_ternary()

src/testdir/test_filetype.vim

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ let s:filename_checks = {
8383
\ 'bib': ['file.bib'],
8484
\ 'bicep': ['file.bicep'],
8585
\ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'],
86+
\ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf'],
8687
\ 'blank': ['file.bl'],
8788
\ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'],
8889
\ 'bst': ['file.bst'],
@@ -1816,5 +1817,58 @@ func Test_sig_file()
18161817
filetype off
18171818
endfunc
18181819

1820+
func Test_inc_file()
1821+
filetype on
1822+
1823+
call writefile(['this is the fallback'], 'Xfile.inc')
1824+
split Xfile.inc
1825+
call assert_equal('pov', &filetype)
1826+
bwipe!
1827+
1828+
let g:filetype_inc = 'foo'
1829+
split Xfile.inc
1830+
call assert_equal('foo', &filetype)
1831+
bwipe!
1832+
unlet g:filetype_inc
1833+
1834+
" aspperl
1835+
call writefile(['perlscript'], 'Xfile.inc')
1836+
split Xfile.inc
1837+
call assert_equal('aspperl', &filetype)
1838+
bwipe!
1839+
1840+
" aspvbs
1841+
call writefile(['<% something'], 'Xfile.inc')
1842+
split Xfile.inc
1843+
call assert_equal('aspvbs', &filetype)
1844+
bwipe!
1845+
1846+
" php
1847+
call writefile(['<?php'], 'Xfile.inc')
1848+
split Xfile.inc
1849+
call assert_equal('php', &filetype)
1850+
bwipe!
1851+
1852+
" pascal
1853+
call writefile(['program'], 'Xfile.inc')
1854+
split Xfile.inc
1855+
call assert_equal('pascal', &filetype)
1856+
bwipe!
1857+
1858+
" bitbake
1859+
call writefile(['require foo'], 'Xfile.inc')
1860+
split Xfile.inc
1861+
call assert_equal('bitbake', &filetype)
1862+
bwipe!
1863+
1864+
" asm
1865+
call writefile(['asmsyntax=foo'], 'Xfile.inc')
1866+
split Xfile.inc
1867+
call assert_equal('foo', &filetype)
1868+
bwipe!
1869+
1870+
call delete('Xfile.inc')
1871+
filetype off
1872+
endfunc
18191873

18201874
" vim: shiftwidth=2 sts=2 expandtab

src/testdir/test_vim9_func.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4205,6 +4205,18 @@ def Test_multiple_funcref()
42054205
v9.CheckScriptSuccess(lines)
42064206
enddef
42074207

4208+
def Test_cexpr_errmsg_line_number()
4209+
var lines =<< trim END
4210+
vim9script
4211+
def Func()
4212+
var qfl = {}
4213+
cexpr qfl
4214+
enddef
4215+
Func()
4216+
END
4217+
v9.CheckScriptFailure(lines, 'E777', 2)
4218+
enddef
4219+
42084220
" The following messes up syntax highlight, keep near the end.
42094221
if has('python3')
42104222
def Test_python3_command()

src/version.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,14 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
57,
755+
/**/
756+
56,
757+
/**/
758+
55,
759+
/**/
760+
54,
753761
/**/
754762
53,
755763
/**/

src/vim9execute.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,7 @@ exec_instructions(ectx_T *ectx)
27862786
ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline;
27872787
--ectx->ec_stack.ga_len;
27882788
tv = STACK_TV_BOT(0);
2789+
SOURCING_LNUM = iptr->isn_lnum;
27892790
res = cexpr_core(&ea, tv);
27902791
clear_tv(tv);
27912792
if (res == FAIL)

0 commit comments

Comments
 (0)