]> git.neil.brown.name Git - edlib.git/commitdiff
Search: move to 'search start' when finishing the search.
authorNeilBrown <neil@brown.name>
Wed, 2 Dec 2015 09:12:01 +0000 (20:12 +1100)
committerNeilBrown <neil@brown.name>
Wed, 2 Dec 2015 09:12:01 +0000 (20:12 +1100)
This ensures the final search is from the current starting point.

Signed-off-by: NeilBrown <neil@brown.name>
emacs-search.c

index a159eb18e722f6e4b3e18a69f401fc00f09e7a35..15797a6b90b6cdf892df21405d1e06b6096f33f5 100644 (file)
@@ -223,6 +223,16 @@ REDEF_CMD(search_again)
        return 1;
 }
 
+DEF_CMD(search_done)
+{
+       /* need to advance the target view to 'start' */
+       struct es_info *esi = ci->home->data;
+
+       call3("Move-to", esi->target, 0, esi->start);
+       /* Now let popup finish the job */
+       return 0;
+}
+
 static void emacs_search_init_map(void)
 {
        es_map = key_alloc();
@@ -232,6 +242,7 @@ static void emacs_search_init_map(void)
        key_add(es_map, "C-Chr-C", &search_add);
        key_add(es_map, "C-Chr-R", &search_backward);
        key_add(es_map, "Close", &search_close);
+       key_add(es_map, "popup:Return", &search_done);
 }
 
 DEF_LOOKUP_CMD(search_handle, es_map);