From 070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 22 Mar 2004 18:10:23 +0000 Subject: Added find (in page) functionality. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@369 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- screen_file.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'screen_file.c') diff --git a/screen_file.c b/screen_file.c index 086290f74..c09682cc6 100644 --- a/screen_file.c +++ b/screen_file.c @@ -333,6 +333,29 @@ file_cmd(screen_t *screen, mpd_client_t *c, command_t cmd) list_window_previous_page(screen->filelist); screen->filelist->repaint = 1; break; + case CMD_LIST_FIND: + if( screen->findbuf ) + { + free(screen->findbuf); + screen->findbuf=NULL; + } + /* fall throw... */ + case CMD_LIST_FIND_NEXT: + if( !screen->findbuf ) + screen->findbuf=screen_readln(screen->status_window.w, "/"); + if( list_window_find(screen->filelist, + list_callback, + c, + screen->findbuf) == 0 ) + { + screen->filelist->repaint = 1; + } + else + { + screen_status_printf(c, "Unable to find \'%s\'", screen->findbuf); + beep(); + } + break; default: return 0; } -- cgit v1.2.3