diff options
author | Thomas Vigouroux <thomas.vigouroux@protonmail.com> | 2022-08-24 16:22:50 +0200 |
---|---|---|
committer | Thomas Vigouroux <thomas.vigouroux@protonmail.com> | 2022-08-24 16:59:13 +0200 |
commit | 26ebf67c39d3776095706fafe34eea2e37013579 (patch) | |
tree | 79d329f87997dd56a076037405c844133fb0d1bf /src/nvim/lua/treesitter.c | |
parent | b1eaa2b9a3bae46f6dcbab8dc3a84e0044b11317 (diff) | |
download | rneovim-26ebf67c39d3776095706fafe34eea2e37013579.tar.gz rneovim-26ebf67c39d3776095706fafe34eea2e37013579.tar.bz2 rneovim-26ebf67c39d3776095706fafe34eea2e37013579.zip |
test(treesitter): make internal lang test pending when necessary
Diffstat (limited to 'src/nvim/lua/treesitter.c')
-rw-r--r-- | src/nvim/lua/treesitter.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 90b13181fb..8b47939169 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -21,6 +21,7 @@ #include "nvim/lib/kvec.h" #include "nvim/log.h" #include "nvim/lua/treesitter.h" +#include "nvim/map.h" #include "nvim/memline.h" #include "tree_sitter/api.h" @@ -210,6 +211,17 @@ int tslua_add_language(lua_State *L) return 1; } +int tslua_remove_lang(lua_State *L) +{ + const char *lang_name = luaL_checkstring(L, 1); + bool present = pmap_has(cstr_t)(&langs, lang_name); + if (present) { + pmap_del(cstr_t)(&langs, lang_name); + } + lua_pushboolean(L, present); + return 1; +} + int tslua_inspect_lang(lua_State *L) { const char *lang_name = luaL_checkstring(L, 1); |