diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-02-07 10:41:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 10:41:02 +0100 |
commit | 120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e (patch) | |
tree | 26311a11f79d7c67f7590ace4009bb730752974c /src/nvim/lua/treesitter.c | |
parent | 017b25101a3bb428d96ee956cbe32c4fe6dcc00d (diff) | |
parent | ef2e6522c53d562928060a4872020fb8f32c8ff8 (diff) | |
download | rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.gz rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.bz2 rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.zip |
Merge pull request #11757 from bfredl/treesitter_runtime
treesitter: add standard search path for parsers + bundle c parser properly
Diffstat (limited to 'src/nvim/lua/treesitter.c')
-rw-r--r-- | src/nvim/lua/treesitter.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 874fabd89f..a420f79ffd 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -119,7 +119,14 @@ void tslua_init(lua_State *L) build_meta(L, "treesitter_querycursor", querycursor_meta); } -int tslua_register_lang(lua_State *L) +int tslua_has_language(lua_State *L) +{ + const char *lang_name = luaL_checkstring(L, 1); + lua_pushboolean(L, pmap_has(cstr_t)(langs, lang_name)); + return 1; +} + +int tslua_add_language(lua_State *L) { if (lua_gettop(L) < 2 || !lua_isstring(L, 1) || !lua_isstring(L, 2)) { return luaL_error(L, "string expected"); |