From 994f85b2ff5ac0a10bfc4904a5a5eef7574a78fd Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Fri, 19 Nov 1999 14:07:56 +0000 Subject: [PATCH] improve searchkeys in dselect --- ChangeLog | 5 +++++ dselect/basecmds.cc | 10 ++++++++-- dselect/methkeys.cc | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8787fd50..9de300f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 19 15:04:10 CET 1999 Wichert Akkerman + + * `n' is also searchagain in dselect now + * Do searchagain if an empty searchstring is entered + Thu Nov 18 10:27:35 EST 1999 Ben Collins * utils/start-stop-daemon.c: Added ability for user.group arg to diff --git a/dselect/basecmds.cc b/dselect/basecmds.cc index 3b4a4b17..e9e0e3aa 100644 --- a/dselect/basecmds.cc +++ b/dselect/basecmds.cc @@ -95,11 +95,13 @@ void baselist::kd_searchagain() { } void baselist::kd_search() { + char newsearchstring[50] + strcpy(newsearchstring,searchstring); werase(querywin); mvwaddstr(querywin,0,0, _("Search for ? ")); echo(); /* fixme: ncurses documentation or implementation */ /* fixme: make / RET do `search again' and / DEL to abort */ - if (wgetnstr(querywin,searchstring,sizeof(searchstring)-1) == ERR) + if (wgetnstr(querywin,newsearchstring,sizeof(newsearchstring)-1) == ERR) searchstring[0]= 0; raise(SIGWINCH); /* fixme: ncurses and xterm arrow keys */ noecho(); /* fixme: ncurses */ @@ -107,7 +109,11 @@ void baselist::kd_search() { else if (info_height) { touchwin(infopad); refreshinfo(); } else if (thisstate_height) redrawthisstate(); else { touchwin(listpad); refreshlist(); } - if (searchstring[0]) dosearch(); + if (newsearchstring[0]) { + strcpy(searchstring,newsearchstring); + dosearch() + } else + kd_searchagain(); } void baselist::displayhelp(const struct helpmenuentry *helpmenu, int key) { diff --git a/dselect/methkeys.cc b/dselect/methkeys.cc index 58b10df2..52649eb8 100644 --- a/dselect/methkeys.cc +++ b/dselect/methkeys.cc @@ -104,6 +104,7 @@ const keybindings::orgbinding methodlist_korgbindings[]= { { KEY_HELP, "help" }, { KEY_F(1), "help" }, { '/', "search" }, + { 'n', "searchagain" }, { '\\', "searchagain" }, { C('l'), "redraw" }, -- 2.39.5