summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-05-19 17:02:28 +0200
committertoonn <toonn@toonn.io>2019-05-19 17:02:28 +0200
commitc5da4108e3ead93d0a425d6bcd5f645389229dc7 (patch)
treebc3758533d0d7144bab3c27052c179efabfe4a87 /ranger
parentf67fd1bba726852b65c0fe422e7ef4cd9552b58f (diff)
downloadranger-c5da4108e3ead93d0a425d6bcd5f645389229dc7.tar.gz
Give HIGHLIGHT_TABWIDTH some love
Same treatment as for `HIGHLIGHT_STYLE`. The default value can be
overridden by either setting the environment variable or specifying
`--replace-tabs=` in `HIGHLIGHT_OPTIONS`.
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/data/scope.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index ba9edc50..e9c10916 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -35,9 +35,9 @@ FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lowe
 
 # Settings
 HIGHLIGHT_SIZE_MAX=262143  # 256KiB
-HIGHLIGHT_TABWIDTH=8
+HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8}
 HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo}
-HIGHLIGHT_OPTIONS="--style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
+HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
 PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn}
 
 
@@ -229,7 +229,7 @@ handle_mime() {
                 local pygmentize_format='terminal'
                 local highlight_format='ansi'
             fi
-            env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" \
+            env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
                 --out-format="${highlight_format}" \
                 --force -- "${FILE_PATH}" && exit 5
             pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\