From 6dc1603ea408f476a57937bbeaf7f86520a21a98 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 7 May 2024 16:25:03 -0700 Subject: feat: formatters can use $RELATIVE_FILEPATH in args (#349) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 027a7ce..2ff572b 100644 --- a/README.md +++ b/README.md @@ -464,7 +464,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) @@ -478,7 +478,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 }) -- cgit v1.2.3-70-g09d2