diff --git a/src/screen_find.c b/src/screen_find.c
index 0d9d51f0d2ce959f4e5d53dac032ac8811694be7..3fdf9f30dd923914723c2e85658161e95a8a322f 100644 (file)
--- a/src/screen_find.c
+++ b/src/screen_find.c
#include "screen_find.h"
#include "screen_utils.h"
-#include "screen_message.h"
+#include "screen_status.h"
#include "screen.h"
#include "i18n.h"
#include "options.h"
#define JUMP_PROMPT _("Jump")
/* query user for a string and find it in a list window */
-int
+bool
screen_find(struct list_window *lw, command_t findcmd,
list_window_callback_fn_t callback_fn,
void *callback_data)
list_window_paint_callback_t paint_callback,
void *callback_data)
{
- char *search_str, *iter;
+ char *search_str, *iter, *temp;
const int WRLN_MAX_LINE_SIZE = 1024;
int key = 65;
command_t cmd;
while(1) {
key = screen_getch(screen.findbuf);
/* if backspace or delete was pressed, process instead of ending loop */
- if (key == 127 || key == 330) {
+ if (key == KEY_BACKSPACE || key == KEY_DC) {
int i;
if (search_str <= g_utf8_find_prev_char(screen.findbuf, iter))
iter = g_utf8_find_prev_char(screen.findbuf, iter);
ungetch(key);
if ((cmd=get_keyboard_command()) != CMD_NONE)
do_input_event(cmd);
+
+ temp = g_strdup(search_str);
+ g_free(screen.findbuf);
+ screen.findbuf = temp;
}