From dc50f284804b6c92e67fcdb9035a325f024bbca7 Mon Sep 17 00:00:00 2001 From: Ethan P Date: Fri, 2 Oct 2020 19:58:41 -0700 Subject: [PATCH] batgrep: Prevent RIPGREP_CONFIG_PATH context from breaking batgrep. --- src/batgrep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/batgrep.sh b/src/batgrep.sh index 6dede35..52c3c32 100755 --- a/src/batgrep.sh +++ b/src/batgrep.sh @@ -216,7 +216,7 @@ main() { } # shellcheck disable=SC2034 - while IFS=':' read -r file line column; do + while IFS=':' read -r file line column text; do ((FOUND++)) if [[ "$LAST_FILE" != "$file" ]]; then @@ -233,7 +233,7 @@ main() { LAST_LR+=("--line-range=${line_start}:${line_end}") [[ "$OPT_HIGHLIGHT" = "true" ]] && LAST_LH+=("--highlight-line=${line}") - done < <(rg --with-filename --vimgrep "${RG_ARGS[@]}" --sort path "$PATTERN" "${FILES[@]}") + done < <(rg --with-filename --vimgrep "${RG_ARGS[@]}" --context=0 --no-context-separator --sort path "$PATTERN" "${FILES[@]}") do_print # Exit.