Zulip Chat Archive
Stream: lean4
Topic: Lean LSP inserts comment delimiters after return
Leni Aniva (Sep 10 2024 at 03:03):
I don't know if this is because of my settings (which I have left as the default) or it occurs for everyone. I use Lean4 plugin for Emacs. If I have some code like this
/-
comment
-/
def mystery (a: Nat) := a + 1
when I try to insert a new line after comment, I get
/-
comment-/
/-
-/
def mystery (a: Nat) := a + 1
Two additional comment delimiters get inserted automatically. How can I prevent this from happening? It gets very annoying when I type multi-line comments
Jannis Limperg (Sep 10 2024 at 06:06):
I set comment-multi-line t in lean4-mode, which seems to make Emacs's behaviour slightly less annoying. I tried to fully fix the issue at some point, but didn't manage.
Paul Nelson (Sep 15 2024 at 19:52):
How are you attempting to insert a newline? I only get the behavior you describe using default-indent-new-line (bound to M-j for me), and not via newline (bound to RET for me).
Leni Aniva (Sep 15 2024 at 21:27):
Paul Nelson said:
How are you attempting to insert a newline? I only get the behavior you describe using
default-indent-new-line(bound toM-jfor me), and not vianewline(bound toRETfor me).
same, but my keybinding binds RET to default-indent-new-line
Last updated: May 02 2025 at 03:31 UTC