https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112021-12-29T13:28:27ZRuby Issue Tracking SystemRuby master - Feature #18450: Force break in prettyprinthttps://bugs.ruby-lang.org/issues/18450?journal_id=957192021-12-29T13:28:27Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>akr (Akira Tanaka)</i></li></ul><p>Could you explain a use case?</p> Ruby master - Feature #18450: Force break in prettyprinthttps://bugs.ruby-lang.org/issues/18450?journal_id=957202021-12-29T14:02:55Zfirasalkhalil (Firas al-Khalil)
<ul></ul><p>mame (Yusuke Endoh) wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>Could you explain a use case?</p>
</blockquote>
<p>I am writing a code generator where in some cases I need to force-break the output code because it makes more sense for a human reader/reviewer:<br>
Here's an example taken directly from my production code:</p>
<pre><code>out.nest {
out.break if code.has_special_condition?
visitor.process(code[:body])
# =snip=
}
</code></pre> Ruby master - Feature #18450: Force break in prettyprinthttps://bugs.ruby-lang.org/issues/18450?journal_id=972692022-04-15T08:55:16Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/18654">Feature #18654</a>: Enhancements to prettyprint</i> added</li></ul>