From 797f7623d987b1fe7a3b1d884de34b6105d3624a Mon Sep 17 00:00:00 2001 From: dustin-ward Date: Mon, 12 Feb 2024 18:14:04 -0500 Subject: [PATCH] make first char active on start/reset --- go.mod | 5 ++--- go.sum | 2 -- internal/app/app.go | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 41eb130..eb613e1 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,14 @@ module github.com/dustin-ward/termtyping -go 1.21.3 +go 1.18 require ( - github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/bubbletea v0.25.0 + github.com/charmbracelet/lipgloss v0.9.1 ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/lipgloss v0.9.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.18 // indirect diff --git a/go.sum b/go.sum index e5ae604..fc1275c 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= -github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM= github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg= diff --git a/internal/app/app.go b/internal/app/app.go index 42822bc..189c648 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -63,6 +63,9 @@ func NewAppModel(init_state AppState) tea.Model { chars = chars[:len(chars)-1] text = text[:len(text)-1] + // First character is active + chars[0].State = character.ActiveState + return AppModel{ CurState: init_state, chars: chars,