diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-08-22 20:46:40 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-08-31 18:56:41 +0200 |
| commit | 5948aba886e8aad26043402684cf85c307813c4d (patch) | |
| tree | ea402ab5c1468fb76c49a0e1f39a6c60b1260831 /lua/nvim-treesitter/utils.lua | |
| parent | ffe7d96dfda89857a757656ba9e4b079fff6e33f (diff) | |
feat(refactor.navigation): add navigation.goto_{next,previous}_usage
Diffstat (limited to 'lua/nvim-treesitter/utils.lua')
| -rw-r--r-- | lua/nvim-treesitter/utils.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index 101bfafa..c080c2a9 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -67,4 +67,12 @@ function M.set_jump() vim.cmd "normal! m'" end +function M.index_of(tbl, obj) + for i, o in ipairs(tbl) do + if o == obj then + return i + end + end +end + return M |
