From 2c948aae63aea9b79cebd6264ba51f7391c7f2de Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 14 Sep 2023 09:07:51 +1000 Subject: [PATCH] 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 --- core-pane.h | 4 ++-- lang-python.c | 2 +- render-lines.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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; -- 2.39.5