3 Commits
Author SHA1 Message Date
dualfroz a7932b3404 Describe this repository 2026-10-22 21:05:28 +02:00
dualfroz 71779310b7 fix(printer): keep indentation of nested <<- heredoc inside command substitution
A <<- heredoc nested inside a command substitution that is itself inside
another <<- heredoc was printed with its body fully deindented and its end
marker pushed one extra tab further per body line.

When both heredocs use tab indentation, the printer wraps each body in an
extraIndenter. In the nested case the inner extraIndenter writes to the outer
one. Its computed indentation was emitted via WriteByte (which the outer
extraIndenter processes line by line), but the line content was emitted via
Write, whose method set is promoted straight to the embedded writer and so
bypassed the outer extraIndenter entirely. The content reached the tab writer
without the outer indentation, while the orphaned indentation bytes stayed
buffered and leaked onto the following end-marker line.

Emit the trimmed content through WriteString so nested extraIndenters compose,
keeping both the body and the end marker correctly indented.

Add printer golden tests for single- and multi-line nested tab heredocs.
2026-08-27 23:41:17 +02:00
upstream a87ad02bad Upstream mvdan/sh state of the touched files before 26a6955943 2026-08-27 23:41:17 +02:00