From a73cc7bc2fb11f7099a59eafc73e2161bf807a84 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Thu, 12 Mar 2026 15:34:21 -0400 Subject: fix silly lil bug causing mener to cry --- src/im.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/im.lua') diff --git a/src/im.lua b/src/im.lua index 28c7064..7602765 100644 --- a/src/im.lua +++ b/src/im.lua @@ -315,11 +315,13 @@ function im.begin_window(title, x, y, w, h, opts) end if mouse_down and focused_win == win then - local last = pop(wins) - wins[win.idx] = last - last.idx = win.idx - table.insert(wins, win) - win.idx = #wins + if wins[#wins] ~= win then + local last = table.remove(wins) + wins[win.idx] = last + last.idx = win.idx + table.insert(wins, win) + win.idx = #wins + end end end -- cgit v1.3-2-g0d8e