From a340eaf0ab75383857a92172a21b7ece9a8f0555 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 16 Mar 2016 14:10:47 +0200 Subject: [PATCH] Fix the page detection pattern --- rc/core/man.kak | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rc/core/man.kak b/rc/core/man.kak index 82de8b1af..05a81da4b 100644 --- a/rc/core/man.kak +++ b/rc/core/man.kak @@ -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