File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ local PROPER_LINE_COUNT_KEY_PREFIX = 1
125125local TOPLINE_LOOKUP_KEY_PREFIX = 2
126126local GET_WINDOW_EDGES_KEY_PREFIX = 3
127127local 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
128131
129132-- Maps window ID and highlight group to a temporary highlight group with the
130133-- corresponding definition. This is reset on each refresh cycle.
@@ -372,12 +375,15 @@ local get_floating_windows = function()
372375end
373376
374377local get_non_scrollview_floats = function ()
378+ local memoize_key = GET_NON_SCROLLVIEW_FLOATS_KEY
379+ if memoize and cache [memoize_key ] then return cache [memoize_key ] end
375380 local result = {}
376381 for _ , winid in ipairs (get_floating_windows ()) do
377382 if not is_scrollview_window (winid ) then
378383 table.insert (result , winid )
379384 end
380385 end
386+ if memoize then cache [memoize_key ] = result end
381387 return result
382388end
383389
You can’t perform that action at this time.
0 commit comments