projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
043d4e3
)
Fixed the bash prefix deletion, added the ESC key to abort.
author
Francois Fleuret
<francois@fleuret.org>
Tue, 19 May 2009 16:32:17 +0000
(18:32 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Tue, 19 May 2009 16:32:17 +0000
(18:32 +0200)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
7b51ce3
..
8c17dc1
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-582,8
+582,10
@@
void read_file(const char *input_filename,
// Remove the bash history prefix
// 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
}
// Copy the string while transforming the ctrl characters into
@@
-961,7
+963,10
@@
int main(int argc, char **argv) {
update_screen(¤t_line, &temporary_line, motion,
nb_lines, lines, cursor_position, pattern);
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();
echo();
endwin();