1

I just installed lsp-mode for use with C++. It's reformatting my comments as I type. For example, if I have a doxygen comment like this:

/// Blah blah blah ... blah blah the end. [cursor here]
///
class Thing 

And I hit the return key, it reflows it, something like:

/// Blah blah ...
/// blah the end. [cursor here]

How do turn this off, or tell it I want a wider text width?

2 Answers 2

1

I found this: https://github.com/emacs-lsp/lsp-mode/issues/1342

A comment there suggested setting lsp-enable-on-type-formatting to nil. I did that and re-opened a file, and it worked for me. It was no longer annoying me by reformatting my comments when I typed a newline.

0

lsp-mode doesn’t reindent anything. It is the LSP server that can make these kinds of changes. Read the help files for your LSP server to find out what configuration options is has.

1
  • Okay, I'll look into that. I was using eglot before and this wasn't happening, and they both use clangd.
    – Rob N
    Commented Oct 22, 2022 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.