Fix man for systems lacking the col command
At least Alpine linux with mandoc does not have the col command, as it is easy to emulate with sed, fallback onto it when it does not exist.
This commit is contained in:
parent
74fc52b3de
commit
b8f1df6458
|
@ -38,8 +38,13 @@ define-command -hidden -params ..3 man-impl %{ evaluate-commands %sh{
|
||||||
colout=$(mktemp "${TMPDIR:-/tmp}"/kak-man.XXXXXX)
|
colout=$(mktemp "${TMPDIR:-/tmp}"/kak-man.XXXXXX)
|
||||||
env MANWIDTH=${kak_window_range##* } man "$@" > "$manout" 2> "$manerr"
|
env MANWIDTH=${kak_window_range##* } man "$@" > "$manout" 2> "$manerr"
|
||||||
retval=$?
|
retval=$?
|
||||||
col -b -x > ${colout} < ${manout}
|
if command -v col >/dev/null; then
|
||||||
|
col -b -x > ${colout} < ${manout}
|
||||||
|
else
|
||||||
|
sed 's/.//g' > ${colout} < ${manout}
|
||||||
|
fi
|
||||||
rm ${manout}
|
rm ${manout}
|
||||||
|
|
||||||
if [ "${retval}" -eq 0 ]; then
|
if [ "${retval}" -eq 0 ]; then
|
||||||
printf %s\\n "
|
printf %s\\n "
|
||||||
edit -scratch %{*$buffer_name ${*}*}
|
edit -scratch %{*$buffer_name ${*}*}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user