refacto: remove buf_state

- remove buf_state and related code
- add get_node_at_cursor()
- better incremental selection (code is localized)
This commit is contained in:
kiyan42 2020-06-19 13:45:33 +02:00
parent 772aa4c169
commit 38af29a912
9 changed files with 100 additions and 233 deletions

View file

@ -5,7 +5,7 @@ local api = vim.api
local ts = vim.treesitter
local queries = require'nvim-treesitter.query'
local utils = require'nvim-treesitter.utils'
local parsers = require'nvim-treesitter.parsers'
local M = {
locals = {}
@ -18,7 +18,7 @@ function M.collect_locals(bufnr)
local query = queries.get_query(ft, 'locals')
if not query then return end
local parser = utils.get_parser(bufnr, ft)
local parser = parsers.get_parser(bufnr, ft)
if not parser then return end
local root = parser:parse():root()