Fix bugs where the file picker windows disappear on @file mentions (#2442)

Co-authored-by: Arnon Keereena <arnon.keereena@accenture.com>
This commit is contained in:
Arnon Keereena
2025-07-14 09:08:55 +07:00
committed by GitHub
parent 80f50af6fb
commit a78af4ce99

View File

@@ -741,10 +741,12 @@ function M.throttle(func, delay)
end
function M.winline(winid)
local current_win = api.nvim_get_current_win()
api.nvim_set_current_win(winid)
local line = fn.winline()
api.nvim_set_current_win(current_win)
-- If the winid is not provided, then line number should be 1, so that it can land on the first line
if not vim.api.nvim_win_is_valid(winid) then return 1 end
local line = 1
vim.api.nvim_win_call(winid, function() line = fn.winline() end)
return line
end