Closed OJFord closed 3 years ago
What language server are you seeing this in? I think this may be a server issue, as I can't reproduce in Go or Rust (for example). In any case, you could do something like this if you want to avoid this and even avoid the first re-save you have to do now.
function! AfterFormat abort
noautocmd w
endfunction
autocmd CursorHold <buffer> call LanguageClient#textDocument_formatting({}, 'AfterFormat')
I'm not 100% sure if this can introduce any issues with your flow but I would suspect it's fine given that you are already using the async version of formatting.
vls (Vue) when I reported it, but it is indeed fine with pyls (Python) so not a bug here, at least. (And I'm in no mood to look at any Vue code over a weekend..! :smile:)
I want to
autocmd CursorHold <buffer> call LanguageClient#textDocument_formatting()
, but currently the problem is that it writes out even if unchanged; so the buffer constantly reverts to being unsaved (unless I quit soon enough after writing thatCursorHold
doesn't kick in).