X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.cc;h=8c17dc1410627390cbc616ecd25183946fac7e5a;hb=13a9057a3cd6b79082b01fb1a7f9e527e985d480;hp=99a9057cf2a64289cc8f7383e08ee72be6471137;hpb=ed0a1fe13a90d9e96145bdcf1a13695e0eeb3a54;p=selector.git diff --git a/selector.cc b/selector.cc index 99a9057..8c17dc1 100644 --- a/selector.cc +++ b/selector.cc @@ -138,6 +138,7 @@ int *new_hash_table(int hash_table_size) { int test_and_add(char *new_string, int new_index, char **strings, int *hash_table, int hash_table_size) { + unsigned int code = 0; // This is my recipe. I checked, it seems to work (as long as @@ -581,8 +582,10 @@ void read_file(const char *input_filename, // Remove the bash history prefix - if(bash_history && (*t == ' ' || (*t >= '0' && *t <= '9'))) { - while(*t == ' ' || (*t >= '0' && *t <= '9')) t++; + if(bash_history) { + while(*t == ' ') t++; + while(*t >= '0' && *t <= '9') t++; + while(*t == ' ') t++; } // Copy the string while transforming the ctrl characters into @@ -960,7 +963,10 @@ int main(int argc, char **argv) { update_screen(¤t_line, &temporary_line, motion, nb_lines, lines, cursor_position, pattern); - } while(key != '\n' && key != KEY_ENTER && key != '\007'); // ^G + } while(key != '\007' && // ^G + key != '\033' && // ^[ (escape) + key != '\n' && + key != KEY_ENTER); echo(); endwin();