Convert most of remaining bits.

This commit is contained in:
Nicholas Marriott
2026-06-30 18:19:26 +01:00
parent b3bb8bbd9f
commit 54f5c82500
7 changed files with 52 additions and 90 deletions

View File

@@ -431,12 +431,11 @@ window_switch_run_command(struct window_switch_modedata *data, struct client *c)
struct cmd_find_state fs;
struct session *s;
struct winlink *wl;
struct cmd_parse_tree *tree;
struct cmdq_item *new_item;
char *target = NULL;
struct cmdq_state *state;
char *command, *error;
#if 0 /* XXX: command parser conversion */
enum cmd_parse_status status;
#endif
if (data->matches_size == 0)
return (0);
@@ -468,23 +467,18 @@ window_switch_run_command(struct window_switch_modedata *data, struct client *c)
command = cmd_template_replace(data->command, target, 1);
if (command != NULL && *command != '\0') {
state = cmdq_new_state(&fs, NULL, 0);
#if 0 /* XXX: command parser conversion */
status = cmd_parse_and_append(command, NULL, c, state, &error);
if (status == CMD_PARSE_ERROR) {
tree = cmd_parse_from_string(command, NULL, &error);
if (tree == NULL) {
if (c != NULL) {
*error = toupper((u_char)*error);
status_message_set(c, -1, 1, 0, 0, "%s", error);
}
free(error);
} else {
new_item = cmd_invoke_get(tree, state, NULL);
cmdq_append(c, new_item);
cmd_parse_free(tree);
}
#else
error = xstrdup("XXX: command parser conversion not done for window switch");
if (c != NULL) {
*error = toupper((u_char)*error);
status_message_set(c, -1, 1, 0, 0, "%s", error);
}
free(error);
#endif
cmdq_free_state(state);
}
free(command);