Skip to content

Commit d487b78

Browse files
committed
Fixing choice bug where cursor goes off screen
1 parent 9d43c81 commit d487b78

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ archives:
3434
brews:
3535
- name: pomo-cli
3636
description: Pomodoro Timer CLI tool
37-
homepage: https://github.com/codeanish/homebrew-pomo-cli
37+
homepage: https://github.com/codeanish/pomo-cli
3838
tap:
3939
owner: codeanish
4040
name: homebrew-pomo-cli

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
# pomo-cli
2-
Pomodoro Timer CLI tool
2+
3+
A Pomodoro Timer CLI tool. This tool can help you stay focussed for periods of time and improve flow during tasks. It's based on the [Pomodoro Technique](https://en.wikipedia.org/wiki/Pomodoro_Technique), and while there are many alternative apps out there in the browser or as fully fledged desktop apps, for those of us who spend much of thier days in the terminal, I feel as though this is an extra distraction and interrupts flow by forcing you out of context. This tool has been developed as a CLI tool to address these issues.
4+
5+
## Installation Instructions
6+
7+
### MacOS through brew
8+
9+
```
10+
brew tap codeanish/pomo-cli
11+
brew install pomo-cli
12+
```
13+
14+
## Usage instructions
15+
16+
Launch the pomo app in your terminal of choice using `pomo`. Select one of the timer options using the up and down arrows, alternatively VIM bindings j and k also work for navigating the options. Once you've selected an option, hit `Enter` which will start the timer. Once the timer finishes, the program will exit.
17+
18+
Custom times can be run by just entering a time in minutes using the number keys on your keyboard and selecting the custom option.

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ func updateChoices(msg tea.Msg, m model) (tea.Model, tea.Cmd) {
8080
switch msg.String() {
8181
case "j", "down":
8282
m.Choice++
83-
if m.Choice > 3 {
84-
m.Choice = 3
83+
if m.Choice > len(m.Options)-1 {
84+
m.Choice = len(m.Options) - 1
8585
}
8686
case "k", "up":
8787
m.Choice--

0 commit comments

Comments
 (0)