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
1 changed files with 11 additions and 0 deletions

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)) { if (0 < ch && ch < 255 && isalnum((unsigned char)ch)) {
int len = strlen(buffer); 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) { if (len < 99) {
buffer[len] = ch; buffer[len] = ch;
buffer[len+1] = '\0'; buffer[len+1] = '\0';
} }
for (int try = 0; try < 2; try++) { for (int try = 0; try < 2; try++) {
len = strlen(buffer); len = strlen(buffer);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {