Lose unnecessary flags on context.

This commit is contained in:
Nicholas Marriott 2008-06-21 10:19:36 +00:00
parent e5ab9a2db5
commit 2bd92e5f18
8 changed files with 11 additions and 17 deletions

3
TODO
View File

@ -76,8 +76,9 @@
- list-keys should be sorted
- document buffer stuff
- copy-mode enhancements: next word etc etc
- problems with force-width when wrapping line in emacs?
---
save-buffer -b number filename
load-buffer -b number filename
copy-buffer -s src-session -t dst-session -a src-index -b dst-index
(from other session)
(from other session)

3
cfg.c
View File

@ -1,4 +1,4 @@
/* $Id: cfg.c,v 1.11 2008-06-19 21:20:24 nicm Exp $ */
/* $Id: cfg.c,v 1.12 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -94,7 +94,6 @@ load_cfg(const char *path, char **cause)
ctx.info = cfg_print;
ctx.cmdclient = NULL;
ctx.flags = 0;
cfg_cause = NULL;
cmd_exec(cmd, &ctx);

View File

@ -1,4 +1,4 @@
/* $Id: cmd-attach-session.c,v 1.19 2008-06-18 22:21:51 nicm Exp $ */
/* $Id: cmd-attach-session.c,v 1.20 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -48,7 +48,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
struct session *s;
char *cause;
if (ctx->flags & CMD_KEY)
if (ctx->curclient != NULL)
return;
if ((s = cmd_find_session(ctx, data->target)) == NULL)

View File

@ -1,4 +1,4 @@
/* $Id: cmd-command-prompt.c,v 1.2 2008-06-19 21:20:25 nicm Exp $ */
/* $Id: cmd-command-prompt.c,v 1.3 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -90,7 +90,6 @@ cmd_command_prompt_callback(void *data, char *s)
ctx.info = key_bindings_info;
ctx.cmdclient = NULL;
ctx.flags = CMD_KEY;
cmd_exec(cmd, &ctx);
}

View File

@ -1,4 +1,4 @@
/* $Id: cmd-new-session.c,v 1.29 2008-06-19 22:04:02 nicm Exp $ */
/* $Id: cmd-new-session.c,v 1.30 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -118,7 +118,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
char *cmd, *cause;
u_int sx, sy;
if (ctx->flags & CMD_KEY)
if (ctx->curclient != NULL)
return;
if (!data->flag_detached) {

View File

@ -1,4 +1,4 @@
/* $Id: key-bindings.c,v 1.34 2008-06-20 17:31:48 nicm Exp $ */
/* $Id: key-bindings.c,v 1.35 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -215,7 +215,6 @@ key_bindings_dispatch(int key, struct client *c)
ctx.info = key_bindings_info;
ctx.cmdclient = NULL;
ctx.flags = CMD_KEY;
cmd_exec(bd->cmd, &ctx);
}

View File

@ -1,4 +1,4 @@
/* $Id: server-msg.c,v 1.47 2008-06-18 22:21:51 nicm Exp $ */
/* $Id: server-msg.c,v 1.48 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -147,7 +147,6 @@ server_msg_fn_command(struct hdr *hdr, struct client *c)
ctx.cursession = NULL;
ctx.cmdclient = c;
ctx.flags = 0;
/* XXX */
if (data.pid != -1 && (cmd->entry->flags & CMD_CANTNEST)) {

5
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.159 2008-06-20 18:45:35 nicm Exp $ */
/* $Id: tmux.h,v 1.160 2008-06-21 10:19:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -725,9 +725,6 @@ struct cmd_ctx {
void (*print)(struct cmd_ctx *, const char *, ...);
void (*info)(struct cmd_ctx *, const char *, ...);
void (*error)(struct cmd_ctx *, const char *, ...);
#define CMD_KEY 0x1
int flags;
};
struct cmd {