Merge branch '2522_smart_backspace'

* 2522_smart_backspace:
  Ticket #2522: fixup of Backspace key behavior in QuickSearch mode.
This commit is contained in:
Andrew Borodin 2011-07-15 20:41:41 +04:00
commit e697f01eba

View File

@ -2947,6 +2947,18 @@ panel_key (WPanel * panel, int key)
{
size_t i;
if (is_abort_char (key))
{
stop_search (panel);
return MSG_HANDLED;
}
if (panel->searching && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE))
{
do_search (panel, key);
return MSG_HANDLED;
}
for (i = 0; panel_map[i].key != 0; i++)
if (key == panel_map[i].key)
return panel_execute_cmd (panel, panel_map[i].command);
@ -2957,29 +2969,13 @@ panel_key (WPanel * panel, int key)
return MSG_HANDLED;
}
if (is_abort_char (key))
if (!command_prompt && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE))
{
stop_search (panel);
start_search (panel);
do_search (panel, key);
return MSG_HANDLED;
}
/* Do not eat characters not meant for the panel below ' ' (e.g. C-l). */
if ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE)
{
if (panel->searching)
{
do_search (panel, key);
return MSG_HANDLED;
}
if (!command_prompt)
{
start_search (panel);
do_search (panel, key);
return MSG_HANDLED;
}
}
return MSG_NOT_HANDLED;
}