Add automatic wrapping of the content based on terminal width

This commit is contained in:
2025-11-29 01:59:23 +00:00
parent 1b832e2fcf
commit 9598444d56
6 changed files with 149 additions and 23 deletions
+3 -2
View File
@@ -174,7 +174,7 @@ func (b *BackupPicker) selectView() string {
}
leftSb.WriteString("\n")
leftSb.WriteString(helpDescStyle.Render("↑↓ navigate • Enter restore • Esc cancel"))
leftSb.WriteString(WrapHelpText("↑↓ navigate • Enter restore • Esc cancel", 40))
// Build right panel (preview)
var rightSb strings.Builder
@@ -219,7 +219,8 @@ func (b *BackupPicker) selectView() string {
// Show scroll indicator
if len(lines) > previewHeight {
rightSb.WriteString("\n")
rightSb.WriteString(helpDescStyle.Render(fmt.Sprintf("Lines %d-%d of %d (Shift+↑↓ scroll)", b.previewScroll+1, endLine, len(lines))))
scrollText := fmt.Sprintf("%d-%d of %d (↑↓ scroll)", b.previewScroll+1, endLine, len(lines))
rightSb.WriteString(helpDescStyle.Render(scrollText))
}
}