Merge #11977 from janlazo/vim-8.1.1279

vim-patch:8.1.1279,8.2.{360,361}
This commit is contained in:
Justin M. Keyes 2020-03-08 13:36:52 -07:00 committed by GitHub
commit 2b00d1d09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 4 deletions

View File

@ -36,8 +36,7 @@ $scoop = (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh'
Invoke-Expression $scoop
}
scoop install diffutils perl
diff3 --version
scoop install perl
perl --version
cpanm.bat --version
@ -81,7 +80,7 @@ if ($compiler -eq 'MINGW') {
# in MSYS2, but we cannot build inside the MSYS2 shell.
$cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake').ForEach({
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
"mingw-w64-$arch-$_"
})

View File

@ -376,6 +376,10 @@ else
elseif s:line1 =~? '-\*-.*erlang.*-\*-'
set ft=erlang
" YAML
elseif s:line1 =~# '^%YAML'
set ft=yaml
" CVS diff
else
let s:lnum = 1

View File

@ -8114,10 +8114,16 @@ void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
bool callback_from_typval(Callback *const callback, typval_T *const arg)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
int r = OK;
if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL) {
callback->data.partial = arg->vval.v_partial;
callback->data.partial->pt_refcount++;
callback->type = kCallbackPartial;
} else if (arg->v_type == VAR_STRING
&& arg->vval.v_string != NULL
&& ascii_isdigit(*arg->vval.v_string)) {
r = FAIL;
} else if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING) {
char_u *name = arg->vval.v_string;
func_ref(name);
@ -8126,6 +8132,10 @@ bool callback_from_typval(Callback *const callback, typval_T *const arg)
} else if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0) {
callback->type = kCallbackNone;
} else {
r = FAIL;
}
if (r == FAIL) {
EMSG(_("E921: Invalid callback argument"));
return false;
}

View File

@ -2568,7 +2568,7 @@ static bool valid_filetype(const char_u *val)
bool valid_spellang(const char_u *val)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
return valid_name(val, ".-_,");
return valid_name(val, ".-_,@");
}
/// Return true if "val" is a valid 'spellfile' value.

View File

@ -600,6 +600,7 @@ let s:script_checks = {
\ 'haskell': [['#!/path/haskell']],
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
\ ['// -*- C++ -*-']],
\ 'yaml': [['%YAML 1.2']],
\ }
func Test_script_detection()

View File

@ -339,4 +339,8 @@ func Test_nocatch_garbage_collect()
delfunc FeedChar
endfunc
func Test_timer_invalid_callback()
call assert_fails('call timer_start(0, "0")', 'E921')
endfunc
" vim: shiftwidth=2 sts=2 expandtab