aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/undo.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:29:09 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:29:09 +0200
commit17e933a16ff7de1b06d62504e78c40e615c8b553 (patch)
tree0ceb58ff18f9ee6f35fbcb6255c8a830e6124b84 /cmd/krino/undo.go
parent59015f1f91d640502fdfc34019cf0154b5206bb8 (diff)
downloadkrino-17e933a16ff7de1b06d62504e78c40e615c8b553.tar.gz
krino-17e933a16ff7de1b06d62504e78c40e615c8b553.zip
review and undo headings wrap past the label column; format characters take a column
Diffstat (limited to 'cmd/krino/undo.go')
-rw-r--r--cmd/krino/undo.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/krino/undo.go b/cmd/krino/undo.go
index 4c71fdd..ecab2f3 100644
--- a/cmd/krino/undo.go
+++ b/cmd/krino/undo.go
@@ -404,9 +404,17 @@ func reviewUndoPerFile(in io.Reader, out io.Writer, files []engine.UndoFile, p p
approved = map[int]bool{}
yesRest := false
for i, f := range files {
- fmt.Fprintf(out, "\n[%d/%d] %s/%s\n", i+1, len(files), display(f.Dir), display(f.File))
+ // Heading and steps wrap past the action column, so a long name or
+ // path cannot pass for a step line (plan 11 review L4).
+ width := widthPolicy(out)
+ fmt.Fprintln(out)
+ for _, l := range wrapped("", fmt.Sprintf("[%d/%d] %s/%s", i+1, len(files), display(f.Dir), display(f.File)), 7+undoStepWidth+2, width, plainText) {
+ fmt.Fprintln(out, l)
+ }
for _, s := range f.Steps {
- fmt.Fprintf(out, " %s\n", undoActionCell(s))
+ for _, l := range wrapped(" ", undoActionCell(s), 7+undoStepWidth+2, width, plainText) {
+ fmt.Fprintln(out, l)
+ }
}
if f.Refused != "" {
fmt.Fprintf(out, " refused: %s\n", display(f.Refused))