mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 01:30:58 +01:00
Fix incorrect width being passed to 'bat' in batgrep with pager
This commit is contained in:
parent
72b09b4416
commit
ab38bb254c
@ -117,7 +117,8 @@ if [[ -z "$PATTERN" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate separator.
|
# Generate separator.
|
||||||
SEP="$(printc "%{DIM}%$(tput cols)s%{CLEAR}" | sed "s/ /─/g")"
|
COLS="$(tput cols)"
|
||||||
|
SEP="$(printc "%{DIM}%${COLS}s%{CLEAR}" | sed "s/ /─/g")"
|
||||||
|
|
||||||
# Append ripgrep and bat arguments.
|
# Append ripgrep and bat arguments.
|
||||||
if [[ -n "$OPT_CASE_SENSITIVITY" ]]; then
|
if [[ -n "$OPT_CASE_SENSITIVITY" ]]; then
|
||||||
@ -189,6 +190,7 @@ main() {
|
|||||||
"${LAST_LH[@]}" \
|
"${LAST_LH[@]}" \
|
||||||
--style="${BAT_STYLE}${OPT_SNIP}" \
|
--style="${BAT_STYLE}${OPT_SNIP}" \
|
||||||
--paging=never \
|
--paging=never \
|
||||||
|
--terminal-width="$COLS" \
|
||||||
"$LAST_FILE"
|
"$LAST_FILE"
|
||||||
|
|
||||||
# Print the separator.
|
# Print the separator.
|
||||||
|
Loading…
Reference in New Issue
Block a user