- commit
- 3fa7a00d877599248b5dffbc6242c61df26c69cb
- parent
- 3a54d08b9bbef3dda481bae3d6354aa3f816c207
- author
- Dami <dami.etoile@gmail.com>
| M | sudoku/ | 19 | +++++++++++++------ |
| M | vhs/ | 2 | +- |
@@ -67,7 +67,11 @@ func renderGrid(m Model, solved bool, conflicts [gridSize][gridSize]bool) string
6767 6868 // Insert vertical box separator after columns 3 and 66969 if x == 2 || x == 5 {70- sep := lipgloss.NewStyle().Foreground(boxBorderFG).Background(backgroundColor).Render("│")70+ bg := backgroundColor71+ if m.cursor.Y == y {72+ bg = crosshairBG73+ }74+ sep := lipgloss.NewStyle().Foreground(boxBorderFG).Background(bg).Render("│")7175 cells = append(cells, sep)7276 }7377 }@@ -77,15 +81,18 @@ func renderGrid(m Model, solved bool, conflicts [gridSize][gridSize]bool) string
7781 // Insert horizontal box separator after rows 3 and 67882 if y == 2 || y == 5 {7983 sepLine := strings.Repeat("─", sudokuCellWidth)80- var sepParts []string84+ var renderedParts []string8185 for x := range gridSize {82- sepParts = append(sepParts, sepLine)86+ bg := backgroundColor87+ if m.cursor.X == x {88+ bg = crosshairBG89+ }90+ renderedParts = append(renderedParts, lipgloss.NewStyle().Foreground(boxBorderFG).Background(bg).Render(sepLine))8391 if x == 2 || x == 5 {84- sepParts = append(sepParts, "┼")92+ renderedParts = append(renderedParts, lipgloss.NewStyle().Foreground(boxBorderFG).Background(backgroundColor).Render("┼"))8593 }8694 }87- sep := lipgloss.NewStyle().Foreground(boxBorderFG).Background(backgroundColor).Render(strings.Join(sepParts, ""))88- rows = append(rows, sep)95+ rows = append(rows, lipgloss.JoinHorizontal(lipgloss.Top, renderedParts...))8996 }9097 }9198