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
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user