Add option to globally enable or disable preview window

This commit is contained in:
Junegunn Choi
2020-03-15 16:13:51 +09:00
parent ed9d66c2a6
commit 15ed47f561
5 changed files with 65 additions and 17 deletions

View File

@@ -17,14 +17,19 @@ if [[ $1 =~ ^[A-Z]:\\ ]]; then
CENTER=${INPUT[2]}
fi
if [[ ! "$CENTER" =~ ^[0-9]*$ ]]; then
exit 1
fi
FILE="${FILE/#\~\//$HOME/}"
if [ ! -r "$FILE" ]; then
echo "File not found ${FILE}"
exit 1
fi
if [[ "$(file --dereference --mime "$FILE")" =~ binary ]]; then
echo "$1 is a binary file"
MIME=$(file --dereference --mime "$FILE")
if [[ "$MIME" =~ binary ]]; then
echo "$MIME"
exit 0
fi