From 75401535ef742e861132dcd48ee40ca01a0ae348 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 17 Jun 2024 20:01:01 +0200 Subject: [PATCH] fix: return early if rock is found in cache --- lua/rocks_treesitter/highlight.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/rocks_treesitter/highlight.lua b/lua/rocks_treesitter/highlight.lua index b37afa1..5a65acf 100644 --- a/lua/rocks_treesitter/highlight.lua +++ b/lua/rocks_treesitter/highlight.lua @@ -41,7 +41,7 @@ local function find_parser_rock(lang, callback) local rock_name = "tree-sitter-" .. lang local rocks = api.try_get_cached_rocks() if rocks and rocks[rock_name] then - callback(rocks[rock_name]) + return callback(rocks[rock_name]) end -- Cache may not have been populated. Query luarocks. api.query_luarocks_rocks(function(luarocks_rocks)