projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
10bdbac
)
Automatic commit
author
Francois Fleuret
<francois@fleuret.org>
Thu, 19 Feb 2009 20:19:39 +0000
(21:19 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 19 Feb 2009 20:19:39 +0000
(21:19 +0100)
selector.cc
patch
|
blob
|
history
diff --git
a/selector.cc
b/selector.cc
index
d92a477
..
d809287
100644
(file)
--- a/
selector.cc
+++ b/
selector.cc
@@
-33,14
+33,18
@@
const int nb_lines_max = 100000;
void build_display(int line, int nb_lines, char **lines, char *regexp) {
char buffer[buffer_size];
void build_display(int line, int nb_lines, char **lines, char *regexp) {
char buffer[buffer_size];
- clear(); // Cleaning the window
- refresh(); // After doing something on the display, we refresh it
+
int maxx = getmaxx(stdscr);
int maxy = getmaxy(stdscr);
int maxx = getmaxx(stdscr);
int maxy = getmaxy(stdscr);
+
+ clear(); // Cleaning the window
+ refresh(); // After doing something on the display, we refresh it
+
use_default_colors();
use_default_colors();
- // printw("maxx %d maxy %d key %d\n", maxx, maxy, key);
+
printw("\n");
printw("\n");
printw("\n");
printw("\n");
+
int nb_printed_lines = 2;
for(int y = 0; nb_printed_lines < maxy && y < nb_lines; y++) {
if(strstr(lines[y], regexp)) {
int nb_printed_lines = 2;
for(int y = 0; nb_printed_lines < maxy && y < nb_lines; y++) {
if(strstr(lines[y], regexp)) {
@@
-55,14
+59,15
@@
void build_display(int line, int nb_lines, char **lines, char *regexp) {
nb_printed_lines++;
}
}
nb_printed_lines++;
}
}
+
+ // Draw the modeline
+
move(0, 0);
attron(COLOR_PAIR(1)); // Let's print something in red on black
printw("%d/%d pattern: %s\n", nb_printed_lines, nb_lines - 2, regexp);
attroff(COLOR_PAIR(1)); // Let's get back to default colors!
}
move(0, 0);
attron(COLOR_PAIR(1)); // Let's print something in red on black
printw("%d/%d pattern: %s\n", nb_printed_lines, nb_lines - 2, regexp);
attroff(COLOR_PAIR(1)); // Let's get back to default colors!
}
-// I should find were this is defined ...
-
int main(int argc, char **argv) {
int dummy, xpos, ypos;
int main(int argc, char **argv) {
int dummy, xpos, ypos;