diff options
| author | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-05-15 14:19:29 +0200 |
|---|---|---|
| committer | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-05-15 14:19:29 +0200 |
| commit | 8be2dc64a2e0a94a429d66c411eb7d500566508f (patch) | |
| tree | d4000f95f0f472478036a89b19a2f55aadbb5fff /lua/nvim-treesitter.lua | |
| parent | 5a66c38b9ff49f0f0b45afa95816c77e18cc9886 (diff) | |
Expose internal api.
- add `exposed_state` to expose 'current_node' and 'cursor_pos'
for a current buffer to the user.
- add `get_buf_state` and `get_node_api` for users.
- add documentation about api functions.
- remove `node_movement` module which should be done in user side.
Diffstat (limited to 'lua/nvim-treesitter.lua')
| -rw-r--r-- | lua/nvim-treesitter.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua index 5c0dfac7..100324e3 100644 --- a/lua/nvim-treesitter.lua +++ b/lua/nvim-treesitter.lua @@ -5,6 +5,7 @@ local utils = require'nvim-treesitter.utils' local info = require'nvim-treesitter.info' local configs = require'nvim-treesitter.configs' local state = require'nvim-treesitter.state' +local ts_utils = require'nvim-treesitter.ts_utils' local M = {} @@ -55,4 +56,13 @@ function M.statusline(indicator_size) end end +function M.get_buf_state() + local bufnr = api.nvim_get_current_buf() + return state.exposed_state(bufnr) +end + +function M.get_node_api() + return ts_utils +end + return M |
