From 7d3b5c1fd8a78936beaee22f87d675ebdf0239d2 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Mon, 27 Jun 2016 01:14:44 -0700 Subject: Use score_t instead of double --- src/tty_interface.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/tty_interface.c') diff --git a/src/tty_interface.c b/src/tty_interface.c index eddd510..0f33305 100644 --- a/src/tty_interface.c +++ b/src/tty_interface.c @@ -30,12 +30,17 @@ static void draw_match(tty_interface_t *state, const char *choice, int selected) for (int i = 0; i < n + 1; i++) positions[i] = -1; - double score = match_positions(search, choice, &positions[0]); + score_t score = match_positions(search, choice, &positions[0]); size_t maxwidth = tty_getwidth(tty); - if (options->show_scores) - tty_printf(tty, "(%5.2f) ", score); + if (options->show_scores) { + if (score == SCORE_MIN) { + tty_printf(tty, "( ) "); + } else { + tty_printf(tty, "(%5.2f) ", score); + } + } if (selected) tty_setinvert(tty); -- cgit v1.2.3