Skip to content
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

段落ブロックの末尾空行を取ってから段落生成 #883

Merged
merged 4 commits into from
Dec 12, 2017

Conversation

kmuto
Copy link
Owner

@kmuto kmuto commented Dec 11, 2017

#882 の修正

@@ -15,6 +15,7 @@ def detab(str, ts = 8)
def split_paragraph(lines)
pre = pre_paragraph
post = post_paragraph
lines.pop while lines[lines.size - 1] && lines[lines.size - 1].strip.empty?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは元のlinesに破壊的変更を加えるべきではなくて、blocked_linesの方で不要な空行を削るべきなのではないでしょうか…?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split_paragraph呼んでるところがバラバラなのと、blocked_linesのほうはともかく取り込むというスタンスになってるっぽいんだよねぇ。ちなみに//emlistなどの場合は末尾空行群はこれとは別にまとめて削除してるようだ

@kmuto
Copy link
Owner Author

kmuto commented Dec 12, 2017

1行whileか…いちおrubocopさんに従ってみる

@kmuto kmuto merged commit b2f980a into master Dec 12, 2017
@kmuto kmuto deleted the strip_p branch December 12, 2017 11:27
@takahashim
Copy link
Collaborator

まじですか、そのrubocopのルールはナイですね…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants