Skip to content

Commit

Permalink
ui: put space in between input/output on odd terminal width (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktprograms authored Sep 30, 2022
1 parent 92ce6ee commit f3445e3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tui/bubbles/jqplayground/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ import (
)

func (b Bubble) View() string {
inputoutput := []string{b.inputdata.View()}
if b.width % 2 != 0 {
inputoutput = append(inputoutput, " ")
}
inputoutput = append(inputoutput, b.output.View())

if b.state == state.Save {
return lipgloss.JoinVertical(
lipgloss.Left,
b.queryinput.View(),
lipgloss.JoinHorizontal(lipgloss.Top, b.inputdata.View(), b.output.View()),
lipgloss.JoinHorizontal(lipgloss.Top, inputoutput...),
b.fileselector.View(),
b.statusbar.View(),
b.help.View())
Expand All @@ -20,7 +25,7 @@ func (b Bubble) View() string {
return lipgloss.JoinVertical(
lipgloss.Left,
b.queryinput.View(),
lipgloss.JoinHorizontal(lipgloss.Top, b.inputdata.View(), b.output.View()),
lipgloss.JoinHorizontal(lipgloss.Top, inputoutput...),
b.statusbar.View(),
b.help.View())
}

0 comments on commit f3445e3

Please sign in to comment.