d41761d6e9
Rewrites oxker from Rust/ratatui to Go/Bubbletea, migrated to the Bubbletea v2 API (charm.land/bubbletea/v2). Removes all original Rust source files and legacy Go modules (internal/ui, internal/input, bubbles). Key changes: - View() returns tea.View with declarative AltScreen and MouseMode - KeyMsg → KeyPressMsg, MouseMsg → MouseClickMsg/WheelMsg/MotionMsg/ReleaseMsg - execWriteKey rewritten for v2 key fields (Code/Mod/Text) - Mouse toggle via View field instead of imperative commands - Filter/search text input uses msg.Text for v2 space key compat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
469 B
Go
27 lines
469 B
Go
package utils
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/olekukonko/tablewriter"
|
|
)
|
|
|
|
func FormatTable(data [][]string) string {
|
|
var sb strings.Builder
|
|
table := tablewriter.NewWriter(&sb)
|
|
table.SetHeader([]string{})
|
|
table.SetBorder(false)
|
|
table.SetColMinWidth(0, 10)
|
|
table.SetColMinWidth(1, 20)
|
|
table.SetColMinWidth(2, 25)
|
|
table.SetColMinWidth(3, 15)
|
|
table.SetColMinWidth(4, 20)
|
|
|
|
for _, row := range data {
|
|
table.Append(row)
|
|
}
|
|
|
|
table.Render()
|
|
return sb.String()
|
|
}
|