implement basic tab navigation
This commit is contained in:
10
bubbletea.go
10
bubbletea.go
@@ -35,6 +35,16 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
m.cursor++
|
m.cursor++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "left", "h":
|
||||||
|
if m.tab > 0 {
|
||||||
|
m.tab--
|
||||||
|
}
|
||||||
|
|
||||||
|
case "right", "l":
|
||||||
|
if m.tab < 4 {
|
||||||
|
m.tab++
|
||||||
|
}
|
||||||
|
|
||||||
// The "enter" key and the spacebar (a literal space) toggle
|
// The "enter" key and the spacebar (a literal space) toggle
|
||||||
// the selected state for the item that the cursor is pointing at.
|
// the selected state for the item that the cursor is pointing at.
|
||||||
case "enter", " ":
|
case "enter", " ":
|
||||||
|
|||||||
1
model.go
1
model.go
@@ -6,6 +6,7 @@ type todo struct {
|
|||||||
deadline int
|
deadline int
|
||||||
startdate int
|
startdate int
|
||||||
priority int // 1-4, 1 being highest priority, 4 being no priority
|
priority int // 1-4, 1 being highest priority, 4 being no priority
|
||||||
|
isInbox bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type model struct {
|
type model struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user