cleanup
This commit is contained in:
1 parent
728c5fbb2c
commit
599ac11f26
4 files changed
+10
-10
No files matched your search
@@ -140,7 +140,7 @@ func loadFiles() (list []string, cp bool, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func sendRemote(cmd string) error {
|
||||
func remote(cmd string) error {
|
||||
c, err := net.Dial(gSocketProt, gSocketPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("dialing to send server: %s", err)
|
||||
|
||||
@@ -443,7 +443,7 @@ func insert(app *app, arg string) {
|
||||
return
|
||||
}
|
||||
app.nav.unselect()
|
||||
if err := sendRemote("send load"); err != nil {
|
||||
if err := remote("send load"); err != nil {
|
||||
app.ui.printf("delete: %s", err)
|
||||
}
|
||||
}
|
||||
@@ -597,7 +597,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
return
|
||||
}
|
||||
app.nav.unselect()
|
||||
if err := sendRemote("send sync"); err != nil {
|
||||
if err := remote("send sync"); err != nil {
|
||||
app.ui.printf("copy: %s", err)
|
||||
}
|
||||
case "cut":
|
||||
@@ -606,7 +606,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
return
|
||||
}
|
||||
app.nav.unselect()
|
||||
if err := sendRemote("send sync"); err != nil {
|
||||
if err := remote("send sync"); err != nil {
|
||||
app.ui.printf("cut: %s", err)
|
||||
}
|
||||
case "paste":
|
||||
@@ -620,7 +620,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
if cmd, ok := gOpts.cmds["delete"]; ok {
|
||||
cmd.eval(app, e.args)
|
||||
app.nav.unselect()
|
||||
if err := sendRemote("send load"); err != nil {
|
||||
if err := remote("send load"); err != nil {
|
||||
app.ui.printf("delete: %s", err)
|
||||
}
|
||||
} else {
|
||||
@@ -635,7 +635,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
app.ui.printf("clear: %s", err)
|
||||
return
|
||||
}
|
||||
if err := sendRemote("send sync"); err != nil {
|
||||
if err := remote("send sync"); err != nil {
|
||||
app.ui.printf("clear: %s", err)
|
||||
}
|
||||
case "draw":
|
||||
|
||||
@@ -132,7 +132,7 @@ func main() {
|
||||
case *showVersion:
|
||||
fmt.Println(gVersion)
|
||||
case *remoteCmd != "":
|
||||
if err := sendRemote(*remoteCmd); err != nil {
|
||||
if err := remote(*remoteCmd); err != nil {
|
||||
log.Fatalf("remote command: %s", err)
|
||||
}
|
||||
case *serverMode:
|
||||
|
||||
@@ -612,7 +612,7 @@ loop:
|
||||
}
|
||||
}
|
||||
|
||||
if err := sendRemote("send load"); err != nil {
|
||||
if err := remote("send load"); err != nil {
|
||||
errCount++
|
||||
echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err)
|
||||
ui.exprChan <- echo
|
||||
@@ -663,7 +663,7 @@ func moveAsync(ui *ui, srcs []string, dstDir string) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := sendRemote("send load"); err != nil {
|
||||
if err := remote("send load"); err != nil {
|
||||
errCount++
|
||||
echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err)
|
||||
ui.exprChan <- echo
|
||||
@@ -692,7 +692,7 @@ func (nav *nav) paste(ui *ui) error {
|
||||
return fmt.Errorf("clearing copy/cut buffer: %s", err)
|
||||
}
|
||||
|
||||
if err := sendRemote("send sync"); err != nil {
|
||||
if err := remote("send sync"); err != nil {
|
||||
return fmt.Errorf("paste: %s", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user