@@ -25,9 +25,10 @@ local pending_parses = {}
25
25
--- @param directories ? string[]
26
26
local function clear_cache (directories )
27
27
if directories then
28
- msg .debug (' clearing cache' , table.concat ( directories , ' \n ' ) )
28
+ msg .debug (' clearing cache for ' , # directories , ' directorie(s) ' )
29
29
for _ , dir in ipairs (directories ) do
30
30
if cache [dir ] then
31
+ msg .trace (' clearing cache for' , dir )
31
32
cache [dir ].timeout :kill ()
32
33
cache [dir ] = nil
33
34
end
@@ -48,6 +49,7 @@ function cacheParser:can_parse(directory, parse_state)
48
49
-- allows the cache to be forcibly used or bypassed with the
49
50
-- cache/use parse property.
50
51
if parse_state .properties .cache and parse_state .properties .cache .use ~= nil then
52
+ if parse_state .source == ' browser' then prev_directory = directory end
51
53
return parse_state .properties .cache .use
52
54
end
53
55
@@ -58,8 +60,8 @@ function cacheParser:can_parse(directory, parse_state)
58
60
-- clear the cache if reloading the current directory in the browser
59
61
-- this means that fb.rescan() should maintain expected behaviour
60
62
if parse_state .source == ' browser' then
61
- prev_directory = directory
62
63
if prev_directory == directory then clear_cache ({directory }) end
64
+ prev_directory = directory
63
65
end
64
66
65
67
return true
0 commit comments