Skip to content

Commit 9d3189c

Browse files
committed
Call get_non_scrollview_floats when needed
It now uses caching, so you don't have to manually share the result across loop iterations
1 parent 311ba47 commit 9d3189c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lua/scrollview.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,6 @@ local show_signs = function(winid, sign_winids, bar_winid)
17381738
local base_col = calculate_scrollbar_column(winid)
17391739
-- lookup maps rows to a mapping of names to sign specifications (with lines).
17401740
local lookup = {}
1741-
local non_scrollview_floats -- gets set when needed
17421741
for _, sign_spec in pairs(sign_specs) do
17431742
local name = sign_spec.name
17441743
local lines = {}
@@ -1883,11 +1882,8 @@ local show_signs = function(winid, sign_winids, bar_winid)
18831882
local right = wincol0 + col + sign_width - 1
18841883
if to_bool(vim.g.scrollview_hide_on_float_intersect)
18851884
and show then
1886-
if non_scrollview_floats == nil then
1887-
non_scrollview_floats = get_non_scrollview_floats()
1888-
end
18891885
local float_overlaps =
1890-
get_win_overlaps(top, bottom, left, right, non_scrollview_floats)
1886+
get_win_overlaps(top, bottom, left, right, get_non_scrollview_floats())
18911887
if not vim.tbl_isempty(float_overlaps) then
18921888
if #float_overlaps > 1 or float_overlaps[1] ~= winid then
18931889
show = false

0 commit comments

Comments
 (0)