]> git.neil.brown.name Git - edlib.git/commitdiff
search: del the view from the correct document.
authorNeilBrown <neil@brown.name>
Sun, 15 Nov 2015 09:22:17 +0000 (20:22 +1100)
committerNeilBrown <neil@brown.name>
Sun, 15 Nov 2015 09:22:17 +0000 (20:22 +1100)
Also make sure to handle "Release" properly if doc_close_views
gets called before the pane is closed.

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

index a44e90b7f4ba20b7126bc398d9f9205a96bd46f8..b116d35cc832fd2ef7d9e66f921f89c03faf4b68 100644 (file)
@@ -144,7 +144,7 @@ static int do_search_close(struct command *c, struct cmd_info *ci)
 {
        struct es_info *esi = ci->focus->data;
 
-       doc_del_view(esi->target->point->doc, &esi->watch);
+       doc_del_view((*ci->pointp)->doc, &esi->watch);
        /* TEMP HACK - please fix */
        esi->target->point->doc->ops->set_attr(esi->end, "highlight", NULL);
        point_free(esi->end);
@@ -169,6 +169,14 @@ static int do_search_again(struct command *c, struct cmd_info *ci)
        char *a, *pfx;
        int ret;
 
+       if (strcmp(ci->key, "Release") == 0) {
+               struct doc *d = (*ci->pointp)->doc;
+
+               /* No marks to remove */
+               doc_del_view(d, c);
+               return 0;
+       }
+
        /* TEMP HACK - please fix */
        d->ops->set_attr(esi->end, "highlight", NULL);
        ci2.pointp = &esi->end;