From 63ef829129dbe107990405e91d9cb7f32c4e28be Mon Sep 17 00:00:00 2001 From: William Schroeder Date: Sun, 7 Apr 2024 21:57:21 -0500 Subject: [PATCH] fix(display): ensure base line length is equal to terminal width even if map line length is shorter --- h-m-m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/h-m-m b/h-m-m index 0ee00c6..0a2c426 100755 --- a/h-m-m +++ b/h-m-m @@ -3374,6 +3374,12 @@ function display(&$mm, $force_center = false) else $line = $blank; + + // ensuring that the line is long enough even if the map line is + // shorter than the terminal width + if (mb_strlen($line) < $mm['terminal_width']) + $line .= str_repeat(' ', $mm['terminal_width'] - mb_strlen($line)); + // this one really depends on (x,y), but after this, the // coordinates are not reliable anymore because of the // added escape codes.