diff options
Diffstat (limited to 'lua/conform')
-rw-r--r-- | lua/conform/formatters/format-queries.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lua/conform/formatters/format-queries.lua b/lua/conform/formatters/format-queries.lua index 6f7da25..42b4efa 100644 --- a/lua/conform/formatters/format-queries.lua +++ b/lua/conform/formatters/format-queries.lua @@ -15,7 +15,12 @@ return { end, command = "nvim", args = function() - return { "-l", get_format_script(), "$FILENAME" } + local script = get_format_script() + assert(script) + -- Manually set the runtimepath to put nvim-treesitter first. The format-queries script relies + -- on the nvim-treesitter parser; the one bundled with Neovim may be outdated. + local rtp = vim.fn.fnamemodify(script, ":h:h") + return { "-c", "set rtp^=" .. rtp, "-l", script, "$FILENAME" } end, stdin = false, } |