mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 21:10:15 -04:00
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.
This commit is contained in:
parent
5a66c38b9f
commit
8be2dc64a2
7 changed files with 108 additions and 108 deletions
|
|
@ -111,4 +111,12 @@ function M.get_buf_state(bufnr)
|
|||
return buffers[bufnr]
|
||||
end
|
||||
|
||||
function M.exposed_state(bufnr)
|
||||
local buf_state = buffers[bufnr]
|
||||
return {
|
||||
cursor_pos = buf_state.cursor_pos,
|
||||
current_node = buf_state.current_node
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue