mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 05:50:04 -04:00
fix: support shiftwidth for indents.
This commit is contained in:
parent
5f20329e96
commit
d3180720f1
1 changed files with 2 additions and 1 deletions
|
|
@ -50,11 +50,12 @@ function M.get_indent(lnum)
|
|||
node = node:parent()
|
||||
end
|
||||
|
||||
local ind_size = vim.bo.softtabstop < 0 and vim.bo.shiftwidth or vim.bo.tabstop
|
||||
local ind = 0
|
||||
while node do
|
||||
node = node:parent()
|
||||
if indents[tostring(node)] then
|
||||
ind = ind + vim.bo.tabstop
|
||||
ind = ind + ind_size
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue