Skip to content

Commit

Permalink
Merge remote-tracking branch 'vim/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ichizok committed Jul 19, 2022
2 parents a1f7d77 + 5154a88 commit 9f2b9b3
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 4 deletions.
6 changes: 4 additions & 2 deletions runtime/autoload/dist/ft.vim
Expand Up @@ -519,12 +519,14 @@ export def FTinc()
# headers so assume POV-Ray
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? ft_pascal_keywords
setf pascal
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '\w\+ = '
setf bitbake
else
FTasmsyntax()
if exists("b:asmsyntax")
exe "setf " .. fnameescape(b:asmsyntax)
exe "setf " .. fnameescape(b:asmsyntax)
else
setf pov
setf pov
endif
endif
endif
Expand Down
3 changes: 3 additions & 0 deletions runtime/filetype.vim
Expand Up @@ -252,6 +252,9 @@ au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('')
" Blank
au BufNewFile,BufRead *.bl setf blank

" Bitbake
au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake

" Blkid cache file
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml

Expand Down
2 changes: 1 addition & 1 deletion src/evalfunc.c
Expand Up @@ -6508,7 +6508,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|| (minor == VIM_VERSION_MINOR
&& has_patch(atoi((char *)name + 10))))));
}
else
else if (isdigit(name[5]))
n = has_patch(atoi((char *)name + 5));
}
else if (STRICMP(name, "vim_starting") == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/insexpand.c
Expand Up @@ -643,7 +643,7 @@ ins_compl_infercase_gettext(
if (ga_grow(&gap, IOSIZE) == FAIL)
return (char_u *)"[failed]";
STRCPY(gap.ga_data, IObuff);
gap.ga_len = STRLEN(IObuff);
gap.ga_len = (int)STRLEN(IObuff);
}
else if (has_mbyte)
p += (*mb_char2bytes)(wca[i++], p);
Expand Down
1 change: 1 addition & 0 deletions src/testdir/test_expr.vim
Expand Up @@ -41,6 +41,7 @@ func Test_version()
call assert_false(has('patch-7.4.'))
call assert_false(has('patch-9.1.0'))
call assert_false(has('patch-9.9.1'))
call assert_false(has('patch-abc'))
endfunc

func Test_op_ternary()
Expand Down
54 changes: 54 additions & 0 deletions src/testdir/test_filetype.vim
Expand Up @@ -83,6 +83,7 @@ let s:filename_checks = {
\ 'bib': ['file.bib'],
\ 'bicep': ['file.bicep'],
\ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'],
\ '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'],
\ 'blank': ['file.bl'],
\ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'],
\ 'bst': ['file.bst'],
Expand Down Expand Up @@ -1816,5 +1817,58 @@ func Test_sig_file()
filetype off
endfunc

func Test_inc_file()
filetype on

call writefile(['this is the fallback'], 'Xfile.inc')
split Xfile.inc
call assert_equal('pov', &filetype)
bwipe!

let g:filetype_inc = 'foo'
split Xfile.inc
call assert_equal('foo', &filetype)
bwipe!
unlet g:filetype_inc

" aspperl
call writefile(['perlscript'], 'Xfile.inc')
split Xfile.inc
call assert_equal('aspperl', &filetype)
bwipe!

" aspvbs
call writefile(['<% something'], 'Xfile.inc')
split Xfile.inc
call assert_equal('aspvbs', &filetype)
bwipe!

" php
call writefile(['<?php'], 'Xfile.inc')
split Xfile.inc
call assert_equal('php', &filetype)
bwipe!

" pascal
call writefile(['program'], 'Xfile.inc')
split Xfile.inc
call assert_equal('pascal', &filetype)
bwipe!

" bitbake
call writefile(['require foo'], 'Xfile.inc')
split Xfile.inc
call assert_equal('bitbake', &filetype)
bwipe!

" asm
call writefile(['asmsyntax=foo'], 'Xfile.inc')
split Xfile.inc
call assert_equal('foo', &filetype)
bwipe!

call delete('Xfile.inc')
filetype off
endfunc

" vim: shiftwidth=2 sts=2 expandtab
12 changes: 12 additions & 0 deletions src/testdir/test_vim9_func.vim
Expand Up @@ -4205,6 +4205,18 @@ def Test_multiple_funcref()
v9.CheckScriptSuccess(lines)
enddef

def Test_cexpr_errmsg_line_number()
var lines =<< trim END
vim9script
def Func()
var qfl = {}
cexpr qfl
enddef
Func()
END
v9.CheckScriptFailure(lines, 'E777', 2)
enddef

" The following messes up syntax highlight, keep near the end.
if has('python3')
def Test_python3_command()
Expand Down
8 changes: 8 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,14 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
57,
/**/
56,
/**/
55,
/**/
54,
/**/
53,
/**/
Expand Down
1 change: 1 addition & 0 deletions src/vim9execute.c
Expand Up @@ -2786,6 +2786,7 @@ exec_instructions(ectx_T *ectx)
ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline;
--ectx->ec_stack.ga_len;
tv = STACK_TV_BOT(0);
SOURCING_LNUM = iptr->isn_lnum;
res = cexpr_core(&ea, tv);
clear_tv(tv);
if (res == FAIL)
Expand Down

0 comments on commit 9f2b9b3

Please sign in to comment.