about summary refs log tree commit diff
path: root/mless
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2019-09-07 16:20:57 +0200
committerLeah Neukirchen <leah@vuxu.org>2019-09-08 15:00:51 +0200
commitdbf118f6c9e873ff5ae333cf041a3b10b0eca531 (patch)
tree330d694a6824b1af7829c8ae15fb8753b3d98b89 /mless
parent1ed8a0ac76bb044b29eede2ed7e72702ed576791 (diff)
downloadmblaze-dbf118f6c9e873ff5ae333cf041a3b10b0eca531.tar.gz
mblaze-dbf118f6c9e873ff5ae333cf041a3b10b0eca531.tar.xz
mblaze-dbf118f6c9e873ff5ae333cf041a3b10b0eca531.zip
mless: only export LESSKEY once
Closes: #168 [via git-merge-pr]
Diffstat (limited to 'mless')
-rwxr-xr-xmless14
1 files changed, 7 insertions, 7 deletions
diff --git a/mless b/mless
index 390ebcf..b859a15 100755
--- a/mless
+++ b/mless
@@ -63,14 +63,14 @@ nl="
 "
 export MLESS_RAW=0
 export MLESS_HTML=0
+if [ -f "$MBLAZE/mless" ]; then
+	export LESSKEY="$MBLAZE/mless"
+elif [ -f "$HOME/.mblaze/mless" ]; then
+	export LESSKEY="$HOME/.mblaze/mless"
+elif [ -f "$HOME/.mless" ]; then
+	export LESSKEY="$HOME/.mless"
+fi
 while :; do
-	if [ -f "$MBLAZE/mless" ]; then
-		export LESSKEY="$MBLAZE/mless"
-	elif [ -f "$HOME/.mblaze/mless" ]; then
-		export LESSKEY="$HOME/.mblaze/mless"
-	elif [ -f "$HOME/.mless" ]; then
-		export LESSKEY="$HOME/.mless"
-	fi
 	LESSOPEN="|$0 --filter %s" \
 		less -Ps"mless %f?m (message %i of %m).." -R \
 			"+:e $(mscan -n .)$nl" //scan $(mscan -n :)