Skip to content

Commit c4605ee

Browse files
committed
chro format
1 parent 465a57c commit c4605ee

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

pkg/app/controller.go

+15-18
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,30 @@ import (
88
"strings"
99

1010
"github.com/go-vgo/robotgo"
11+
"github.com/jinzhu/copier"
1112
"github.com/jroimartin/gocui"
1213
"github.com/windwp/go-at/pkg/command"
1314
"github.com/windwp/go-at/pkg/gui"
1415
"github.com/windwp/go-at/pkg/model"
15-
"github.com/jinzhu/copier"
1616
)
1717

1818
var systemProcess []model.ProcessConfig
1919

2020
func processMoveUp(g *gocui.Gui, v *gocui.View) error {
21-
// saveVisualData(g, v)
2221
gui.CursorUp(g, v)
2322
getSelectedProcess(g, v)
2423
refereshGui(g)
2524
return nil
2625
}
2726

2827
func processMoveDown(g *gocui.Gui, v *gocui.View) error {
29-
// saveVisualData(g, v)
3028
gui.CursorDown(g, v)
3129
getSelectedProcess(g, v)
3230
refereshGui(g)
3331
return nil
3432
}
3533

3634
func nextView(g *gocui.Gui, v *gocui.View) error {
37-
// saveVisualData(g, v)
3835
return gui.NextView(g, v)
3936
}
4037

@@ -147,22 +144,22 @@ func getSelectedProcess(g *gocui.Gui, v *gocui.View) error {
147144
return nil
148145
}
149146

150-
func onEndTask(g *gocui.Gui, v *gocui.View) error{
151-
<-command.WaitTask()
152-
stopRunAction(g,v)
153-
return nil
147+
func onEndTask(g *gocui.Gui, v *gocui.View) error {
148+
<-command.WaitTask()
149+
stopRunAction(g, v)
150+
return nil
154151
}
155152
func startRunAction(g *gocui.Gui, v *gocui.View) error {
156153
if config.Status == model.S_IDLE {
157-
// clone:=&
158-
clone:=&model.AppConfig{}
159-
copier.Copy(clone, config)
154+
// clone:=&
155+
clone := &model.AppConfig{}
156+
copier.Copy(clone, config)
160157
err := command.StartTask(clone, false)
161158
if err != nil {
162159
SetMessage(err.Error(), g)
163160
return err
164161
}
165-
go onEndTask(g,v)
162+
go onEndTask(g, v)
166163
config.Status = model.S_RUNNING
167164
refereshGui(g)
168165
}
@@ -171,9 +168,9 @@ func startRunAction(g *gocui.Gui, v *gocui.View) error {
171168

172169
func stopRunAction(g *gocui.Gui, v *gocui.View) error {
173170
if config.Status == model.S_RUNNING {
174-
command.EndTask()
175-
config.Status = model.S_IDLE
176-
SetMessage("stop", g)
171+
command.EndTask()
172+
config.Status = model.S_IDLE
173+
SetMessage("stop", g)
177174
}
178175
return nil
179176
}
@@ -191,7 +188,7 @@ func clipboardData(g *gocui.Gui, v *gocui.View) error {
191188
if err == nil {
192189
config.SelectedProcess.Text = clipboard
193190
refereshGui(g)
194-
// saveTextEditorData(g,v)
191+
// saveTextEditorData(g,v)
195192
} else {
196193

197194
log.Panic("Clip board error")
@@ -245,8 +242,8 @@ func focusWindow(g *gocui.Gui, v *gocui.View) error {
245242
return nil
246243
}
247244
func saveDataAction(g *gocui.Gui, v *gocui.View) error {
248-
clone:=&model.AppConfig{}
249-
copier.Copy(clone,config)
245+
clone := &model.AppConfig{}
246+
copier.Copy(clone, config)
250247
command.SaveJSON(config)
251248
SetMessage("Data Saved", g)
252249
gui.DrawStatusGui(g, config, false)

0 commit comments

Comments
 (0)