Fix man.kak when man pages filenames just end up with the manual section

This commit is contained in:
Maxime Coste 2017-05-23 13:59:31 +01:00
parent 7ee3039a79
commit a0e63fbe93

View File

@ -53,7 +53,7 @@ def -params ..1 \
prefix=$(printf %s\\n "$1" | cut -c1-${kak_pos_in_token} 2>/dev/null)
for page in /usr/share/man/*/${prefix}*.[1-8]*; do
candidate=$(basename ${page%%.[1-8]*})
pagenum=$(printf %s\\n "$page" | sed 's,^.*\.\([1-8].*\)\..*$,\1,')
pagenum=$(printf %s\\n "$page" | sed 's,^.*\.\([1-8][^.]*\).*$,\1,')
case $candidate in
*\*) ;;
*) printf %s\\n "$candidate($pagenum)";;