소스 검색

Pass path as second argument

master
Arun Prakash Jana 5 년 전
부모
커밋
087380968d
No known key found for this signature in database GPG 키 ID: A75979F35C080412
2개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. +2
    -1
      plugins/README.md
  2. +4
    -4
      src/nnn.c

+ 2
- 1
plugins/README.md 파일 보기

@@ -70,7 +70,8 @@ With this, plugin `fzy-open` can be run with the keybind <kbd>:o</kbd>, `mocplay


Plugins can access: Plugins can access:
- all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin) - all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin)
- the current file under the cursor (the file name is passed as the argument to a plugin)
- the current file under the cursor (the file name is passed as the first argument to a plugin)
- the traversed path where plugin is invoked (this is the second argument to the plugin; for all practical purposes this is the same as `$PWD` except paths with symlinks)
- the current selection (by reading the file `.selection` in config dir, see the plugin `ndiff`) - the current selection (by reading the file `.selection` in config dir, see the plugin `ndiff`)


Each script has a _Description_ section which provides more details on what the script does, if applicable. Each script has a _Description_ section which provides more details on what the script does, if applicable.


+ 4
- 4
src/nnn.c 파일 보기

@@ -3781,10 +3781,10 @@ nochange:
xstrlcpy(path, rundir, PATH_MAX); xstrlcpy(path, rundir, PATH_MAX);
if (runfile[0]) { if (runfile[0]) {
xstrlcpy(lastname, runfile, NAME_MAX); xstrlcpy(lastname, runfile, NAME_MAX);
spawn(newpath, lastname, NULL, path, F_NORMAL);
spawn(newpath, lastname, path, path, F_NORMAL);
runfile[0] = '\0'; runfile[0] = '\0';
} else } else
spawn(newpath, NULL, NULL, path, F_NORMAL);
spawn(newpath, NULL, path, path, F_NORMAL);
rundir[0] = '\0'; rundir[0] = '\0';
cfg.runplugin = 0; cfg.runplugin = 0;
setdirwatch(); setdirwatch();
@@ -4577,9 +4577,9 @@ nochange:


mkpath(plugindir, tmp, newpath); mkpath(plugindir, tmp, newpath);
if (ndents) if (ndents)
spawn(newpath, dents[cur].name, NULL, path, F_NORMAL);
spawn(newpath, dents[cur].name, path, path, F_NORMAL);
else else
spawn(newpath, NULL, NULL, path, F_NORMAL);
spawn(newpath, NULL, path, path, F_NORMAL);


if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;


불러오는 중...
취소
저장