Disable the feature that adds `(* *)` to a new line when pressing Enter in a comment?
Ptival opened this issue · 7 comments
I really don't like this feature.
Is there a way to enter a new line in a comment when it is enabled? Or a way to disable it?
I'm not even sure what the feature is called or where it comes from, which is a little frustrating. It somehow happens when pressing RET
, which calls company-coq-maybe-exit-snippet
, while in a comment.
Thanks! :-)
How puzzling. Can you try this code (using M-:
)? What does it do (does it insert the comment marks?) and what does it print? (newline
?)
(let* ((company-coq--keybindings-minor-mode nil)
(original-func (key-binding [13] t)))
(if original-func (call-interactively (print original-func))
(self-insert-command arg)))
Oh, it outputs evil-ret
. Now that I think about it, it might not be a company-coq
feature as I had assumed, but something to do with my emacs configuration. I'm using doom-emacs. It comes bundled with a bunch of libraries that might be at fault here...
What's weird is that if I run M-x evil-ret
, it does what I would like it to do...
EDIT: Nevermind, I wasn't doing it properly. It actually runs newline-and-indent
, which might be what my problem is.
Thanks for testing. I don't have a good story for the next step of debugging. Usually I use M-x find-function RET newline-and-indent RET
to find the definition of that function, and use C-u C-M-x
to instrument it. Reproducing the issue by pressing RET in a comment then drops me in the debugger, where I can step through the implementation with SPC and see who or what inserts the comment marks.
Did you figure it out? :)
No, but I think it's my emacs mode rather than company-coq at this point! :D
Actually, I figured it out, it's this:
https://github.com/hlissner/doom-emacs/blob/develop/core/autoload/editor.el#L288-L299
Super :) Great sleuthing.