From 3b68dcdd81394f1ac9f743e1f74ff754f95eef9e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 10 Jun 2025 00:26:57 +0900 Subject: Add footer Options: --footer=STR String to print as footer --footer-border[=STYLE] Draw border around the footer section [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| top|bottom|left|right|line|none] (default: line) --footer-label=LABEL Label to print on the footer border --footer-label-pos=COL Position of the footer label [POSITIVE_INTEGER: columns from left| NEGATIVE_INTEGER: columns from right][:bottom] (default: 0 or center) The default border type for footer is 'line', which draws a single separator between the footer and the list. It changes its position depending on `--layout`, so you don't have to manually switch between 'top' and 'bottom' The 'line' style is now supported by other border types as well. `--list-border` is the only exception. --- src/util/util.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/util') diff --git a/src/util/util.go b/src/util/util.go index c8301363..f11a0887 100644 --- a/src/util/util.go +++ b/src/util/util.go @@ -97,24 +97,12 @@ func Min32(first int32, second int32) int32 { // Constrain32 limits the given 32-bit integer with the upper and lower bounds func Constrain32(val int32, min int32, max int32) int32 { - if val < min { - return min - } - if val > max { - return max - } - return val + return Max32(Min32(val, max), min) } // Constrain limits the given integer with the upper and lower bounds func Constrain(val int, min int, max int) int { - if val < min { - return min - } - if val > max { - return max - } - return val + return Max(Min(val, max), min) } func AsUint16(val int) uint16 { -- cgit v1.2.3