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:
kiyan42 2020-05-15 14:19:29 +02:00
parent 5a66c38b9f
commit 8be2dc64a2
7 changed files with 108 additions and 108 deletions

View file

@ -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