Closed bemoody closed 2 weeks ago
I'm not sure what you're saying.
I could rename the function rust-mode-indent-line to rust-simple-indent-line and rename rust-doc-indent-line to rust-mode-indent-line.
If you're suggesting to turn it into one massive function, I think that's unwise. There is very little overlap in logic/functionality between those two functions: rust-doc-indent-line is concerned with rustdoc syntax, not with rust syntax. It's almost completely orthogonal to the programming language.
@jcs090218 Do you agree with the comments of @bemoody ?
@bemoody Thanks for the PR, LGTM from a high level. Is it possible to have a test for this functionality ?
I suggest renaming rust-mode-indent-line to rust-mode--indent-line (or name anything logical) and creating a new rust-mode-indent-line to call the other two functions, etc.
I think it doesn't really matter since it requires little to no refactoring right now. 🤔
Got it, Thanks!
@bemoody Do you think you can do the following renames:
Adding a test would be nice and I think there are already some test related to indentation in rust-mode-tests.el from which you can take inspiration from.
Sure, sounds good! I haven't worked with ert before, but I think this should do the trick.
Allow pressing Tab to indent example code blocks inside comments.
For example, if the buffer contains this:
Move to the word "world" and press Tab, and you should see: