Skip to content

Commit f06ac07

Browse files
committed
fix(log): ensure autoscroll finds correct window
Added logic to find the correct window if the initial target window is not found. This prevents issues where the autoscroll function fails due to the target window not being identified correctly.
1 parent 9955c98 commit f06ac07

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lua/flutter-tools/log.lua

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ local function autoscroll(buf, target_win)
5959
api.nvim_tabpage_list_wins(0),
6060
function(item) return item == target_win end
6161
)
62+
if not win then
63+
win = utils.find(
64+
api.nvim_tabpage_list_wins(0),
65+
function(item) return vim.api.nvim_win_get_buf(item) == buf end
66+
)
67+
if win then M.win = win end
68+
end
6269
if not win then return end
6370
-- if the dev log is focused don't scroll it as it will block the user from perusing
6471
if api.nvim_get_current_win() == win then return end

0 commit comments

Comments
 (0)