diff options
author | Joe <rbo@gmx.us> | 2024-04-29 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-29 20:20:20 +0200 |
commit | 0a3aca457c3c750340dcc0aa072133c3884bb773 (patch) | |
tree | aff37bad9b2b5ebb7cb71eaf3842f4a60f0ffe4a | |
parent | up (diff) | |
download | hardflip-0a3aca457c3c750340dcc0aa072133c3884bb773.tar.gz hardflip-0a3aca457c3c750340dcc0aa072133c3884bb773.tar.bz2 hardflip-0a3aca457c3c750340dcc0aa072133c3884bb773.tar.xz hardflip-0a3aca457c3c750340dcc0aa072133c3884bb773.tar.zst hardflip-0a3aca457c3c750340dcc0aa072133c3884bb773.zip |
quick weird bugfix
-rw-r--r-- | src/e_keys.go | 2 | ||||
-rw-r--r-- | src/i_insert.go | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/e_keys.go b/src/e_keys.go index 621b9ea..8f4c91b 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -561,12 +561,14 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { ui.s.HideCursor() return true } else { + filename := data.insert.filename name := data.insert.Name parent := data.insert.parent data.insert = nil data.insert = &HostNode{} data.insert.Name = name data.insert.parent = parent + data.insert.filename = filename data.insert.Protocol = int8(event.Rune() - 48 - 1) ui.insert_sel_ok = false ui.s.HideCursor() diff --git a/src/i_insert.go b/src/i_insert.go index 8ea6754..5b769f4 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_insert.go - * Wed Apr 24 17:40:10 2024 + * Mon Apr 29 15:36:06 2024 * Joe * * insert a new host @@ -146,14 +146,14 @@ func i_insert_host(data *HardData, insert *HostNode) error { data.data_dir + insert.parent.path()) insert.filename = filename } - fmt, err := yaml.Marshal(insert) + format, err := yaml.Marshal(insert) if err != nil { c_error_mode("yaml", err, &data.ui) data.insert = nil return err } err = os.WriteFile(data.data_dir + insert.parent.path() + filename, - fmt, 0644) + format, 0644) if err != nil { c_error_mode("can't write file", err, &data.ui) data.insert = nil |