From ed4e510c23af4b9ebfba31a99111f9590887b34b Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 24 May 2024 17:17:04 +0200 Subject: go --- src/c_defs.go | 1 + src/e_keys.go | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/c_defs.go b/src/c_defs.go index 94cf59f..f4cbcbf 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -79,6 +79,7 @@ const ( ERROR_MODE WELCOME_MODE MKDIR_MODE + INSERT_NAME_MODE INSERT_MODE RENAME_MODE HELP_MODE diff --git a/src/e_keys.go b/src/e_keys.go index 8c74be3..5edf929 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -177,13 +177,14 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { ui.insert_sel_ok = false ui.insert_scroll = 0 tmp := ItemsNode{} - tmp_host := HostNode{} - tmp.Host = &tmp_host + data.insert = &HostNode{} + tmp.Host = data.insert if data.litems.curr.is_dir() == true { - tmp_host.parent = data.litems.curr.Dirs + data.insert.parent = data.litems.curr.Dirs } else { - tmp_host.parent = data.litems.curr.Host.parent + data.insert.parent = data.litems.curr.Host.parent } + e_set_protocol_defaults(data, data.insert) data.litems.add_after(&tmp) } else if event.Rune() == 'e' && data.litems.curr != nil && @@ -353,6 +354,10 @@ func e_mkdir_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { return false } +func e_insert_name_events(data *HardData, ui *HardUI, + event tcell.EventKey) bool { +} + func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { if data.insert == nil { if event.Key() == tcell.KeyEscape || -- cgit v1.2.3