summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-18 09:48:36 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-18 09:51:13 +0200
commit035faa883b980a8b7ec13794d7e02e95cfdc663b (patch)
tree354975c3d2f5c39c4a02c048a14b5d4ae63b57a6 /src
parent8d9e4c61021fdbcf9fdfeb559e52bf03c1978971 (diff)
downloadcalcurse-035faa883b980a8b7ec13794d7e02e95cfdc663b.tar.gz
calcurse-035faa883b980a8b7ec13794d7e02e95cfdc663b.zip
Make bindings always fill the whole status bar
Compute padding for key bindings in the status bar such that they use all available space (without exceeding the given page size). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/keys.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/keys.c b/src/keys.c
index bf44d10..34e6c10 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -416,6 +416,8 @@ void
keys_display_bindings_bar(WINDOW * win, int *bindings, int count,
int page_base, int page_size)
{
+ page_size = MIN(page_size, count - page_base);
+
/* Padding between two key bindings. */
const int padding =
(col * 2) / page_size - (KEYS_KEYLEN + KEYS_LABELEN + 1);