aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-14 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-14 20:20:20 +0100
commitd87b9a62640e5c1ce828a7fb62ad05de73592f78 (patch)
tree8634171b7af9940c66595855c754b2f7847bc371 /src
parentcool looking (diff)
downloadhardflip-d87b9a62640e5c1ce828a7fb62ad05de73592f78.tar.gz
hardflip-d87b9a62640e5c1ce828a7fb62ad05de73592f78.tar.bz2
hardflip-d87b9a62640e5c1ce828a7fb62ad05de73592f78.tar.xz
hardflip-d87b9a62640e5c1ce828a7fb62ad05de73592f78.tar.zst
hardflip-d87b9a62640e5c1ce828a7fb62ad05de73592f78.zip
yes
Diffstat (limited to 'src')
-rw-r--r--src/i_events.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/i_events.go b/src/i_events.go
index b543fc6..0a4d9e7 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_events.go
- * Wed Jan 31 18:17:20 2024
+ * Wed Feb 14 11:16:54 2024
* Joe
*
* events in the code
@@ -388,8 +388,22 @@ func i_events(data *HardData) {
ui.mode = NORMAL_MODE
} else if event.Key() == tcell.KeyEnter {
ui.s.HideCursor()
- ui.buff = ""
ui.mode = NORMAL_MODE
+ if data.litems.curr != nil && len(ui.buff) > 0 {
+ path := ""
+ if data.litems.curr.is_dir() == true {
+ path = data.litems.curr.Dirs.path()
+ } else {
+ path = data.litems.curr.Host.Parent.path()
+ }
+ if err := os.MkdirAll(data.data_dir +
+ path +
+ ui.buff, os.ModePerm); err != nil {
+ c_error_mode("mkdir " + path + ui.buff, err, ui)
+ }
+ }
+ i_reload_data(data)
+ ui.buff = ""
} else {
i_readline(event, data)
}