Merge pull request #39211 from janlazo/vim-8.2.2245

vim-patch:8.2.{2245,3024}
This commit is contained in:
zeertzjq
2026-04-19 10:35:04 +08:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -869,10 +869,10 @@ void f_winrestcmd(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
continue;
}
size_t buflen = vim_snprintf_safelen(buf, sizeof(buf),
"%dresize %d|", winnr, wp->w_height);
":%dresize %d|", winnr, wp->w_height);
ga_concat_len(&ga, buf, buflen);
buflen = vim_snprintf_safelen(buf, sizeof(buf),
"vert %dresize %d|", winnr, wp->w_width);
"vert :%dresize %d|", winnr, wp->w_width);
ga_concat_len(&ga, buf, buflen);
winnr++;
}

View File

@@ -45,7 +45,7 @@ func Test_execute_string()
if has('float')
call assert_fails('call execute(3.4)', 'E492:')
call assert_equal("\nx", execute("echo \"x\"", 3.4))
call CheckDefExecAndScriptFailure(['execute("echo \"x\"", 3.4)'], 'E806:')
call CheckDefExecAndScriptFailure2(['execute("echo \"x\"", 3.4)'], 'E1013: Argument 2: type mismatch, expected string but got float', 'E806:')
endif
endfunc

View File

@@ -58,6 +58,11 @@ func CheckDefExecAndScriptFailure(lines, error, lnum = -3)
return
endfunc
" As CheckDefExecAndScriptFailure() but with two different expected errors.
func CheckDefExecAndScriptFailure2(lines, errorDef, errorScript, lnum = -3)
return
endfunc
" Check that "lines" inside a legacy function has no error.
func CheckLegacySuccess(lines)
let cwd = getcwd()