aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/e_keys.go2
-rw-r--r--src/i_insert.go6
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