From d3180720f1072937696719ca21df429219306057 Mon Sep 17 00:00:00 2001 From: Senghan Bright Date: Wed, 16 Dec 2020 10:55:10 +0100 Subject: fix: support shiftwidth for indents. --- lua/nvim-treesitter/indent.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua') 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 -- cgit v1.2.3-70-g09d2