summaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'search.c')
-rw-r--r--search.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/search.c b/search.c
index 7e0d60b..ce7d54e 100644
--- a/search.c
+++ b/search.c
@@ -82,8 +82,13 @@ static void
make_history_line_current (entry)
HIST_ENTRY *entry;
{
- rl_replace_line (entry->line, 0);
+#if 0
+ rl_replace_line (entry->line, 1);
rl_undo_list = (UNDO_LIST *)entry->data;
+#else
+ _rl_replace_text (entry->line, 0, rl_end);
+ _rl_fix_point (1);
+#endif
if (_rl_saved_line_for_history)
_rl_free_history_entry (_rl_saved_line_for_history);
@@ -189,6 +194,11 @@ noninc_search (dir, pchar)
saved_point = rl_point;
saved_mark = rl_mark;
+ /* Clear the undo list, since reading the search string should create its
+ own undo list, and the whole list will end up being freed when we
+ finish reading the search string. */
+ rl_undo_list = 0;
+
/* Use the line buffer to read the search string. */
rl_line_buffer[0] = 0;
rl_end = rl_point = 0;