projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
270045d
)
Cosmetics.
author
Francois Fleuret
<francois@fleuret.org>
Mon, 8 Jun 2009 10:47:11 +0000
(12:47 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Mon, 8 Jun 2009 10:47:11 +0000
(12:47 +0200)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
8aeabca
..
918b724
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-23,7
+23,7
@@
*/
// To use it as a super-history-search for bash:
*/
// To use it as a super-history-search for bash:
-// selector -q -b -i -d -v -w -l
10000
<(history)
+// selector -q -b -i -d -v -w -l
${HISTSIZE}
<(history)
#include <fstream>
#include <iostream>
#include <fstream>
#include <iostream>
@@
-126,7
+126,7
@@
void error_feedback() {
//////////////////////////////////////////////////////////////////////
// A quick and dirty hash table
//////////////////////////////////////////////////////////////////////
// A quick and dirty hash table
-// The table itself stores index
of the strings
in a char
+// The table itself stores index
es of the strings taken
in a char
// **table. When a string is added, if it was already in the table,
// the new index replaces the previous one.
// **table. When a string is added, if it was already in the table,
// the new index replaces the previous one.
@@
-144,7
+144,8
@@
int *new_hash_table(int hash_table_size) {
// the previous index it had.
int test_and_add(char *new_string, int new_index,
// the previous index it had.
int test_and_add(char *new_string, int new_index,
- char **strings, int *hash_table, int hash_table_size) {
+ char **strings,
+ int *hash_table, int hash_table_size) {
unsigned int code = 0;
unsigned int code = 0;
@@
-330,10
+331,10
@@
int next_visible(int current_line, int nb_lines, char **lines, matcher_t *matche
//////////////////////////////////////////////////////////////////////
// The value passed to this routine in current_focus_line is the index
//////////////////////////////////////////////////////////////////////
// The value passed to this routine in current_focus_line is the index
-// of the line to highlight
ed
if it matches the matcher. The line
-// highlighted is the first
the one matching the matcher in that
-//
order: The current_focus_line itself, the first with a greated
-// index, the first with a lesser index.
+// of the line to highlight if it matches the matcher. The line
+// highlighted is the first
one matching the matcher in that order:
+//
(1) current_focus_line after motion, (2) the first with a greater
+// index,
(3)
the first with a lesser index.
// The index of the line actually shown highlighted is written in
// displayed_focus_line (it can be -1)
// The index of the line actually shown highlighted is written in
// displayed_focus_line (it can be -1)
@@
-361,6
+362,7
@@
void update_screen(int *current_focus_line, int *displayed_focus_line,
int nb_printed_lines = 0;
use_default_colors();
int nb_printed_lines = 0;
use_default_colors();
+
addstr("\n");
if(matcher.regexp_error) {
addstr("\n");
if(matcher.regexp_error) {
@@
-1054,6
+1056,7
@@
int main(int argc, char **argv) {
}
out.flush();
}
}
out.flush();
}
+
} else {
cout << "Aborted." << endl;
}
} else {
cout << "Aborted." << endl;
}