aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-04-15 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-04-15 20:20:20 +0200
commit29add6479b55bebb74b795a1ce1d033575a1dcc2 (patch)
tree4a3f047b1304163c5819bd6b74df23db96643411 /src/i_events.go
parentup (diff)
downloadhardflip-29add6479b55bebb74b795a1ce1d033575a1dcc2.tar.gz
hardflip-29add6479b55bebb74b795a1ce1d033575a1dcc2.tar.bz2
hardflip-29add6479b55bebb74b795a1ce1d033575a1dcc2.tar.xz
hardflip-29add6479b55bebb74b795a1ce1d033575a1dcc2.tar.zst
hardflip-29add6479b55bebb74b795a1ce1d033575a1dcc2.zip
fuck this
Diffstat (limited to '')
-rw-r--r--src/i_events.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/i_events.go b/src/i_events.go
index 32fa38d..b346b11 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -52,7 +52,6 @@
package main
import (
- "fmt"
"os"
"strconv"
"strings"
@@ -324,6 +323,7 @@ func i_set_drive_keys(data *HardData) {
for key := range data.insert.Drive {
data.insert.drive_keys = append(data.insert.drive_keys, key)
}
+ data.ui.insert_sel_max = INS_RDP_OK + len(data.insert.Drive)
}
func i_set_protocol_defaults(data *HardData, in *HostNode) {
@@ -341,9 +341,9 @@ func i_set_protocol_defaults(data *HardData, in *HostNode) {
"qwe": "a",
"asd": "aaaa",
"zxc": "aaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "azxc": "aaaaa",
}
i_set_drive_keys(data)
- data.ui.insert_sel_max = INS_RDP_OK + len(data.insert.Drive)
case PROTOCOL_CMD:
in.Shell = []string{"/bin/sh", "-c"}
data.ui.insert_sel_max = 2
@@ -748,15 +748,11 @@ func i_events(data *HardData) {
data.insert.Drive = make(map[string]string)
}
data.insert.Drive[ui.drives_buff] = ui.buff
- ui.s.Fini()
- fmt.Println(data.insert.Drive)
- os.Exit(0)
i_set_drive_keys(data)
- data.ui.insert_sel_max = INS_RDP_OK +
- len(data.insert.Drive)
ui.drives_buff = ""
ui.buff = ""
ui.s.HideCursor()
+ // FIX: can't add shit anymore
} else {
i_readline(event, &data.ui.buff)
}
@@ -824,17 +820,18 @@ func i_events(data *HardData) {
}
}
if len(data.insert.Drive) > 0 &&
- data.ui.insert_sel >= INS_RDP_DRIVE &&
- data.ui.insert_sel < INS_RDP_DRIVE +
- len(data.insert.Drive) {
+ (data.ui.insert_sel >= INS_RDP_DRIVE &&
+ data.ui.insert_sel < INS_RDP_DRIVE +
+ len(data.insert.Drive)) {
if event.Rune() == 'y' ||
event.Rune() == 'Y' ||
event.Key() == tcell.KeyEnter {
delete(data.insert.Drive,
data.insert.drive_keys[data.ui.insert_sel -
INS_RDP_DRIVE])
- data.ui.insert_sel_max = INS_RDP_OK +
- len(data.insert.Drive)
+ if len(data.insert.Drive) == 0 {
+ data.insert.Drive = nil
+ }
i_set_drive_keys(data)
}
data.ui.insert_sel_ok = false