Re-enabled comment cache.

This commit is contained in:
Adam Harrison 2022-03-22 10:35:44 -04:00
parent 17645ba4ec
commit 3e7a97737e
1 changed files with 4 additions and 6 deletions

View File

@ -76,9 +76,9 @@ end
local function get_comment_patterns(syntax)
if syntax.name and comments_cache[syntax.name] then
if #comments_cache[syntax.name] > 0 then
return comments_cache[syntax.name]
if comments_cache[syntax] then
if #comments_cache[syntax] > 0 then
return comments_cache[syntax]
else
return nil
end
@ -150,9 +150,7 @@ local function get_comment_patterns(syntax)
table.insert(comments, {"p", "^%s*" .. block_comment[1], block_comment[2]})
end
end
if syntax.name then
comments_cache[syntax.name] = comments
end
comments_cache[syntax] = comments
if #comments > 0 then
return comments
end