mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
style: avoid overindenting things
This commit is contained in:
parent
51ca6a5069
commit
5783e7d248
1 changed files with 12 additions and 12 deletions
|
|
@ -17,23 +17,23 @@ end
|
||||||
function M.collect_locals(bufnr)
|
function M.collect_locals(bufnr)
|
||||||
local ft = api.nvim_buf_get_option(bufnr, "ft")
|
local ft = api.nvim_buf_get_option(bufnr, "ft")
|
||||||
|
|
||||||
if ft then
|
if not ft then return end
|
||||||
local query = queries.get_query(ft, 'locals')
|
|
||||||
local parser = parsers.get_parser(bufnr)
|
|
||||||
|
|
||||||
if parser then
|
local query = queries.get_query(ft, 'locals')
|
||||||
local root = parser:parse():root()
|
local parser = parsers.get_parser(bufnr)
|
||||||
local start_row, _, end_row, _ = root:range()
|
|
||||||
|
|
||||||
local locals = {}
|
if not parser then return end
|
||||||
|
|
||||||
for prepared_match in queries.iter_prepared_matches(query, root, bufnr, start_row, end_row) do
|
local root = parser:parse():root()
|
||||||
table.insert(locals, prepared_match)
|
local start_row, _, end_row, _ = root:range()
|
||||||
end
|
|
||||||
|
|
||||||
return locals
|
local locals = {}
|
||||||
end
|
|
||||||
|
for prepared_match in queries.iter_prepared_matches(query, root, bufnr, start_row, end_row) do
|
||||||
|
table.insert(locals, prepared_match)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return locals
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.on_lines(_, buf, _, firstline, lastline, new_lastline)
|
function M.on_lines(_, buf, _, firstline, lastline, new_lastline)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue