aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/options_doc.lua
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2024-05-07 16:25:03 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2024-05-07 16:25:15 -0700
commit6dc1603ea408f476a57937bbeaf7f86520a21a98 (patch)
tree095014f597d256cd3c3a4bfc40df8552a7c65470 /scripts/options_doc.lua
parent393210360b9e807862e5329763526509f52b5218 (diff)
feat: formatters can use $RELATIVE_FILEPATH in args (#349)
Diffstat (limited to 'scripts/options_doc.lua')
-rw-r--r--scripts/options_doc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/options_doc.lua b/scripts/options_doc.lua
index 96c0f2b..3e22802 100644
--- a/scripts/options_doc.lua
+++ b/scripts/options_doc.lua
@@ -48,7 +48,7 @@ require("conform").setup({
-- Return a single string instead of a list to run the command in a shell
args = { "--stdin-from-filename", "$FILENAME" },
-- If the formatter supports range formatting, create the range arguments here
- range_args = function(ctx)
+ range_args = function(self, ctx)
return { "--line-start", ctx.range.start[1], "--line-end", ctx.range["end"][1] }
end,
-- Send file contents to stdin, read new contents from stdout (default true)
@@ -62,7 +62,7 @@ require("conform").setup({
-- When stdin=false, use this template to generate the temporary file that gets formatted
tmpfile_format = ".conform.$RANDOM.$FILENAME",
-- When returns false, the formatter will not be used
- condition = function(ctx)
+ condition = function(self, ctx)
return vim.fs.basename(ctx.filename) ~= "README.md"
end,
-- Exit codes that indicate success (default { 0 })