Skip to content

Commit

Permalink
Fix header row style.
Browse files Browse the repository at this point in the history
lipgloss changed the row numbering in this PR (charmbracelet/lipgloss#377)
  • Loading branch information
boks1971 committed Nov 1, 2024
1 parent ae02d1e commit a77e6ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/lk/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/lipgloss/table"
"github.com/urfave/cli/v3"

"github.com/livekit/livekit-cli/pkg/config"
Expand Down Expand Up @@ -249,9 +250,9 @@ func listProjects(ctx context.Context, cmd *cli.Command) error {
table := CreateTable().
StyleFunc(func(row, col int) lipgloss.Style {
switch {
case row == 0:
case row == table.HeaderRow:
return headerStyle
case cliConfig.Projects[row-1].Name == cliConfig.DefaultProject:
case cliConfig.Projects[row].Name == cliConfig.DefaultProject:
return selectedStyle
default:
return baseStyle
Expand Down
2 changes: 1 addition & 1 deletion cmd/lk/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func CreateTable() *table.Table {
headerStyle := baseStyle.Bold(true)

styleFunc := func(row, col int) lipgloss.Style {
if row == 0 {
if row == table.HeaderRow {
return headerStyle
}
return baseStyle
Expand Down

0 comments on commit a77e6ea

Please sign in to comment.