diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2016-06-27 01:14:44 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2016-07-10 13:03:25 -0700 |
commit | 7d3b5c1fd8a78936beaee22f87d675ebdf0239d2 (patch) | |
tree | 75c35d6feaaba58c3d85defd7c2ad61bb9b4b494 /src/tty_interface.c | |
parent | 5c2d67ca7a14cfad94a5718ea62ad1b4d31f73b6 (diff) |
Use score_t instead of double
Diffstat (limited to 'src/tty_interface.c')
-rw-r--r-- | src/tty_interface.c | 11 |
1 files changed, 8 insertions, 3 deletions
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); |