Handle 'q' as quit if first character

This commit is contained in:
Benny Baumann 2020-11-21 17:04:05 +01:00 committed by BenBE
parent 9adb94a379
commit bda07fa42b

11
Panel.c
View File

@ -432,10 +432,21 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
if (0 < ch && ch < 255 && isalnum((unsigned char)ch)) {
int len = strlen(buffer);
if (!len) {
if ('/' == ch) {
ch = '\001';
} else if ('q' == ch) {
return BREAK_LOOP;
}
} else if (1 == len && '\001' == buffer[0]) {
len--;
}
if (len < 99) {
buffer[len] = ch;
buffer[len+1] = '\0';
}
for (int try = 0; try < 2; try++) {
len = strlen(buffer);
for (int i = 0; i < size; i++) {