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:
@@ -741,10 +741,12 @@ function M.throttle(func, delay)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.winline(winid)
|
function M.winline(winid)
|
||||||
local current_win = api.nvim_get_current_win()
|
-- If the winid is not provided, then line number should be 1, so that it can land on the first line
|
||||||
api.nvim_set_current_win(winid)
|
if not vim.api.nvim_win_is_valid(winid) then return 1 end
|
||||||
local line = fn.winline()
|
|
||||||
api.nvim_set_current_win(current_win)
|
local line = 1
|
||||||
|
vim.api.nvim_win_call(winid, function() line = fn.winline() end)
|
||||||
|
|
||||||
return line
|
return line
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user