treesitter: allow to force predicate addition

This commit is contained in:
Thomas Vigouroux 2020-08-13 20:40:40 +02:00
parent 5900c99b7c
commit 6a8dcfab4b

View File

@ -119,8 +119,8 @@ local predicate_handlers = {
-- @param name the name of the predicate, without leading # -- @param name the name of the predicate, without leading #
-- @param handler the handler function to be used -- @param handler the handler function to be used
-- signature will be (match, pattern, bufnr, predicate) -- signature will be (match, pattern, bufnr, predicate)
function M.add_predicate(name, handler) function M.add_predicate(name, handler, force)
if predicate_handlers[name] then if predicate_handlers[name] and not force then
a.nvim_err_writeln(string.format("Overriding %s", name)) a.nvim_err_writeln(string.format("Overriding %s", name))
end end