Major search issue

When searching for something, then pressing esc, the search is canceled and you're returned to where you were in the file selection. This is a huge problem, because it makes it impossible to use the search feature along with the playlist.
I politely ask that this behaviour is changed, so that pressing esc during a search will leave the directory panel at the selected file in the search results. As it is, the search feature isn't very useful at all...

now also as Debian bug #562569

Agree. It is cumbersome. For example, I would like to add the song to playlist. But it is impossible to do it in search mode. And when I cancel the search mode using Esc, then I have to find the song on my own... this is the only thing that bothers me on MOC. Without this "bug" it would be perfect :)

This behavior also bothered me so I made a patch.
While it takes a slightly different approach, I think it is similar :
initialize search with '/', type word,
-> hit 'Enter', search exits with cursor positioned on selected item.
-> hit 'Tab', file/dir is added to the playlist, search exits with cursor positioned on selected item.
-> hit 'Esc', search exits with cursor positioned on previous selected item.

(mollom thing seems to block every pastebin service I tried, so here it is inlined)

<br /> Index: interface.c<br /> ===================================================================<br /> --- interface.c (revision 2772)<br /> +++ interface.c (working copy)<br /> @@ -2328,7 +2328,8 @@</p> <p> static void entry_key_search (const struct iface_key *k)<br /> {<br /> - if (k-&gt;type == IFACE_KEY_CHAR &amp;&amp; k-&gt;key.ucs == '\n') {<br /> + if (k-&gt;type == IFACE_KEY_CHAR &amp;&amp; (k-&gt;key.ucs == '\n' ||<br /> + k-&gt;key.ucs == '\t')) {<br /> char *file = iface_get_curr_file ();<br /> char *text = iface_entry_get_text ();</p> <p>@@ -2335,20 +2336,14 @@<br /> iface_entry_disable ();</p> <p> if (text[0]) {<br /> + iface_select_file(file);</p> <p>- if (!strcmp(file, "..")) {<br /> - free (file);<br /> - file = dir_up (cwd);<br /> + if (k-&gt;key.ucs == '\t' &amp;&amp; strcmp(file, "..")) {<br /> + if (file_type(file) == F_DIR)<br /> + add_dir_plist();<br /> + else<br /> + add_file_plist();<br /> }<br /> -<br /> - if (is_url(file))<br /> - play_from_url (file);<br /> - else if (file_type(file) == F_DIR)<br /> - go_to_dir (file, 0);<br /> - else if (file_type(file) == F_PLAYLIST)<br /> - go_to_playlist (file, 0, false);<br /> - else<br /> - play_it (file);<br /> }</p> <p> free (text);<br />

Sorry for the broken formating, here's a more usable version of the patch :

Index: interface.c =================================================================== --- interface.c (revision 2772) +++ interface.c (working copy) @@ -2328,7 +2328,8 @@ static void entry_key_search (const struct iface_key *k) { - if (k->type == IFACE_KEY_CHAR && k->key.ucs == '\n') { + if (k->type == IFACE_KEY_CHAR && (k->key.ucs == '\n' || + k->key.ucs == '\t')) { char *file = iface_get_curr_file (); char *text = iface_entry_get_text (); @@ -2335,20 +2336,14 @@ iface_entry_disable (); if (text[0]) { + iface_select_file(file); - if (!strcmp(file, "..")) { - free (file); - file = dir_up (cwd); + if (k->key.ucs == '\t' && strcmp(file, "..")) { + if (file_type(file) == F_DIR) + add_dir_plist(); + else + add_file_plist(); } - - if (is_url(file)) - play_from_url (file); - else if (file_type(file) == F_DIR) - go_to_dir (file, 0); - else if (file_type(file) == F_PLAYLIST) - go_to_playlist (file, 0, false); - else - play_it (file); } free (text);