diff options
author | Joe <rbo@gmx.us> | 2024-04-25 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-25 20:20:20 +0200 |
commit | 72578a19bf46b6e0519c3bbd5940e229a1cf5605 (patch) | |
tree | 196e6de0a85ba19dab78d35b9b7491990a29855a /src/e_keys.go | |
parent | red (diff) | |
download | hardflip-72578a19bf46b6e0519c3bbd5940e229a1cf5605.tar.gz hardflip-72578a19bf46b6e0519c3bbd5940e229a1cf5605.tar.bz2 hardflip-72578a19bf46b6e0519c3bbd5940e229a1cf5605.tar.xz hardflip-72578a19bf46b6e0519c3bbd5940e229a1cf5605.tar.zst hardflip-72578a19bf46b6e0519c3bbd5940e229a1cf5605.zip |
ok
Diffstat (limited to '')
-rw-r--r-- | src/e_keys.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/e_keys.go b/src/e_keys.go index 20552d7..d160f47 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -238,6 +238,14 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { } data.yank = nil ui.msg_buff = "pasted " + new_host.Name + } else if (event.Rune() == 'c' || + event.Rune() == 'C' || + event.Rune() == 'r' || + event.Rune() == 'R') && + data.litems.curr != nil && + data.litems.curr.is_dir() == false { + ui.mode = RENAME_MODE + ui.buff = data.litems.curr.Host.Name } return false } @@ -766,3 +774,19 @@ func e_insert_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { } return false } + +func e_rename_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { + if event.Key() == tcell.KeyEscape || + event.Key() == tcell.KeyCtrlC { + data.insert = nil + } else if event.Key() == tcell.KeyEnter { + e_rename(data, ui) + } else { + e_readline(event, &ui.buff) + return true + } + ui.s.HideCursor() + ui.mode = NORMAL_MODE + ui.buff = "" + return false +} |