From: NeilBrown Date: Wed, 13 Sep 2023 23:07:51 +0000 (+1000) Subject: Use DEF_CMD_CLOSED for Close:mark X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=2c948aae63aea9b79cebd6264ba51f7391c7f2de;p=edlib.git Use DEF_CMD_CLOSED for Close:mark Rather than special strcmp handling, use DEF_CMD_CLOSED to ensure Close:mark can be called after a pane has been closed. Signed-off-by: NeilBrown --- diff --git a/core-pane.h b/core-pane.h index 65a43ff3..8e54f3c7 100644 --- a/core-pane.h +++ b/core-pane.h @@ -136,9 +136,9 @@ static inline int do_call_val(enum target_type type, struct pane *home, ci.key[0] != 'C' && /* Compile will often optimise * the strncmp away */ - strncmp(ci.key, "Close", 5) != 0) + strcmp(ci.key, "Close") != 0) /* This pane cannot accept anything but - * "Close" or "Close:mark". + * "Close" */ return Efallthrough; ci.comm = home->handle; diff --git a/lang-python.c b/lang-python.c index 6c8ccd1c..d236caba 100644 --- a/lang-python.c +++ b/lang-python.c @@ -683,7 +683,7 @@ static void python_pane_free(struct command *c safe) Py_DECREF(p); } -DEF_CMD(python_close_mark) +DEF_CMD_CLOSED(python_close_mark) { struct mark *m = ci->mark; diff --git a/render-lines.c b/render-lines.c index f528f5c3..75fa6f6f 100644 --- a/render-lines.c +++ b/render-lines.c @@ -1368,7 +1368,7 @@ DEF_CMD(render_lines_close) return 1; } -DEF_CMD(render_lines_close_mark) +DEF_CMD_CLOSED(render_lines_close_mark) { struct mark *m = ci->mark;