diff options
author | 2019-11-08 19:15:53 +0530 | |
---|---|---|
committer | 2019-11-08 19:15:53 +0530 | |
commit | 53a2e4c56058db01dbe7bcbaeb37a9352fc73959 (patch) | |
tree | aa1b791a4856366fa2034f876a88e2c0e48034bd /src | |
parent | 5077b020bcf0e4418d520db8a21ae686ca5db1a8 (diff) | |
download | nnn-53a2e4c56058db01dbe7bcbaeb37a9352fc73959.tar.gz |
Incorporate PR #368
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -3424,7 +3424,7 @@ static bool run_selected_plugin(char **path, const char *file, char *newpath, ch if (len > 1) { int ctx = g_buf[0] - '0'; - if (ctx == 0) { + if (ctx == 0 || ctx == cfg.curctx + 1) { xstrlcpy(*lastdir, *path, PATH_MAX); xstrlcpy(*path, g_buf + 1, PATH_MAX); } else if (ctx >= 1 && ctx <= CTX_MAX) { @@ -4966,18 +4966,20 @@ nochange: if (tmp[0] == '_' && tmp[1]) { xstrlcpy(newpath, ++tmp, PATH_MAX); flag = F_CLI | F_CONFIRM; - tmp = NULL; + spawn(newpath, (ndents ? dents[cur].name : NULL), + NULL, path, flag); } else { - mkpath(plugindir, tmp, newpath); - tmp = path; - } + xstrlcpy(rundir, path, PATH_MAX); + xstrlcpy(path, plugindir, PATH_MAX); + if (!run_selected_plugin(&path, tmp, newpath, rundir, + (ndents ? dents[cur].name : NULL), + &lastname, &lastdir)) + goto nochange; - spawn(newpath, (ndents ? dents[cur].name : NULL), - tmp, path, flag); + } - if (cfg.filtermode) - presel = FILTER; - goto nochange; + setdirwatch(); + goto begin; } cfg.runplugin ^= 1; |