aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorSenghan Bright <senghan.bright@deltaprojects.com>2020-12-16 10:55:10 +0100
committerThomas Vigouroux <tomvig38@gmail.com>2020-12-16 11:43:03 +0100
commitd3180720f1072937696719ca21df429219306057 (patch)
tree273a272a158a2bc8adf843dfdbfe0488300ec37d /lua
parentRuby highlights: Unify call and method_call (follow tree-sitter-ruby) (diff)
downloadnvim-treesitter-d3180720f1072937696719ca21df429219306057.tar
nvim-treesitter-d3180720f1072937696719ca21df429219306057.tar.gz
nvim-treesitter-d3180720f1072937696719ca21df429219306057.tar.bz2
nvim-treesitter-d3180720f1072937696719ca21df429219306057.tar.lz
nvim-treesitter-d3180720f1072937696719ca21df429219306057.tar.xz
nvim-treesitter-d3180720f1072937696719ca21df429219306057.tar.zst
nvim-treesitter-d3180720f1072937696719ca21df429219306057.zip
fix: support shiftwidth for indents.
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/indent.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua
index cfc3f8a94..ffbb8c0b7 100644
--- a/lua/nvim-treesitter/indent.lua
+++ b/lua/nvim-treesitter/indent.lua
@@ -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