Skip to content

Commit dd797d9

Browse files
committed
Consider the hidden argument when caching
1 parent f8ac536 commit dd797d9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lua/scrollview.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ local PROPER_LINE_COUNT_KEY_PREFIX = 1
125125
local TOPLINE_LOOKUP_KEY_PREFIX = 2
126126
local GET_WINDOW_EDGES_KEY_PREFIX = 3
127127
local ROW_LENGTH_LOOKUP_KEY_PREFIX = 4
128-
-- For get_non_scrollview_floats, a prefix is not necessary, since the function
129-
-- takes no arguments.
130-
local GET_NON_SCROLLVIEW_FLOATS_KEY = 5
128+
local GET_NON_SCROLLVIEW_FLOATS_KEY_PREFIX = 5
131129

132130
-- Maps window ID and highlight group to a temporary highlight group with the
133131
-- corresponding definition. This is reset on each refresh cycle.
@@ -386,7 +384,8 @@ local get_non_scrollview_floats = function(hidden)
386384
if hidden == nil then
387385
hidden = false
388386
end
389-
local memoize_key = GET_NON_SCROLLVIEW_FLOATS_KEY
387+
local memoize_key =
388+
table.concat({GET_NON_SCROLLVIEW_FLOATS_KEY_PREFIX, hidden and 1 or 0}, ':')
390389
if memoize and cache[memoize_key] then return cache[memoize_key] end
391390
local result = {}
392391
for _, winid in ipairs(get_floating_windows(hidden)) do

0 commit comments

Comments
 (0)