sbdchd / neoformat

:sparkles: A (Neo)vim plugin for formatting code.
BSD 2-Clause "Simplified" License
1.98k stars 189 forks source link

[Solved] fprettify makes nvim buffer empty #453

Closed EhsanAramide closed 1 year ago

EhsanAramide commented 1 year ago

I use neoformat with these settings:

vim.g.neoformat_fortran_fprettify = {
    exe = "fprettify",
    args = {"--silent", "-i 4"},
}
vim.g.neoformat_enabled_fortran = {"fprettify"}

but when I run :Neoformat or other derivatives like :Neoformat! fortran or :Neofortran fprettify the buffer is made empty.

EhsanAramide commented 1 year ago

[Answer] I found the problem. Based on autoload settings, option 'stdin': 1 has been set by default. when we pass our settings or definitions to neoformat, based on these lines, it will replace the default definition with our definition that we had set, so we can add 'stdin': 1 to our definition.