aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2024-03-11 16:56:30 +0100
committerGitHub <noreply@github.com>2024-03-11 08:56:30 -0700
commitbc937565f251866c0ff344fd13fe27f00a4c0d25 (patch)
treebedb2f528f4d817b47f876fdfee062596e5db051 /lua/conform
parentf5f8498cf27931e06645c9fe020b9c28dce49d98 (diff)
fix(prettier): Fix range formatting of buffer (#322)
Currently we provide a filename, which means prettier will format the given file and not what we feed via stdin.
Diffstat (limited to 'lua/conform')
-rw-r--r--lua/conform/formatters/prettier.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/conform/formatters/prettier.lua b/lua/conform/formatters/prettier.lua
index 9274577..b882d66 100644
--- a/lua/conform/formatters/prettier.lua
+++ b/lua/conform/formatters/prettier.lua
@@ -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({