Can't type an empty line within RDoc comments

已回答

When I write Ruby doc comments, I often leave an empty line to separate paragraphs or code blocks. When I do this, pressing Enter causes the leading `#` for the empty line to be deleted. I want it to leave the leading `#` and start a new line with another `#`, continuing the comment.

##
# Consider the following code block:
#<press Enter>
class Foo

Actual behavior:

##
# Consider the following code block:

class Foo

Desired behavior:

##
# Consider the following code block:
#
#
class Foo
0

Hello Cameron,

that was a feature added in https://youtrack.jetbrains.com/issue/RUBY-22978/Allow-for-an-easy-way-to-exit-line-comment-continuation, it's an easy way to exit line comment continuation, similar to how other editors work with bullet points or quoted blocks.

To get your desired behaviour, you may press "Shift+Enter", and that will leave the empty line comment and start a new line comment without deleting the previous "#". If instead you don't like this behaviour, it can be turned off in the settings by going "Advanced Settings", and looking for the "Ruby" section.

1

请先登录再写评论。