diff options
author | Jongwook Choi <wookayin@gmail.com> | 2023-12-08 01:36:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 22:36:38 -0800 |
commit | 48bc9996ebfe90e7766f46338360f75fd6ecb174 (patch) | |
tree | b22dafcb52e158c63a96ad4e15d9235c366259a3 /lua | |
parent | ce95e6b2a072d81fd312ff213f241cacab1eccef (diff) |
fix(formatexpr): does not fallback to the built-in formatexpr (#238)
This makes the behavior of formatexpr more consistent with
`vim.lsp.formatexpr`; do not run vim's builtin formatter.
Problem: When conform's formatexpr is used and (range or buffer) but
conform can't do formatting and there is no LSP formatter with the
formatting capabilities, it will fall back to the (wrong) built-in
formatting, which might result in simply concatenating all the words.
This is a breaking change, reverting the behavior introduced in #55.
Diffstat (limited to 'lua')
-rw-r--r-- | lua/conform/init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/conform/init.lua b/lua/conform/init.lua index d980b8f..3824b4b 100644 --- a/lua/conform/init.lua +++ b/lua/conform/init.lua @@ -719,7 +719,8 @@ M.formatexpr = function(opts) -- No formatters were available; fall back to lsp formatter return vim.lsp.formatexpr({ timeout_ms = opts.timeout_ms }) else - return 1 + -- Do not fallback to built-in formatter. + return 0 end end |