diff --git a/rc/man.kak b/rc/man.kak index a0a6a9ff..bec18456 100644 --- a/rc/man.kak +++ b/rc/man.kak @@ -38,7 +38,7 @@ def -params .. \ prefix=${1:0:${kak_pos_in_token}} for page in /usr/share/man/*/${prefix}*.[1-8]*; do candidate=$(basename ${page%%.[1-8]*}) - pagenum=$(echo $page | sed 's/^.*\([1-8][a-z]*\)$/\1/') + pagenum=$(echo $page | sed -r 's,^.+/.+\.([1-8][^.]*)\..+$,\1,') case $candidate in *\*) ;; *) echo $candidate\($pagenum\);;