]> git.neil.brown.name Git - edlib.git/commitdiff
pane: move list_del back after ChildClosed call.
authorNeilBrown <neil@brown.name>
Tue, 12 May 2020 11:01:52 +0000 (21:01 +1000)
committerNeilBrown <neil@brown.name>
Tue, 12 May 2020 11:01:52 +0000 (21:01 +1000)
doc:docs relies on knowing where the child will be removed from in the
list, so we need to leave it in the list when we call ChildClosed.
Because of the popup need to ignore the dying pane when
checking for children.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
core-pane.c
lib-popup.c

index 0b73d8751510f47495e1baff5428a0faca35a1df..7779e054604e323f7fcb7b1a0d5a768883538523 100644 (file)
@@ -4,7 +4,7 @@ To-do list for edlib
 Current priorities
 ------------------
 
-- [ ] fix bugs
+- [X] fix bugs
 - [X] emacs: replacable selections aren't working for me.  There needs to be an 
       easier way to cancel them. C-x C-x works as does C-wC-y, but neither are obvious.
       Maybe any cursor movement should
@@ -26,7 +26,7 @@ Bugs to be fixed
 ----------------
 
 - [X] C-x-# in a pop-up file doesn't close the popup any more.
-- [ ] With *Documents* open M-x version.  doc list gets confused.
+- [X] With *Documents* open M-x version.  doc list gets confused.
 - [X] When I type C-w in search, chars are inserted AFTER cursor. Cursor should move.
 - [X] If I scroll-wheel while search, cursor disappears for a time - maybe until status update
 - [X] selection is visible more often than I think it should be. Maybe mouse click
index a9d2570e7c4e0106a2b68fd43c7e397a397aae30..08398e329f5ae0ed704949d751655f4ba6e4a2e7 100644 (file)
@@ -468,10 +468,10 @@ void pane_close(struct pane *p safe)
        ed = pane_root(p);
 
        pane_drop_notifiers(p, NULL);
-       list_del_init(&p->siblings);
 
        if (!(p->parent->damaged & DAMAGED_CLOSED))
                pane_call(p->parent, "ChildClosed", p);
+       list_del_init(&p->siblings);
 
 restart:
        list_for_each_entry(c, &p->children, siblings) {
index befa9537178a624c1278eac603615582552f8f25..1b8233c21b70a8ceea54b41707779bfba8466541 100644 (file)
@@ -156,7 +156,8 @@ DEF_CMD(popup_child_closed)
        struct pane *c;
 
        list_for_each_entry(c, &ci->home->children, siblings)
-               if (!(c->damaged & DAMAGED_CLOSED) && c->z == 0)
+               if (!(c->damaged & DAMAGED_CLOSED) && c->z == 0 &&
+                   c != ci->focus)
                        /* Still have a child */
                        return 1;
        pane_close(ci->home);