From 2a65e739447949a7aee966ce8a3b75521b2a79ea Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:53:33 +0100 Subject: 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) Other potential causes of E565 from win_gotoid after v9.1.0119 should be correct. Plugins can consider using win_execute() instead if they wish to temporarily switch windows during textlock. fixes: #14073 closes: #14074 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt --- src/evalwindow.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/evalwindow.c') diff --git a/src/evalwindow.c b/src/evalwindow.c index 00081d43d5..f9b1c12961 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -824,6 +824,13 @@ f_win_gotoid(typval_T *argvars, typval_T *rettv) return; id = tv_get_number(&argvars[0]); + if (curwin->w_id == id) + { + // Nothing to do. + rettv->vval.v_number = 1; + return; + } + if (text_or_buf_locked()) return; #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) -- cgit v1.2.3