vim-patch:9.1.0128: win_gotoid() may abort even when not switching a window

Problem:  win_gotoid() checks for textlock and other things when switching
          to a window that is already current (after v9.1.0119)
Solution: return early with success when attempting to switch to curwin
          (Sean Dewar)

2a65e73944
This commit is contained in:
Sean Dewar
2024-02-25 01:22:55 +00:00
parent b2245307f2
commit e3d4dfb6c3
2 changed files with 11 additions and 0 deletions

View File

@@ -584,6 +584,11 @@ void f_win_getid(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
void f_win_gotoid(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
int id = (int)tv_get_number(&argvars[0]);
if (curwin->handle == id) {
// Nothing to do.
rettv->vval.v_number = 1;
return;
}
if (text_or_buf_locked()) {
return;