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