diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-05-15 15:01:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 15:01:06 +0200 |
| commit | 9c3211119141dd751b7a045f37fb742c19b75cb2 (patch) | |
| tree | d4000f95f0f472478036a89b19a2f55aadbb5fff /lua/nvim-treesitter/state.lua | |
| parent | 5a66c38b9ff49f0f0b45afa95816c77e18cc9886 (diff) | |
| parent | 8be2dc64a2e0a94a429d66c411eb7d500566508f (diff) | |
Merge pull request #54 from kyazdani42/feat/expose-api
Expose internal api.
Diffstat (limited to 'lua/nvim-treesitter/state.lua')
| -rw-r--r-- | lua/nvim-treesitter/state.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/state.lua b/lua/nvim-treesitter/state.lua index 9da07ae1..d682bd28 100644 --- a/lua/nvim-treesitter/state.lua +++ b/lua/nvim-treesitter/state.lua @@ -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 |
