patch 8.1.0892: failure when closing a window when location list is in use
Problem: Failure when closing a window when location list is in use.
Solution: Handle the situation gracefully. Make sure memory for 'switchbuf'
is not freed at the wrong time. (Yegappan Lakshmanan,
closes #3928)
diff --git a/src/eval.c b/src/eval.c
index 08603ca..c30c5d8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -8587,7 +8587,7 @@
int nr = (int)tv_get_number_chk(vp, NULL);
if (nr >= LOWEST_WIN_ID)
- return win_id2wp(vp);
+ return win_id2wp(tv_get_number(vp));
return find_win_by_nr(vp, NULL);
}