diff options
| -rw-r--r-- | src/keys.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -97,6 +97,25 @@ handling_keys(int ch, fm_info *i) fm_rename(i); break; } + case 'd': { + char path[PATH_MAX] = {0}; + size_t len = snprintf(path, sizeof(path), "%s/%s", i->cwd, + i->cur->items[i->cursor].name); + + if (len >= PATH_MAX) { + die("Itmes length error"); + } + + if (fm_rm(path) == 0) { + need_redraw = true; + fm_getdir(i->cur, i->cwd); + } else { + log_write(LOG_ERR, "%s", strerror(errno)); + } + + break; + } + default: return; } |
