-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support beginning-of-line-text
and (fill-paragraph 't)
in comments
#549
Comments
Is the bug reproducible when you are using with tree-sitter enabled: https://github.com/rust-lang/rust-mode?tab=readme-ov-file#tree-sitter ? |
Actually I had |
Hmm, that's strange. This is what happens in my Rust buffer with tree sitter enabled:
Any chance you can run your Emacs only with the |
I've removed my whole |
Hmm, strange. Just to double check - does evaluating this show
|
Gives: But if I type
Then it correctly highlights the function names. |
Does the |
I don't think so, but I can't check since I'm no longer in front of the work computer where that happened. Here at home, I have a different behaviour:
Weird… |
OK I figured out why |
I can confirm that |
Ah, okay. That means that rust-mode is not using the tree sitter implementation for it. What happens if you do |
I hadn't realized that tree-sitter was included in emacs >=29, so I was still installing it from melpa. And I hadn't realized that there were two distinct rust modes with or without tree-sitter. In Emacs 29.2 on Linux using
|
FWIW, |
I'm not sure if this should be two issues or one, but they feel related.
When programming in C/C++ with
cc-mode
, when the cursor is inside a comment and I hitM-<home>
(which is bound tobeginning-of-line-text
), then the cursor moves to the first character of the comment text after the comments symbols, e.g.:In
rust-mode
, the cursor moves to the first non-whitespace character (same asback-to-indentation
).Possibly related: when I hit
C-u M-q
(bound to(fill-paragraph 't)
) to justify a paragraph in a comment,rust-mode
adds extra spaces to the begnining of some lines:whereas
cc-mode
is able to justify the text correctly:I believe both issues may be related to identifying and setting the
fill-prefix
when these functions are called inside comments. It would be nice to have those working as incc-mode
.The text was updated successfully, but these errors were encountered: