aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Mario <marioortizmanero@gmail.com>2020-06-09 16:57:28 +0200
committerGravatar GitHub <noreply@github.com>2020-06-09 20:27:28 +0530
commiteeb802280dac4534a0b1a373ddeb2cd35f74cb39 (patch)
treecd6d0ded46995a16818b2ba262381ec8203fd582 /plugins
parentc203ae7fa81ee7f3394bf0aeb7a70b9bd41c8e52 (diff)
downloadnnn-eeb802280dac4534a0b1a373ddeb2cd35f74cb39.tar.gz
preview-tui splits are inverted (#642)
* Easier to browse plugin README.md * Splits are inverted * $SPLIT clarification and default values for $SPLIT and $TERMINAL
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/preview-tui11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/preview-tui b/plugins/preview-tui
index 222f13f..4fab07e 100755
--- a/plugins/preview-tui
+++ b/plugins/preview-tui
@@ -43,7 +43,8 @@
# different terminal window will be used ($TERMINAL).
#
# Tmux and kitty users can configure $SPLIT to either "h" or "v" to set a
-# 'h'orizontal split or a 'v'ertical split.
+# 'h'orizontal split or a 'v'ertical split (as in, the line that splits the
+# windows will be horizontal or vertical).
#
# Kitty users need `allow_remote_control` set to `yes`. To customize the
# window split, `enabled_layouts` has to be set to `all` or `splits` (the
@@ -53,6 +54,8 @@
# Shell: POSIX compliant
# Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero
+SPLIT="$SPLIT" # you can set a permanent split here
+TERMINAL="$TERMINAL" # same goes for the terminal
USE_SCOPE="${USE_SCOPE:-0}"
PAGER="${PAGER:-less -R}"
@@ -64,10 +67,10 @@ else
TERMINAL="${TERMINAL:-xterm}"
fi
-if [ -z "$SPLIT" ] && [ $(($(tput lines) * 2)) -gt "$(tput cols)" ] ; then
- SPLIT='v'
-elif [ "$SPLIT" != 'v' ] ; then
+if [ -z "$SPLIT" ] && [ $(($(tput lines) * 2)) -gt "$(tput cols)" ]; then
SPLIT='h'
+elif [ "$SPLIT" != 'h' ]; then
+ SPLIT='v'
fi
exists() {