From 14d21fc2de8c4fe802cbf8df900883fcf8ae9969 Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Thu, 15 May 2014 10:18:03 +0300 Subject: [PATCH] Calculate menu location from slide no --- reporting/markslider | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reporting/markslider b/reporting/markslider index 7741a23..ffd44c1 100755 --- a/reporting/markslider +++ b/reporting/markslider @@ -98,7 +98,8 @@ while true do # print slide $i NO_SLIDES=$( grep -ce "^# " "$1" ) - COLS=$(( $( tput cols ) - 3 )) + SLIDE_CHARS=$(( ${#i} + ${#NO_SLIDES} +1 )) + COLS=$(( $( tput cols ) - $SLIDE_CHARS )) [ "$cmd" = "e" ] && read -N 1 foo display_slide "$1" $i # save cursor location