aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-21 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-21 20:20:20 +0100
commite71ae89a1b3a1c8e0f2372575b5997d8e38f9242 (patch)
tree96975a8dc5d5ee79fd9cb25ec216ae345fec6ee1 /src/i_events.go
parenttmp (diff)
downloadhardflip-e71ae89a1b3a1c8e0f2372575b5997d8e38f9242.tar.gz
hardflip-e71ae89a1b3a1c8e0f2372575b5997d8e38f9242.tar.bz2
hardflip-e71ae89a1b3a1c8e0f2372575b5997d8e38f9242.tar.xz
hardflip-e71ae89a1b3a1c8e0f2372575b5997d8e38f9242.tar.zst
hardflip-e71ae89a1b3a1c8e0f2372575b5997d8e38f9242.zip
quad
Diffstat (limited to 'src/i_events.go')
-rw-r--r--src/i_events.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/i_events.go b/src/i_events.go
index 3767fa9..7bbda68 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -494,14 +494,33 @@ func i_events(data *HardData) {
case INSERT_MODE:
if event.Key() == tcell.KeyEscape ||
event.Key() == tcell.KeyCtrlC {
+ ui.s.HideCursor()
data.ui.mode = NORMAL_MODE
+ data.insert = nil
+ ui.buff = ""
+ } else if event.Key() == tcell.KeyEnter {
+ if ui.buff == "" {
+ ui.s.HideCursor()
+ data.ui.mode = NORMAL_MODE
+ data.insert = nil
+ ui.buff = ""
+ break
+ }
+ ui.s.HideCursor()
+ data.insert = &HostNode{}
+ data.insert.Name = ui.buff
+ ui.buff = ""
+ } else {
+ i_readline(event, data)
}
+ // TODO: reset data.insert to nil on validate
case MKDIR_MODE:
if event.Key() == tcell.KeyEscape ||
event.Key() == tcell.KeyCtrlC {
ui.s.HideCursor()
ui.buff = ""
ui.mode = NORMAL_MODE
+ data.insert = nil
} else if event.Key() == tcell.KeyEnter {
i_mkdir(data, ui)
ui.s.HideCursor()