diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-08-13 20:40:40 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-08-13 20:40:40 +0200 |
commit | 6a8dcfab4b2bada9c68379ee17235974fa8ad411 (patch) | |
tree | b4971f972a5bc37671d3c7d78eef498104a829db /runtime/lua/vim/treesitter/query.lua | |
parent | 5900c99b7cbf603b26e1e4eff6428583f8e0c926 (diff) | |
download | rneovim-6a8dcfab4b2bada9c68379ee17235974fa8ad411.tar.gz rneovim-6a8dcfab4b2bada9c68379ee17235974fa8ad411.tar.bz2 rneovim-6a8dcfab4b2bada9c68379ee17235974fa8ad411.zip |
treesitter: allow to force predicate addition
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index 0665a837e9..17f61b24f1 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -119,8 +119,8 @@ local predicate_handlers = { -- @param name the name of the predicate, without leading # -- @param handler the handler function to be used -- signature will be (match, pattern, bufnr, predicate) -function M.add_predicate(name, handler) - if predicate_handlers[name] then +function M.add_predicate(name, handler, force) + if predicate_handlers[name] and not force then a.nvim_err_writeln(string.format("Overriding %s", name)) end |