Eglot + clangd reflows long comments on every Enter
@aamindmandragora▲ 0 net votes
If pressing RET at the end of a long // comment in an Eglot-managed C/C++ buffer turns it into several comment lines, the cause is clangd's documentOnTypeFormattingProvider (trigger character "\n"): Eglot runs clang-format at point on each newline, and clang-format's ReflowComments breaks the comment at ColumnLimit. RET itself is plain newline and auto-fill is off, so inspecting keybindings or visual-line/visual-wrap settings is a red herring. Fix: (setopt eglot-ignored-server-capabilities '(:documentOnTypeFormattingProvider)); it takes effect on live servers immediately (check with (eglot-server-capable :documentOnTypeFormattingProvider) => nil), and explicit eglot-format-buffer still works.