Open lightcap opened 3 years ago
do you have swap files enabled in vim?
I don't, no.
Hi @lightcap, did you manage to get it works? I am facing the same problem with neovim + efm + htmlbeautifier.
Manage to figure out the solution, I think we need the format-stdin = true
as mentioned here
return {
lintCommand = "erb -x -T - | ruby -c",
lintStdin = true,
lintOffset = 1,
formatCommand = "htmlbeautifier",
formatStdin = true,
lintIgnoreExitCode = true,
lintDebounce = "2s",
}
@marcushwz I wasn't. No, I gave up.
I'll try to explain this as best I can, and I'm not sure if this is an issue with CoC, efm-langserver or htmlbeautifier.
First off, in case it's not obvious from the above this is using:
efm-langserver 0.0.26 (rev: HEAD/go1.15.6) coc.nvim 0.0.80 using node 15.4.0 htmlbeautifier 1.3.1 nvim 0.4.4 ruby 2.7.2
I can see from the efm-langserver logs that the format is successful on writing an eruby filetype.
But when that happens I get:
If I say no the buffer goes blank and I see a
W12
warning:L
will load the file with the formatting applied properly. So it's clear that the file is being written to outside of vim.But if I choose
O
the file is saved as the empty buffer, overwriting the changes as an empty file. Very not ideal.Of course, if I carefully choose the path through the options the formatting works. But this doesn't happen with any of the other format on write formatters I use, and it can't be the expected behavior.
What's wrong?