diff options
| author | 2020-06-01 15:17:40 +0530 | |
|---|---|---|
| committer | 2020-06-01 15:17:40 +0530 | |
| commit | 9fddd416cae5d4b9c050543edc03c9ae40ff63e2 (patch) | |
| tree | 273fe59ab9751989a1630d57fc836854acb2115f /plugins | |
| parent | 16356e9d06b7707e6dcf0fdad501d5f80edc7aad (diff) | |
| download | nnn-9fddd416cae5d4b9c050543edc03c9ae40ff63e2.tar.gz | |
Simplify preview-tui
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/preview-tui | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/preview-tui b/plugins/preview-tui index c14736e..c3eae3b 100755 --- a/plugins/preview-tui +++ b/plugins/preview-tui @@ -85,17 +85,15 @@ fi if [ -e "${TMUX%%,*}" ] && [ "$(tmux -V | cut -c6)" -eq 3 ] ; then if [ -z "$SPLIT" ]; then if [ "$(( lines * 2 ))" -gt "$cols" ]; then - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -dv "$0" "$1" + SPLIT='v' else - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -dh "$0" "$1" + SPLIT='h' fi - elif [ "$SPLIT" = "h" ]; then - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -dh "$0" "$1" - elif [ "$SPLIT" = "v" ]; then - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -dv "$0" "$1" - else - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -dh "$0" "$1" + elif [ "$SPLIT" != "h" ] && [ "$SPLIT" != "v" ] ; then + SPLIT='h' fi + + tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -d"$SPLIT" "$0" "$1" else PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" & fi |