diff options
author | Micah Halter <micah@mehalter.com> | 2024-07-01 13:58:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 10:58:55 -0700 |
commit | cd75be867f2331b22905f47d28c0c270a69466aa (patch) | |
tree | 026bb2bd83bacad4e12e590b67073d4472197733 /lua/conform/formatters/djlint.lua | |
parent | fc19dfc0e7d0f5e9f01cd42a4c518e030b3790f0 (diff) |
feat(shfmt): add automatic indentation detection (#481)
* feat(shfmt): automatically detect indentation
* fix(markdown-toc): improve correctness of indentation size calculation
* fix(djlint): improve correctness of indentation size calculation
* feat: add effective `shiftwidth` to `conform.Context`
this also refactors formatters that automatically set indentation level
to use the new shiftwidth context
Diffstat (limited to 'lua/conform/formatters/djlint.lua')
-rw-r--r-- | lua/conform/formatters/djlint.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lua/conform/formatters/djlint.lua b/lua/conform/formatters/djlint.lua index b7a177b..13c966d 100644 --- a/lua/conform/formatters/djlint.lua +++ b/lua/conform/formatters/djlint.lua @@ -7,8 +7,7 @@ return { }, command = "djlint", args = function(_, ctx) - local indent = vim.bo[ctx.buf].tabstop or 4 -- default is 4 - return { "--reformat", "--indent", indent, "-" } + return { "--reformat", "--indent", ctx.shiftwidth, "-" } end, cwd = util.root_file({ ".djlintrc", |