From c7bd2f08e531f08723cdc677212a3633d11c9a97 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 15 Jul 2022 20:45:20 +0100 Subject: [PATCH 1/4] patch 9.0.0054: compiler warning for size_t to int conversion Problem: Compiler warning for size_t to int conversion. Solution: Add type cast. (Mike Williams, closes #10741) --- src/insexpand.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c index 9c598a89f7..b49a631a6b 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -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); diff --git a/src/version.c b/src/version.c index 9e7a9885c4..8ea00e2839 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 54, /**/ 53, /**/ From fa49eb482729a5fe7da9c9a5ed8d14f68afa55c7 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Sat, 16 Jul 2022 17:46:47 +0100 Subject: [PATCH 2/4] patch 9.0.0055: bitbake files are not detected Problem: Bitbake files are not detected. Solution: Add bitbake filetype detection by file name and contents. (Gregory Anders, closes #10697) --- runtime/autoload/dist/ft.vim | 6 ++-- runtime/filetype.vim | 3 ++ src/testdir/test_filetype.vim | 54 +++++++++++++++++++++++++++++++++++ src/version.c | 2 ++ 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index a96bdf5e72..708a42a050 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -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 diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 42bd4be6a6..761ed3f283 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 2b7b79765d..4be8cdc9bd 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -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'], @@ -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([' Date: Mon, 18 Jul 2022 17:49:03 +0100 Subject: [PATCH 3/4] patch 9.0.0056: wrong line number reported when :cexpr fails in :def function Problem: Wrong line number reported when :cexpr fails in :def function. Solution: Set line_number before executing :cexpr. (closes #10735) --- src/testdir/test_vim9_func.vim | 12 ++++++++++++ src/version.c | 2 ++ src/vim9execute.c | 1 + 3 files changed, 15 insertions(+) diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 33a66151e7..2714fa1ccf 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -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() diff --git a/src/version.c b/src/version.c index f2304f326d..87a8d10728 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 56, /**/ 55, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index 9dd5937e47..2f94f05c54 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -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) From 5154a8880034b7bb94186d37bcecc6ee1a96f732 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 18 Jul 2022 20:48:50 +0100 Subject: [PATCH 4/4] patch 9.0.0057: has('patch-xxx') returns true Problem: has('patch-xxx') returns true. Solution: Check for digit. (closes #10751) --- src/evalfunc.c | 2 +- src/testdir/test_expr.vim | 1 + src/version.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index f51aade495..580f5d1bff 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6473,7 +6473,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) diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index ffac6df806..f911cd933f 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -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() diff --git a/src/version.c b/src/version.c index 87a8d10728..ee421e4760 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 57, /**/ 56, /**/