diff options
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -294,8 +294,28 @@ int main(int argc, char *argv[]) { draw_screen(ctx, bv); refresh(); break; + case '/': + { + echo(); + nocbreak(); + char *s = malloc(100); + mvprintw(LINES - 1, 0, "/"); + refresh(); + getnstr(s, 99); + cbreak(); + noecho(); + char *ptr = memmem((char*)screen.mem, screen.mem_len, s, strlen(s)); + if (ptr != NULL) { + size_t target = ptr - (char*) screen.mem; + screen.top_address = LINE_LEN * (target / LINE_LEN); + } + draw_screen(ctx, bv); + refresh(); + } + break; case KEY_ENTER: goto end; + } } |