### Small
-- [ ] ->replace_pane, ->replace_popup can be deleted (Abort) but we
+- [X] ->replace_pane, ->replace_popup can be deleted (Abort) but we
don't catch it...
- [ ] notmuch reply should interpolate the first *visible* text part
- [ ] ncurses - don't block in nc_external_viewer - at least abort after
- [ ] Num-C-l doesn't work if it would require part of a wrapped line
off top of screen
-- [ ] ->replace_pane, ->replace_popup can be deleted (Abort) but we
+- [X] ->replace_pane, ->replace_popup can be deleted (Abort) but we
don't catch it...
- [ ] :C-q to recognise names of Unicode chars: e.g. WASTEBASKET
Possibly matches a list which continued :C-q cycles through
p = call_ret(pane, "attach-history", p, 0, NULL, "*Replace History*",
0, NULL, "popup:close");
esi->replace_pane = p;
- if (p)
+ if (p) {
+ pane_add_notify(ci->home, p, "Notify:Close");
home_call(esi->target, "highlight:set-popup", p, 1);
+ }
if (strcmp(ci->key, "K:A-%") == 0)
pane_focus(ci->focus);
else
return 1;
}
+DEF_CMD(search_notify_close)
+{
+ struct es_info *esi = ci->home->data;
+
+ if (ci->focus == esi->replace_pane)
+ esi->replace_pane = NULL;
+ return 1;
+}
+
DEF_CMD(do_replace)
{
struct es_info *esi = ci->home->data;
key_add(es_map, "K:ESC", &search_escape);
key_add(es_map, "search:replace", &do_replace);
+ key_add(es_map, "Notify:Close", &search_notify_close);
/* keys for the 'replace' pane */
er_map = key_alloc();
struct mark *m, *start;
struct highlight_info *hi = ci->home->data;
- if (hi->view < 0 || !hi->popup)
+ if (hi->view < 0)
return Efail;
while ((start = vmark_first(ci->focus, hi->view, ci->home)) != NULL)
hi->replace_popup = ci->focus;
else
hi->popup = ci->focus;
+ pane_add_notify(ci->home, ci->focus, "Notify:Close");
+ return 1;
+}
+
+DEF_CMD(emacs_highlight_close_notify)
+{
+ struct highlight_info *hi = ci->home->data;
+
+ if (ci->focus == hi->replace_popup)
+ hi->replace_popup = NULL;
+ if (ci->focus == hi->popup)
+ hi->popup = NULL;
return 1;
}
key_add(m, "Notify:clip", &emacs_highlight_clip);
key_add(m, "highlight:set-popup", &emacs_highlight_set_popup);
key_add(m, "attach-emacs-search-highlight", &emacs_highlight_reattach);
+ key_add(m, "Notify:Close", &emacs_highlight_close_notify);
hl_map = m;
}