mirror of
https://github.com/taigrr/teaqlite.git
synced 2026-04-02 04:59:03 -07:00
update size based on screen
This commit is contained in:
@@ -165,9 +165,16 @@ func (m *RowDetailModel) View() string {
|
||||
}
|
||||
|
||||
value := row[i]
|
||||
if len(value) > 50 {
|
||||
// Calculate available width for value display
|
||||
// Account for column name, ": ", and indentation
|
||||
availableWidth := m.Shared.Width - len(col) - 4 // 4 for ": " and "> " prefix
|
||||
if availableWidth < 20 {
|
||||
availableWidth = 20 // Minimum width
|
||||
}
|
||||
|
||||
if len(value) > availableWidth {
|
||||
// Wrap long values
|
||||
lines := WrapText(value, 50)
|
||||
lines := WrapText(value, availableWidth)
|
||||
value = strings.Join(lines, "\n ")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user