Skip to content

Commit

Permalink
fix(prettier): Fix range formatting of buffer (#322)
Browse files Browse the repository at this point in the history
Currently we provide a filename, which means prettier will format the
given file and not what we feed via stdin.
  • Loading branch information
cryptomilk committed Mar 11, 2024
1 parent f5f8498 commit bc93756
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/conform/formatters/prettier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ return {
end,
range_args = function(self, ctx)
local start_offset, end_offset = util.get_offsets_from_range(ctx.buf, ctx.range)
local args = eval_parser(self, ctx) or { "$FILENAME" }
local args = eval_parser(self, ctx) or { "--stdin-filepath", "$FILENAME" }
return vim.list_extend(args, { "--range-start=" .. start_offset, "--range-end=" .. end_offset })
end,
cwd = util.root_file({
Expand Down

0 comments on commit bc93756

Please sign in to comment.