Skip to content

Commit 3e0e3af

Browse files
authored
fix: escape module names in reload.reload_module() (#313)
This adds support for `-` in module names.
1 parent 9fafacf commit 3e0e3af

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lua/plenary/reload.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ reload.reload_module = function(module_name, starts_with_only)
1313
return string.find(pack, module_name, 1, true)
1414
end
1515
else
16+
local module_name_pattern = vim.pesc(module_name)
1617
matcher = function(pack)
17-
return string.find(pack, "^" .. module_name)
18+
return string.find(pack, "^" .. module_name_pattern)
1819
end
1920
end
2021

0 commit comments

Comments
 (0)