summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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;;