File tree Expand file tree Collapse file tree 1 file changed +27
-12
lines changed
Expand file tree Collapse file tree 1 file changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,17 @@ func projectRun(opts *ProjectOptions) error {
9898
9999 s .SetStyle (style )
100100
101- // some kind of controller struct to track modal state?
101+ // TODO some kind of controller struct to track modal state?
102+ colWidth := 30
103+ colHeight := 40
104+ colsToShow := 7
105+
106+ cardWidth := colWidth - 2
107+ cardHeight := 5
108+ cardsToShow := 7
109+
110+ selectedColumn := 0
111+ selectedCard := 0
102112
103113 quit := make (chan struct {})
104114 go func () {
@@ -110,6 +120,22 @@ func projectRun(opts *ProjectOptions) error {
110120 case 'q' :
111121 close (quit )
112122 return
123+ case 'w' :
124+ if selectedCard > 0 {
125+ selectedCard --
126+ }
127+ case 's' :
128+ if selectedCard < cardsToShow {
129+ selectedCard ++
130+ }
131+ case 'a' :
132+ if selectedColumn > 0 {
133+ selectedColumn --
134+ }
135+ case 'd' :
136+ if selectedColumn < colsToShow {
137+ selectedColumn ++
138+ }
113139 }
114140 switch ev .Key () {
115141 case tcell .KeyEscape :
@@ -124,17 +150,6 @@ func projectRun(opts *ProjectOptions) error {
124150 }
125151 }()
126152
127- colWidth := 30
128- colHeight := 40
129- colsToShow := 7
130-
131- cardWidth := colWidth - 2
132- cardHeight := 5
133- cardsToShow := 7
134-
135- selectedColumn := 0
136- selectedCard := 0
137-
138153loop:
139154 for {
140155 select {
You can’t perform that action at this time.
0 commit comments