nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c49f24c696f1983c121c0c785e108c753dde8970
parent e09148e3860a93cb59b50b726580569994f47743
Author: PiƱa Colada <engineerarun@gmail.com>
Date:   Sun, 18 Apr 2021 16:35:02 +0530

Merge pull request #951 from luukvbaal/preview-tui-ext

preview-tui-ext: pass env
Diffstat:
Mplugins/preview-tui-ext | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/plugins/preview-tui-ext b/plugins/preview-tui-ext @@ -168,7 +168,7 @@ preview_file() { if [ -d "$1" ]; then cd "$1" || return if exists tree; then - if [ "$ICONLOOKUP" -ne 0 ]; then + if [ "$ICONLOOKUP" -ne 0 ] && [ -f "$(dirname "$0")"/.iconlookup ]; then [ "$SPLIT" = h ] && BSTR="\n" tree -L 1 --dirsfirst -F --noreport -i | head -n "$((lines - 3))" | "$(dirname "$0")"/.iconlookup -l "$cols" -B "$BSTR" -b " " else @@ -183,7 +183,7 @@ preview_file() { if [ "${mimetype%%/*}" = "image" ]; then if [ "${mimetype#*/}" = "gif" ] && exists convert; then generate_preview "$cols" "$lines" "$1" "gif" - elif [ ! "${mimetype#*/}" = "jpeg" ]; then + elif [ "${mimetype#*/}" != "jpeg" ]; then generate_preview "$cols" "$lines" "$1" "image" else image_preview "$cols" "$lines" "$1" @@ -366,7 +366,9 @@ if [ "$TERMINAL" = "tmux" ]; then # tmux splits are inverted if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "SPLIT=$SPLIT" -d"$SPLIT" "$0" "$1" + tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "PAGER=$PAGER" \ + -e "USE_SCOPE=$USE_SCOPE" -e "SPLIT=$SPLIT" -e "USE_PISTOL=$USE_PISTOL" \ + -e "ICONLOOKUP=$ICONLOOKUP" -d"$SPLIT" "$0" "$1" elif [ "$TERMINAL" = "kitty" ]; then # Setting the layout for the new window. It will be restored after the # script ends. @@ -379,7 +381,7 @@ elif [ "$TERMINAL" = "kitty" ]; then --cwd "$PWD" --env "PATH=$PATH" --env "NNN_FIFO=$NNN_FIFO" \ --env "PREVIEW_MODE=1" --env "PAGER=$PAGER" \ --env "USE_SCOPE=$USE_SCOPE" --env "SPLIT=$SPLIT" \ - --env "USE_PISTOL=$USE_PISTOL" \ + --env "USE_PISTOL=$USE_PISTOL" --env "ICONLOOKUP=$ICONLOOKUP" \ --location "${SPLIT}split" "$0" "$1" >/dev/null else PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" &