nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 94f49e208f9719450a0ff08f67eef9e7ebbbf455
parent 3f639825930b5fd015a4cbc9ab183faf66406a82
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 25 Jun 2020 10:10:49 +0200

tabbing: beep at the first listing, and when there are zero possibilities

A successful single completion is silent, but when there are zero
or multiple possibilities, nano beeps.

Diffstat:
Msrc/files.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -2555,7 +2555,8 @@ char *input_tab(char *buf, size_t *place, void (*refresh_func)(void), bool *list memmove(buf + common_len, buf + *place, 1); strncpy(buf, mzero, common_len); *place = common_len; - } + } else if (num_matches == 1) + beep(); /* If there is more than one possible completion, show a sorted list. */ if (num_matches > 1) { @@ -2563,6 +2564,9 @@ char *input_tab(char *buf, size_t *place, void (*refresh_func)(void), bool *list size_t nrows, ncols; int row; + if (!*listed) + beep(); + qsort(matches, num_matches, sizeof(char *), diralphasort); /* Find the length of the longest name among the matches. */