summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-03-10 17:57:09 +0100
committernfnty <git@nfnty.se>2017-03-10 17:57:09 +0100
commit619f2b23bb4330383afd586d21e896534b8fcf8e (patch)
treec837f65ecd46941a445abfd3da9e4e8897387825
parent3b30c5eefb0cd088197291602c0b0a1be63dac6e (diff)
downloadranger-619f2b23bb4330383afd586d21e896534b8fcf8e.tar.gz
data/scope.sh: highlight: Replace tabs with spaces
-rwxr-xr-xranger/data/scope.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 3c050504..8386eac2 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -35,6 +35,7 @@ FILE_EXTENSION_LOWER="${FILE_EXTENSION,,}"
 
 # Settings
 HIGHLIGHT_SIZE_MAX=262143  # 256KiB
+HIGHLIGHT_TABWIDTH=8
 HIGHLIGHT_STYLE='pablo'
 PYGMENTIZE_STYLE='autumn'
 
@@ -122,7 +123,8 @@ handle_mime() {
                 local pygmentize_format='terminal'
                 local highlight_format='ansi'
             fi
-            highlight --out-format="${highlight_format}" --style="${HIGHLIGHT_STYLE}" -- "${FILE_PATH}" && exit 5
+            highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
+                --style="${HIGHLIGHT_STYLE}" -- "${FILE_PATH}" && exit 5
             # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
             exit 2;;