From: NRK Date: Fri, 17 Feb 2023 13:24:45 +0000 (+0600) Subject: export NNN_PREFER_SELECTION to all plugins X-Git-Tag: v4.8~15^2~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9cc4b6686820661666fd1cbdc73da7b1133b2743;p=nnn.git export NNN_PREFER_SELECTION to all plugins --- diff --git a/plugins/README.md b/plugins/README.md index 460f2af9..4ba2d6e8 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -212,6 +212,7 @@ When `nnn` executes a plugin, it does the following: 3. `$3`: The picker mode output file (`-` for stdout) if `nnn` is executed as a file picker. - Sets the environment variable `NNN_PIPE` used to control `nnn` active directory. - Sets the environment variable `NNN_INCLUDE_HIDDEN` to `1` if hidden files are active, `0` otherwise. +- Sets the environment variable `NNN_PREFER_SELECTION` to `1` if user prefers to use selection (see nnn's `-u` flag), `0` otherwise. - Exports the [special variables](https://github.com/jarun/nnn/wiki/Concepts#special-variables). Plugins can also read the `.selection` file in the config directory. diff --git a/src/nnn.c b/src/nnn.c index f35fb3f9..635b8911 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5174,6 +5174,7 @@ static void setexports(void) } } setenv("NNN_INCLUDE_HIDDEN", xitoa(cfg.showhidden), 1); + setenv("NNN_PREFER_SELECTION", xitoa(cfg.prefersel), 1); } static void run_cmd_as_plugin(const char *file, uchar_t flags)