1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-27 12:16:22 +03:00

Fix the page detection pattern

This commit is contained in:
Frank LENORMAND 2016-03-16 14:10:47 +02:00
parent 5fe2872904
commit a340eaf0ab

View File

@ -49,12 +49,10 @@ def -params .. \
} \
man -docstring "Manpages viewer wrapper" %{ %sh{
subject=${@-$kak_selection}
pagenum=""
## The completion suggestions display the page number, strip them if present
if expr "$subject" : '[a-zA-Z_-]+\([^\)]+\)'; then
pagenum=${subject##*\(}
pagenum=${pagenum:0:$((${#pagenum} - 1))}
pagenum=$(expr "$subject" : '.*(\([1-8].*\))')
if [ -n "$pagenum" ]; then
subject=${subject%%\(*}
fi