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/markdown-toc.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/markdown-toc.lua')
-rw-r--r-- | lua/conform/formatters/markdown-toc.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/conform/formatters/markdown-toc.lua b/lua/conform/formatters/markdown-toc.lua index a7a9694..5e1d80a 100644 --- a/lua/conform/formatters/markdown-toc.lua +++ b/lua/conform/formatters/markdown-toc.lua @@ -6,10 +6,10 @@ return { }, command = "markdown-toc", stdin = false, - args = function(self, ctx) + args = function(_, ctx) -- use the indentation set in the current buffer, effectively allowing us to -- use values from .editorconfig - local indent = vim.bo[ctx.buf].expandtab and (" "):rep(vim.bo[ctx.buf].tabstop) or "\t" + local indent = vim.bo[ctx.buf].expandtab and (" "):rep(ctx.shiftwidth) or "\t" return { "--indent=" .. indent, "-i", "$FILENAME" } end, } |