From cc094fdfe6276b93683113f395edbc004837d362 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Fri, 4 Dec 2009 22:14:47 +0000 Subject: Sync OpenBSD patchset 581: Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last time now I've configured emacs to make them displayed in really annoying colours... --- client.c | 16 +++---- clock.c | 10 ++-- cmd-attach-session.c | 8 ++-- cmd-bind-key.c | 4 +- cmd-break-pane.c | 18 +++---- cmd-capture-pane.c | 4 +- cmd-choose-window.c | 8 ++-- cmd-generic.c | 16 +++---- cmd-kill-session.c | 4 +- cmd-list-buffers.c | 4 +- cmd-list-keys.c | 4 +- cmd-list-panes.c | 8 ++-- cmd-new-session.c | 12 ++--- cmd-new-window.c | 4 +- cmd-paste-buffer.c | 4 +- cmd-pipe-pane.c | 10 ++-- cmd-previous-layout.c | 4 +- cmd-resize-pane.c | 4 +- cmd-respawn-window.c | 4 +- cmd-select-layout.c | 6 +-- cmd-send-keys.c | 4 +- cmd-server-info.c | 10 ++-- cmd-set-option.c | 26 +++++----- cmd-show-buffer.c | 12 ++--- cmd-show-messages.c | 4 +- cmd-show-options.c | 4 +- cmd-split-window.c | 4 +- cmd-string.c | 4 +- cmd-swap-pane.c | 4 +- cmd-unlink-window.c | 4 +- cmd.c | 24 +++++----- grid-utf8.c | 4 +- grid-view.c | 8 ++-- grid.c | 28 +++++------ input-keys.c | 8 ++-- input.c | 20 ++++---- job.c | 8 ++-- key-bindings.c | 16 +++---- key-string.c | 6 +-- layout-set.c | 22 ++++----- layout.c | 48 +++++++++---------- log.c | 4 +- mode-key.c | 16 +++---- names.c | 8 ++-- paste.c | 6 +-- screen-redraw.c | 12 ++--- screen-write.c | 16 +++---- screen.c | 10 ++-- server-client.c | 18 +++---- server-fn.c | 18 +++---- server-window.c | 18 +++---- server.c | 8 ++-- session.c | 10 ++-- status.c | 42 ++++++++-------- tmux.1 | 6 +-- tmux.c | 24 +++++----- tmux.h | 130 +++++++++++++++++++++++++------------------------- tty-keys.c | 20 ++++---- tty-term.c | 12 +++-- tty.c | 82 +++++++++++++++---------------- window-choose.c | 12 ++--- window-clock.c | 4 +- window-copy.c | 32 ++++++------- window-more.c | 8 ++-- window.c | 12 ++--- xterm-keys.c | 18 +++---- 66 files changed, 484 insertions(+), 482 deletions(-) diff --git a/client.c b/client.c index ef0ebe78..4ac68243 100644 --- a/client.c +++ b/client.c @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.89 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: client.c,v 1.90 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -129,7 +129,7 @@ client_send_identify(int flags) if (getcwd(data.cwd, sizeof data.cwd) == NULL) *data.cwd = '\0'; - + term = getenv("TERM"); if (term == NULL || strlcpy(data.term, term, sizeof data.term) >= sizeof data.term) @@ -147,7 +147,7 @@ client_send_environ(void) struct msg_environ_data data; char **var; - for (var = environ; *var != NULL; var++) { + for (var = environ; *var != NULL; var++) { if (strlcpy(data.var, *var, sizeof data.var) >= sizeof data.var) continue; client_write_server(MSG_ENVIRON, &data, sizeof data); @@ -157,7 +157,7 @@ client_send_environ(void) void client_write_server(enum msgtype type, void *buf, size_t len) { - imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len); + imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len); } void @@ -183,7 +183,7 @@ client_main(void) /* Note: event_init() has already been called. */ - /* Set up signals. */ + /* Set up signals. */ memset(&sigact, 0, sizeof sigact); sigemptyset(&sigact.sa_mask); sigact.sa_flags = SA_RESTART; @@ -267,9 +267,9 @@ client_callback(unused int fd, short events, unused void *data) if (client_dispatch() != 0) { event_loopexit(NULL); return; - } + } } - + if (events & EV_WRITE) { if (msgbuf_write(&client_ibuf.w) < 0) goto lost_server; @@ -345,7 +345,7 @@ client_dispatch(void) if (datalen != sizeof lockdata) fatalx("bad MSG_LOCK size"); memcpy(&lockdata, imsg.data, sizeof lockdata); - + lockdata.cmd[(sizeof lockdata.cmd) - 1] = '\0'; system(lockdata.cmd); client_write_server(MSG_UNLOCK, NULL, 0); diff --git a/clock.c b/clock.c index 059b277d..5c0a2400 100644 --- a/clock.c +++ b/clock.c @@ -1,4 +1,4 @@ -/* $Id: clock.c,v 1.8 2009-11-28 14:57:59 tcunha Exp $ */ +/* $Id: clock.c,v 1.9 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -134,13 +134,13 @@ clock_draw(struct screen_write_ctx *ctx, int colour, int style) for (ptr = tim; *ptr != '\0'; ptr++) { if (*ptr >= '0' && *ptr <= '9') idx = *ptr - '0'; - else if (*ptr == ':') + else if (*ptr == ':') idx = 10; - else if (*ptr == 'A') + else if (*ptr == 'A') idx = 11; - else if (*ptr == 'P') + else if (*ptr == 'P') idx = 12; - else if (*ptr == 'M') + else if (*ptr == 'M') idx = 13; else { x += 6; diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 13d0ff54..e55f7c46 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-attach-session.c,v 1.34 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-attach-session.c,v 1.35 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -29,7 +29,7 @@ int cmd_attach_session_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", "[-d] " CMD_TARGET_SESSION_USAGE, - CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", + CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", cmd_target_init, cmd_target_parse, cmd_attach_session_exec, @@ -59,7 +59,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) if (ctx->cmdclient == NULL) { if (cmd_check_flag(data->chflags, 'd')) { - /* + /* * Can't use server_write_session in case attaching to * the same session as currently attached to. */ @@ -72,7 +72,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) server_write_client(c, MSG_DETACH, NULL, 0); } } - + ctx->curclient->session = s; server_redraw_client(ctx->curclient); } else { diff --git a/cmd-bind-key.c b/cmd-bind-key.c index e20a75b1..6f292629 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -1,4 +1,4 @@ -/* $Id: cmd-bind-key.c,v 1.26 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-bind-key.c,v 1.27 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -152,7 +152,7 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "unknown command: %s", data->modecmd); return (-1); } - + mtmp.key = data->key & ~KEYC_PREFIX; mtmp.mode = data->command_key ? 1 : 0; if ((mbind = SPLAY_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) { diff --git a/cmd-break-pane.c b/cmd-break-pane.c index 6c01ca4b..dd9bdaf9 100644 --- a/cmd-break-pane.c +++ b/cmd-break-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-break-pane.c,v 1.10 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-break-pane.c,v 1.11 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -64,18 +64,18 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl->window->active == NULL) wl->window->active = TAILQ_NEXT(wp, entry); } - layout_close_pane(wp); + layout_close_pane(wp); - w = wp->window = window_create1(s->sx, s->sy); - TAILQ_INSERT_HEAD(&w->panes, wp, entry); - w->active = wp; - w->name = default_window_name(w); + w = wp->window = window_create1(s->sx, s->sy); + TAILQ_INSERT_HEAD(&w->panes, wp, entry); + w->active = wp; + w->name = default_window_name(w); layout_init(w); base_idx = options_get_number(&s->options, "base-index"); - wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */ - if (!cmd_check_flag(data->chflags, 'd')) - session_select(s, wl->idx); + wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */ + if (!cmd_check_flag(data->chflags, 'd')) + session_select(s, wl->idx); server_redraw_session(s); server_status_session_group(s); diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index 9830c444..ef33947e 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-capture-pane.c,v 1.1 2009-12-02 15:10:44 tcunha Exp $ */ +/* $Id: cmd-capture-pane.c,v 1.2 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Jonathan Alvarado @@ -48,7 +48,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) struct screen *s; struct session *sess; u_int i, limit; - size_t len, linelen; + size_t len, linelen; if (cmd_find_pane(ctx, data->target, &sess, &wp) == NULL) return (-1); diff --git a/cmd-choose-window.c b/cmd-choose-window.c index 6cff98c4..ce45dc7a 100644 --- a/cmd-choose-window.c +++ b/cmd-choose-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-choose-window.c,v 1.19 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-choose-window.c,v 1.20 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -116,10 +116,10 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx) cdata->client = ctx->curclient; cdata->client->references++; - window_choose_ready(wl->window->active, + window_choose_ready(wl->window->active, cur, cmd_choose_window_callback, cmd_choose_window_free, cdata); - return (0); + return (0); } void @@ -133,7 +133,7 @@ cmd_choose_window_callback(void *data, int idx) if (idx == -1) return; if (cdata->client->flags & CLIENT_DEAD) - return; + return; if (cdata->session->flags & SESSION_DEAD) return; if (cdata->client->session != cdata->session) diff --git a/cmd-generic.c b/cmd-generic.c index 275bbf57..d3845d43 100644 --- a/cmd-generic.c +++ b/cmd-generic.c @@ -1,4 +1,4 @@ -/* $Id: cmd-generic.c,v 1.37 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-generic.c,v 1.38 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -141,7 +141,7 @@ cmd_fill_argument(int flags, char **arg, char **arg2, int argc, char **argv) if (argc == 2) *arg2 = xstrdup(argv[1]); return (0); - } + } if (argc != 0) return (-1); @@ -225,9 +225,9 @@ cmd_target_print(struct cmd *self, char *buf, size_t len) off += cmd_print_flags(buf, len, off, data->chflags); if (off < len && data->target != NULL) off += cmd_prarg(buf + off, len - off, " -t ", data->target); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } @@ -317,9 +317,9 @@ cmd_srcdst_print(struct cmd *self, char *buf, size_t len) off += xsnprintf(buf + off, len - off, " -s %s", data->src); if (off < len && data->dst != NULL) off += xsnprintf(buf + off, len - off, " -t %s", data->dst); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } @@ -415,9 +415,9 @@ cmd_buffer_print(struct cmd *self, char *buf, size_t len) off += xsnprintf(buf + off, len - off, " -b %d", data->buffer); if (off < len && data->target != NULL) off += cmd_prarg(buf + off, len - off, " -t ", data->target); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } diff --git a/cmd-kill-session.c b/cmd-kill-session.c index 28b729f5..eb2bde0b 100644 --- a/cmd-kill-session.c +++ b/cmd-kill-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-kill-session.c,v 1.16 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-kill-session.c,v 1.17 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -45,7 +45,7 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_target_data *data = self->data; struct session *s; - struct client *c; + struct client *c; u_int i; if ((s = cmd_find_session(ctx, data->target)) == NULL) diff --git a/cmd-list-buffers.c b/cmd-list-buffers.c index 287736ab..deb1a175 100644 --- a/cmd-list-buffers.c +++ b/cmd-list-buffers.c @@ -1,4 +1,4 @@ -/* $Id: cmd-list-buffers.c,v 1.14 2009-11-28 14:54:12 tcunha Exp $ */ +/* $Id: cmd-list-buffers.c,v 1.15 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -70,7 +70,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx) tmp[50 - 3] = '\0'; strlcat(tmp, "...", sizeof tmp); } - + ctx->print(ctx, "%u: %zu bytes: \"%s\"", idx - 1, size, tmp); } diff --git a/cmd-list-keys.c b/cmd-list-keys.c index b0e34272..80845211 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -1,4 +1,4 @@ -/* $Id: cmd-list-keys.c,v 1.23 2009-11-19 22:15:58 tcunha Exp $ */ +/* $Id: cmd-list-keys.c,v 1.24 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -75,7 +75,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx) if (used >= sizeof tmp) continue; - if (!(bd->key & KEYC_PREFIX)) { + if (!(bd->key & KEYC_PREFIX)) { used = strlcat(tmp, "(no prefix) ", sizeof tmp); if (used >= sizeof tmp) continue; diff --git a/cmd-list-panes.c b/cmd-list-panes.c index 4292786a..a075cf38 100644 --- a/cmd-list-panes.c +++ b/cmd-list-panes.c @@ -1,4 +1,4 @@ -/* $Id: cmd-list-panes.c,v 1.3 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-list-panes.c,v 1.4 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -23,7 +23,7 @@ #include "tmux.h" /* - * List panes on given window.. + * List panes on given window. */ int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *); @@ -56,7 +56,7 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { gd = wp->base.grid; - + size = 0; for (i = 0; i < gd->hsize; i++) { gl = &gd->linedata[i]; @@ -64,7 +64,7 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) size += gl->utf8size * sizeof *gl->utf8data; } size += gd->hsize * sizeof *gd->linedata; - + ctx->print(ctx, "%u: [%ux%u] [history %u/%u, %llu bytes]", n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size); n++; diff --git a/cmd-new-session.c b/cmd-new-session.c index 6484dc5e..5d12b267 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-session.c,v 1.72 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-new-session.c,v 1.73 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -184,8 +184,8 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "not a terminal"); return (-1); } - - overrides = + + overrides = options_get_string(&global_s_options, "terminal-overrides"); if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) { ctx->error(ctx, "open terminal failed: %s", cause); @@ -267,13 +267,13 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) * Set the client to the new session. If a command client exists, it is * taking this session and needs to get MSG_READY and stay around. */ - if (!detached) { + if (!detached) { if (ctx->cmdclient != NULL) { server_write_client(ctx->cmdclient, MSG_READY, NULL, 0); - ctx->cmdclient->session = s; + ctx->cmdclient->session = s; server_redraw_client(ctx->cmdclient); } else { - ctx->curclient->session = s; + ctx->curclient->session = s; server_redraw_client(ctx->curclient); } } diff --git a/cmd-new-window.c b/cmd-new-window.c index 0b537021..a052c273 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-window.c,v 1.41 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-new-window.c,v 1.42 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -166,7 +166,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (!data->flag_detached) { session_select(s, wl->idx); server_redraw_session_group(s); - } else + } else server_status_session_group(s); return (0); diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c index 7860e3a7..e16d3407 100644 --- a/cmd-paste-buffer.c +++ b/cmd-paste-buffer.c @@ -1,4 +1,4 @@ -/* $Id: cmd-paste-buffer.c,v 1.23 2009-11-28 14:54:12 tcunha Exp $ */ +/* $Id: cmd-paste-buffer.c,v 1.24 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -78,7 +78,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) paste_free_index(&s->buffers, data->buffer); } - return (0); + return (0); } /* Add bytes to a buffer but change every '\n' to '\r'. */ diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index 19f3f018..19611893 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-pipe-pane.c,v 1.9 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-pipe-pane.c,v 1.10 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -86,7 +86,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) switch (fork()) { case -1: ctx->error(ctx, "fork error: %s", strerror(errno)); - return (-1); + return (-1); case 0: /* Child process. */ close(pipe_fd[0]); @@ -113,17 +113,17 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) wp->pipe_fd = pipe_fd[0]; wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); - + wp->pipe_event = bufferevent_new(wp->pipe_fd, NULL, NULL, cmd_pipe_pane_error_callback, wp); bufferevent_enable(wp->pipe_event, EV_WRITE); - + if ((mode = fcntl(wp->pipe_fd, F_GETFL)) == -1) fatal("fcntl failed"); if (fcntl(wp->pipe_fd, F_SETFL, mode|O_NONBLOCK) == -1) fatal("fcntl failed"); if (fcntl(wp->pipe_fd, F_SETFD, FD_CLOEXEC) == -1) - fatal("fcntl failed"); + fatal("fcntl failed"); return (0); } } diff --git a/cmd-previous-layout.c b/cmd-previous-layout.c index 26435035..1d04c600 100644 --- a/cmd-previous-layout.c +++ b/cmd-previous-layout.c @@ -1,4 +1,4 @@ -/* $Id: cmd-previous-layout.c,v 1.5 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-previous-layout.c,v 1.6 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -43,7 +43,7 @@ cmd_previous_layout_exec(struct cmd *self, struct cmd_ctx *ctx) struct cmd_target_data *data = self->data; struct winlink *wl; u_int layout; - + if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index d281747d..a608c5e5 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-resize-pane.c,v 1.13 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-resize-pane.c,v 1.14 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -56,7 +56,7 @@ cmd_resize_pane_init(struct cmd *self, int key) cmd_set_flag(&data->chflags, 'L'); if (key == (KEYC_RIGHT | KEYC_CTRL)) cmd_set_flag(&data->chflags, 'R'); - + if (key == (KEYC_UP | KEYC_ESCAPE)) { cmd_set_flag(&data->chflags, 'U'); data->arg = xstrdup("5"); diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c index 0cfa46d7..79f77376 100644 --- a/cmd-respawn-window.c +++ b/cmd-respawn-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-respawn-window.c,v 1.24 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-respawn-window.c,v 1.25 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -72,7 +72,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx) wp = TAILQ_FIRST(&w->panes); TAILQ_REMOVE(&w->panes, wp, entry); layout_free(w); - window_destroy_panes(w); + window_destroy_panes(w); TAILQ_INSERT_HEAD(&w->panes, wp, entry); window_pane_resize(wp, w->sx, w->sy); if (window_pane_spawn( diff --git a/cmd-select-layout.c b/cmd-select-layout.c index 3b57d202..c4f96926 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -1,4 +1,4 @@ -/* $Id: cmd-select-layout.c,v 1.9 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-select-layout.c,v 1.10 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -52,7 +52,7 @@ cmd_select_layout_init(struct cmd *self, int key) break; case ('2' | KEYC_ESCAPE): data->arg = xstrdup("even-vertical"); - break; + break; case ('3' | KEYC_ESCAPE): data->arg = xstrdup("main-horizontal"); break; @@ -80,7 +80,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "unknown layout or ambiguous: %s", data->arg); return (-1); } - + layout = layout_set_select(wl->window, layout); ctx->info(ctx, "arranging in: %s", layout_set_name(layout)); diff --git a/cmd-send-keys.c b/cmd-send-keys.c index 48f72407..70a57717 100644 --- a/cmd-send-keys.c +++ b/cmd-send-keys.c @@ -1,4 +1,4 @@ -/* $Id: cmd-send-keys.c,v 1.23 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-send-keys.c,v 1.24 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -33,7 +33,7 @@ size_t cmd_send_keys_print(struct cmd *, char *, size_t); struct cmd_send_keys_data { char *target; - u_int nkeys; + u_int nkeys; int *keys; }; diff --git a/cmd-server-info.c b/cmd-server-info.c index 9deda7d3..c35e51b8 100644 --- a/cmd-server-info.c +++ b/cmd-server-info.c @@ -1,4 +1,4 @@ -/* $Id: cmd-server-info.c,v 1.35 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-server-info.c,v 1.36 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -94,12 +94,12 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) ctx->print(ctx, "%2d: %s (%d, %d): %s [%ux%u %s] " "[flags=0x%x/0x%x, references=%u]", i, c->tty.path, c->ibuf.fd, c->tty.fd, c->session->name, - c->tty.sx, c->tty.sy, c->tty.termname, c->flags, + c->tty.sx, c->tty.sy, c->tty.termname, c->flags, c->tty.flags, c->references); } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Sessions: [%zu/%zu]", + ctx->print(ctx, "Sessions: [%zu/%zu]", sizeof (struct grid_cell), sizeof (struct grid_utf8)); for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { s = ARRAY_ITEM(&sessions, i); @@ -148,7 +148,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Terminals:"); + ctx->print(ctx, "Terminals:"); SLIST_FOREACH(term, &tty_terms, entry) { ctx->print(ctx, "%s [references=%u, flags=0x%x]:", term->name, term->references, term->flags); @@ -180,7 +180,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Jobs:"); + ctx->print(ctx, "Jobs:"); SLIST_FOREACH(job, &all_jobs, lentry) { ctx->print(ctx, "%s [fd=%d, pid=%d, status=%d, flags=0x%x]", job->cmd, job->fd, job->pid, job->status, job->flags); diff --git a/cmd-set-option.c b/cmd-set-option.c index 2e0074b6..50efb4f2 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.88 2009-12-04 22:11:23 tcunha Exp $ */ +/* $Id: cmd-set-option.c,v 1.89 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -34,17 +34,17 @@ const char *cmd_set_option_print( void cmd_set_option_string(struct cmd_ctx *, struct options *, const struct set_option_entry *, char *, int); void cmd_set_option_number(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_keys(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_colour(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_attributes(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_flag(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_choice(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); const struct cmd_entry cmd_set_option_entry = { "set-option", "set", @@ -103,7 +103,7 @@ const struct set_option_entry set_session_option_table[] = { { "status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-interval", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, - { "status-justify", + { "status-justify", SET_OPTION_CHOICE, 0, 0, set_option_status_justify_list }, { "status-keys", SET_OPTION_CHOICE, 0, 0, set_option_status_keys_list }, { "status-left", SET_OPTION_STRING, 0, 0, NULL }, @@ -116,11 +116,11 @@ const struct set_option_entry set_session_option_table[] = { { "status-right-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-right-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-right-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL }, - { "status-utf8", SET_OPTION_FLAG, 0, 0, NULL }, + { "status-utf8", SET_OPTION_FLAG, 0, 0, NULL }, { "terminal-overrides", SET_OPTION_STRING, 0, 0, NULL }, { "update-environment", SET_OPTION_STRING, 0, 0, NULL }, { "visual-activity", SET_OPTION_FLAG, 0, 0, NULL }, - { "visual-bell", SET_OPTION_FLAG, 0, 0, NULL }, + { "visual-bell", SET_OPTION_FLAG, 0, 0, NULL }, { "visual-content", SET_OPTION_FLAG, 0, 0, NULL }, { NULL, 0, 0, 0, NULL } }; @@ -266,7 +266,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) server_redraw_client(c); } - /* + /* * Special-case: kill all persistent jobs if status-left, status-right * or set-titles-string have changed. Persistent jobs are only used by * the status line at the moment so this works XXX. @@ -282,7 +282,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) jobs = &c->status_jobs; do { - try_again = 0; + try_again = 0; job = RB_ROOT(jobs); while (job != NULL) { nextjob = RB_NEXT(jobs, jobs, job); @@ -366,7 +366,7 @@ cmd_set_option_string(struct cmd_ctx *ctx, struct options *oo, xasprintf(&newvalue, "%s%s", oldvalue, value); } else newvalue = value; - + o = options_set_string(oo, entry->name, "%s", newvalue); ctx->info(ctx, "set option: %s -> %s", o->name, cmd_set_option_print(entry, o)); diff --git a/cmd-show-buffer.c b/cmd-show-buffer.c index a7b88d81..d7e3e394 100644 --- a/cmd-show-buffer.c +++ b/cmd-show-buffer.c @@ -1,4 +1,4 @@ -/* $Id: cmd-show-buffer.c,v 1.11 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-show-buffer.c,v 1.12 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -71,24 +71,24 @@ cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) width = s->sx; if (ctx->cmdclient != NULL) width = ctx->cmdclient->tty.sx; - + buf = xmalloc(width + 1); len = 0; - + ptr = in; do { buf[len++] = *ptr++; - + if (len == width || buf[len - 1] == '\n') { if (buf[len - 1] == '\n') len--; buf[len] = '\0'; - ctx->print(ctx, "%s", buf); + ctx->print(ctx, "%s", buf); len = 0; } } while (*ptr != '\0'); - + if (len != 0) { buf[len] = '\0'; ctx->print(ctx, "%s", buf); diff --git a/cmd-show-messages.c b/cmd-show-messages.c index c92107a3..f533ed92 100644 --- a/cmd-show-messages.c +++ b/cmd-show-messages.c @@ -1,4 +1,4 @@ -/* $Id: cmd-show-messages.c,v 1.1 2009-11-19 22:20:04 tcunha Exp $ */ +/* $Id: cmd-show-messages.c,v 1.2 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -57,7 +57,7 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_ctx *ctx) tim = ctime(&msg->msg_time); *strchr(tim, '\n') = '\0'; - + ctx->print(ctx, "%s %s", tim, msg->msg); } diff --git a/cmd-show-options.c b/cmd-show-options.c index 94095676..26d73e2a 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -1,4 +1,4 @@ -/* $Id: cmd-show-options.c,v 1.19 2009-12-04 22:11:23 tcunha Exp $ */ +/* $Id: cmd-show-options.c,v 1.20 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -43,7 +43,7 @@ const struct cmd_entry cmd_show_options_entry = { int cmd_show_options_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_target_data *data = self->data; + struct cmd_target_data *data = self->data; const struct set_option_entry *table; struct session *s; struct winlink *wl; diff --git a/cmd-split-window.c b/cmd-split-window.c index c21160fe..3dfe2ea8 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-split-window.c,v 1.30 2009-11-22 00:12:33 tcunha Exp $ */ +/* $Id: cmd-split-window.c,v 1.31 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -69,7 +69,7 @@ cmd_split_window_init(struct cmd *self, int key) switch (key) { case '%': data->flag_horizontal = 1; - break; + break; case '"': data->flag_horizontal = 0; break; diff --git a/cmd-string.c b/cmd-string.c index 8737e850..b10ea6a8 100644 --- a/cmd-string.c +++ b/cmd-string.c @@ -1,4 +1,4 @@ -/* $Id: cmd-string.c,v 1.28 2009-11-28 14:45:30 tcunha Exp $ */ +/* $Id: cmd-string.c,v 1.29 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -121,7 +121,7 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause) case EOF: case ' ': case '\t': - if (have_arg) { + if (have_arg) { buf = xrealloc(buf, 1, len + 1); buf[len] = '\0'; diff --git a/cmd-swap-pane.c b/cmd-swap-pane.c index eab57367..02ec607c 100644 --- a/cmd-swap-pane.c +++ b/cmd-swap-pane.c @@ -1,4 +1,4 @@ -/* $Id: cmd-swap-pane.c,v 1.14 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-swap-pane.c,v 1.15 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -110,7 +110,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx) dst_wp->layout_cell = src_lc; dst_lc->wp = src_wp; src_wp->layout_cell = dst_lc; - + src_wp->window = dst_w; dst_wp->window = src_w; diff --git a/cmd-unlink-window.c b/cmd-unlink-window.c index 967d4655..5ded5dcb 100644 --- a/cmd-unlink-window.c +++ b/cmd-unlink-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-unlink-window.c,v 1.20 2009-11-14 17:56:39 tcunha Exp $ */ +/* $Id: cmd-unlink-window.c,v 1.21 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -63,7 +63,7 @@ cmd_unlink_window_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "window is only linked to one session"); return (-1); } - + server_unlink_window(s, wl); recalculate_sizes(); diff --git a/cmd.c b/cmd.c index 2f327b54..8ebbcfe7 100644 --- a/cmd.c +++ b/cmd.c @@ -1,4 +1,4 @@ -/* $Id: cmd.c,v 1.133 2009-12-02 15:10:44 tcunha Exp $ */ +/* $Id: cmd.c,v 1.134 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -168,7 +168,7 @@ cmd_free_argv(int argc, char **argv) int i; if (argc == 0) - return; + return; for (i = 0; i < argc; i++) { if (argv[i] != NULL) xfree(argv[i]); @@ -509,7 +509,7 @@ cmd_lookup_session(const char *name, int *ambiguous) * be unique so an exact match can't be ambigious and can just be * returned. */ - for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { + for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { if ((s = ARRAY_ITEM(&sessions, i)) == NULL) continue; if (strcmp(name, s->name) == 0) @@ -521,7 +521,7 @@ cmd_lookup_session(const char *name, int *ambiguous) * be ambiguous. */ sfound = NULL; - for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { + for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { if ((s = ARRAY_ITEM(&sessions, i)) == NULL) continue; if (strncmp(name, s->name, strlen(name)) == 0 || @@ -533,7 +533,7 @@ cmd_lookup_session(const char *name, int *ambiguous) sfound = s; } } - return (sfound); + return (sfound); } /* @@ -557,7 +557,7 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous) if ((wl = winlink_find_by_index(&s->windows, idx)) != NULL) return (wl); } - + /* Look for exact matches, error if more than one. */ wlfound = NULL; RB_FOREACH(wl, winlinks, &s->windows) { @@ -583,7 +583,7 @@ cmd_lookup_window(struct session *s, const char *name, int *ambiguous) } wlfound = wl; } - } + } if (wlfound != NULL) return (wlfound); @@ -706,7 +706,7 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp) wl = s->curw; else if ((wl = cmd_lookup_window(s, winptr, &ambiguous)) == NULL) goto not_found; - + if (sessptr != NULL) xfree(sessptr); return (wl); @@ -807,7 +807,7 @@ cmd_find_index(struct cmd_ctx *ctx, const char *arg, struct session **sp) ctx->error(ctx, "invalid index: %s", arg); idx = -2; } - + if (sessptr != NULL) xfree(sessptr); return (idx); @@ -829,7 +829,7 @@ no_colon: no_session: if (ambiguous) - ctx->error(ctx, "multiple sessions: %s", arg); + ctx->error(ctx, "multiple sessions: %s", arg); else ctx->error(ctx, "session not found: %s", arg); if (sessptr != NULL) @@ -917,7 +917,7 @@ no_period: /* Try index in the current session and window. */ if ((*wpp = window_pane_at_index(s->curw->window, idx)) == NULL) goto lookup_window; - + return (s->curw); lookup_window: @@ -925,7 +925,7 @@ lookup_window: if ((wl = cmd_find_window(ctx, arg, sp)) != NULL) *wpp = wl->window->active; return (wl); - + error: xfree(winptr); return (NULL); diff --git a/grid-utf8.c b/grid-utf8.c index 389c356e..5eb94a3e 100644 --- a/grid-utf8.c +++ b/grid-utf8.c @@ -1,4 +1,4 @@ -/* $Id: grid-utf8.c,v 1.1 2009-11-19 22:23:27 tcunha Exp $ */ +/* $Id: grid-utf8.c,v 1.2 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -92,5 +92,5 @@ grid_utf8_compare(const struct grid_utf8 *gu1, const struct grid_utf8 *gu2) return (0); if (memcmp(gu1->data, gu2->data, size) != 0) return (0); - return (1); + return (1); } diff --git a/grid-view.c b/grid-view.c index 1a04f157..98624e10 100644 --- a/grid-view.c +++ b/grid-view.c @@ -1,4 +1,4 @@ -/* $Id: grid-view.c,v 1.19 2009-10-15 01:55:12 tcunha Exp $ */ +/* $Id: grid-view.c,v 1.20 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -149,7 +149,7 @@ grid_view_insert_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny) ny2 = rlower + 1 - py - ny; grid_move_lines(gd, rlower + 1 - ny2, py, ny2); - grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2); + grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2); } /* Delete lines. */ @@ -165,7 +165,7 @@ grid_view_delete_lines(struct grid *gd, u_int py, u_int ny) sy = grid_view_y(gd, gd->sy); grid_move_lines(gd, py, py + ny, sy - py - ny); - grid_clear(gd, 0, sy - ny, gd->sx, py + ny - (sy - ny)); + grid_clear(gd, 0, sy - ny, gd->sx, py + ny - (sy - ny)); } /* Delete lines inside scroll region. */ @@ -182,7 +182,7 @@ grid_view_delete_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny) ny2 = rlower + 1 - py - ny; grid_move_lines(gd, py, py + ny, ny2); - grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2); + grid_clear(gd, 0, py + ny2, gd->sx, ny - ny2); } /* Insert characters. */ diff --git a/grid.c b/grid.c index 53b29e39..be6e4d58 100644 --- a/grid.c +++ b/grid.c @@ -1,4 +1,4 @@ -/* $Id: grid.c,v 1.35 2009-11-19 22:23:27 tcunha Exp $ */ +/* $Id: grid.c,v 1.36 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -170,7 +170,7 @@ grid_collect_history(struct grid *gd) { u_int yy; - GRID_DEBUG(gd, ""); + GRID_DEBUG(gd, ""); if (gd->hsize < gd->hlimit) return; @@ -183,7 +183,7 @@ grid_collect_history(struct grid *gd) gd->hsize -= yy; } -/* +/* * Scroll the entire visible screen, moving one line into the history. Just * allocate a new line at the bottom and move the history size indicator. */ @@ -192,12 +192,12 @@ grid_scroll_history(struct grid *gd) { u_int yy; - GRID_DEBUG(gd, ""); + GRID_DEBUG(gd, ""); yy = gd->hsize + gd->sy; gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata); memset(&gd->linedata[yy], 0, sizeof gd->linedata[yy]); - + gd->hsize++; } @@ -208,7 +208,7 @@ grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower) struct grid_line *gl_history, *gl_upper, *gl_lower; u_int yy; - GRID_DEBUG(gd, "upper=%u, lower=%u", upper, lower); + GRID_DEBUG(gd, "upper=%u, lower=%u", upper, lower); /* Create a space for a new line. */ yy = gd->hsize + gd->sy; @@ -354,7 +354,7 @@ grid_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny) { u_int xx, yy; - GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny); + GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny); if (nx == 0 || ny == 0) return; @@ -395,7 +395,7 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny) struct grid_line *gl; u_int yy; - GRID_DEBUG(gd, "py=%u, ny=%u", py, ny); + GRID_DEBUG(gd, "py=%u, ny=%u", py, ny); if (ny == 0) return; @@ -421,7 +421,7 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny) { u_int yy; - GRID_DEBUG(gd, "dy=%u, py=%u, ny=%u", dy, py, ny); + GRID_DEBUG(gd, "dy=%u, py=%u, ny=%u", dy, py, ny); if (ny == 0 || py == dy) return; @@ -460,7 +460,7 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx) struct grid_line *gl; u_int xx; - GRID_DEBUG(gd, "dx=%u, px=%u, py=%u, nx=%u", dx, px, py, nx); + GRID_DEBUG(gd, "dx=%u, px=%u, py=%u, nx=%u", dx, px, py, nx); if (nx == 0 || px == dx) return; @@ -499,8 +499,8 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx) char * grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx) { - const struct grid_cell *gc; - const struct grid_utf8 *gu; + const struct grid_cell *gc; + const struct grid_utf8 *gu; char *buf; size_t len, off, size; u_int xx; @@ -535,14 +535,14 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx) buf[off++] = gc->data; } } - + while (off > 0 && buf[off - 1] == ' ') off--; buf[off] = '\0'; return (buf); } -/* +/* * Duplicate a set of lines between two grids. If there aren't enough lines in * either source or destination, the number of lines is limited to the number * available. diff --git a/input-keys.c b/input-keys.c index 84f71b71..27bb3778 100644 --- a/input-keys.c +++ b/input-keys.c @@ -1,4 +1,4 @@ -/* $Id: input-keys.c,v 1.43 2009-11-28 14:41:17 tcunha Exp $ */ +/* $Id: input-keys.c,v 1.44 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -81,7 +81,7 @@ struct input_key_ent input_keys[] = { { KEYC_DOWN|KEYC_CTRL, "\033[B", INPUTKEY_CURSOR }, { KEYC_RIGHT|KEYC_CTRL, "\033[C", INPUTKEY_CURSOR }, { KEYC_LEFT|KEYC_CTRL, "\033[D", INPUTKEY_CURSOR }, - + { KEYC_UP, "\033OA", INPUTKEY_CURSOR }, { KEYC_DOWN, "\033OB", INPUTKEY_CURSOR }, { KEYC_RIGHT, "\033OC", INPUTKEY_CURSOR }, @@ -122,7 +122,7 @@ struct input_key_ent input_keys[] = { { KEYC_KP_EIGHT, "8", 0 }, { KEYC_KP_NINE, "9", 0 }, { KEYC_KP_PLUS, "+", 0 }, - { KEYC_KP_FOUR, "4", 0 }, + { KEYC_KP_FOUR, "4", 0 }, { KEYC_KP_FIVE, "5", 0 }, { KEYC_KP_SIX, "6", 0 }, { KEYC_KP_ONE, "1", 0 }, @@ -157,7 +157,7 @@ input_key(struct window_pane *wp, int key) return; } - /* + /* * Then try to look this up as an xterm key, if the flag to output them * is set. */ diff --git a/input.c b/input.c index d356f721..71e0ba34 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.103 2009-11-28 14:59:26 tcunha Exp $ */ +/* $Id: input.c,v 1.104 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -230,7 +230,7 @@ input_init(struct window_pane *wp) ictx->string_len = 0; ictx->string_buf = NULL; - memcpy(&ictx->cell, &grid_default_cell, sizeof ictx->cell); + memcpy(&ictx->cell, &grid_default_cell, sizeof ictx->cell); memcpy(&ictx->saved_cell, &grid_default_cell, sizeof ictx->saved_cell); ictx->saved_cx = 0; @@ -297,7 +297,7 @@ input_state_first(u_char ch, struct input_ctx *ictx) } #if 0 - if (INPUT_C1CONTROL(ch)) { + if (INPUT_C1CONTROL(ch)) { ch -= 0x40; if (ch == '[') input_state(ictx, input_state_sequence_first); @@ -591,7 +591,7 @@ input_handle_character(u_char ch, struct input_ctx *ictx) if (ch > 0x7f && options_get_number(&wp->window->options, "utf8")) { if (utf8_open(&ictx->utf8data, ch)) { - log_debug2("-- utf8 size %zu: %zu: %hhu (%c)", + log_debug2("-- utf8 size %zu: %zu: %hhu (%c)", ictx->utf8data.size, ictx->off, ch, ch); input_state(ictx, input_state_utf8); return; @@ -945,7 +945,7 @@ input_handle_sequence_da(struct input_ctx *ictx) return; if (n != 0) return; - + bufferevent_write(wp->event, "\033[?1;2c", (sizeof "\033[?1;2c") - 1); } @@ -1164,7 +1164,7 @@ input_handle_sequence_sm(struct input_ctx *ictx) log_debug("kcursor on"); break; case 3: /* DECCOLM */ - screen_write_cursormove(&ictx->ctx, 0, 0); + screen_write_cursormove(&ictx->ctx, 0, 0); screen_write_clearscreen(&ictx->ctx); break; case 25: /* TCEM */ @@ -1240,7 +1240,7 @@ input_handle_sequence_rm(struct input_ctx *ictx) log_debug("kcursor off"); break; case 3: /* DECCOLM */ - screen_write_cursormove(&ictx->ctx, 0, 0); + screen_write_cursormove(&ictx->ctx, 0, 0); screen_write_clearscreen(&ictx->ctx); break; case 25: /* TCEM */ @@ -1257,7 +1257,7 @@ input_handle_sequence_rm(struct input_ctx *ictx) sx = screen_size_x(s); sy = screen_size_y(s); - /* + /* * Exit alternative screen mode and restore the copied * grid. */ @@ -1284,7 +1284,7 @@ input_handle_sequence_rm(struct input_ctx *ictx) * Turn history back on (so resize can use it) and then * resize back to the current size. */ - wp->base.grid->flags |= GRID_HISTORY; + wp->base.grid->flags |= GRID_HISTORY; if (sy > wp->saved_grid->sy) screen_resize(s, sx, sy); @@ -1372,7 +1372,7 @@ input_handle_sequence_sgr(struct input_ctx *ictx) if (ARRAY_LENGTH(&ictx->args) == 0) { attr = gc->attr; memcpy(gc, &grid_default_cell, sizeof *gc); - gc->attr |= (attr & GRID_ATTR_CHARSET); + gc->attr |= (attr & GRID_ATTR_CHARSET); return; } diff --git a/job.c b/job.c index 30bcb4df..b2fc9350 100644 --- a/job.c +++ b/job.c @@ -1,4 +1,4 @@ -/* $Id: job.c,v 1.13 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: job.c,v 1.14 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -79,7 +79,7 @@ job_add(struct jobs *jobs, int flags, struct client *c, const char *cmd, void (*callbackfn)(struct job *), void (*freefn)(void *), void *data) { struct job *job; - + job = xmalloc(sizeof *job); job->cmd = xstrdup(cmd); job->pid = -1; @@ -182,7 +182,7 @@ job_run(struct job *job) if (job->event != NULL) bufferevent_free(job->event); - job->event = + job->event = bufferevent_new(job->fd, NULL, NULL, job_callback, job); bufferevent_enable(job->event, EV_READ); @@ -215,7 +215,7 @@ job_died(struct job *job, int status) { job->status = status; job->pid = -1; - + if (job->fd == -1) { if (job->callbackfn != NULL) job->callbackfn(job); diff --git a/key-bindings.c b/key-bindings.c index eb36f5b4..1b9c0650 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -1,4 +1,4 @@ -/* $Id: key-bindings.c,v 1.85 2009-11-19 22:20:04 tcunha Exp $ */ +/* $Id: key-bindings.c,v 1.86 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -61,11 +61,11 @@ key_bindings_add(int key, int can_repeat, struct cmd_list *cmdlist) struct key_binding *bd; key_bindings_remove(key); - + bd = xmalloc(sizeof *bd); bd->key = key; SPLAY_INSERT(key_bindings, &key_bindings, bd); - + bd->can_repeat = can_repeat; bd->cmdlist = cmdlist; } @@ -104,9 +104,9 @@ key_bindings_init(void) } table[] = { { ' ', 0, &cmd_next_layout_entry }, { '!', 0, &cmd_break_pane_entry }, - { '"', 0, &cmd_split_window_entry }, + { '"', 0, &cmd_split_window_entry }, { '#', 0, &cmd_list_buffers_entry }, - { '%', 0, &cmd_split_window_entry }, + { '%', 0, &cmd_split_window_entry }, { '&', 0, &cmd_confirm_before_entry }, { ',', 0, &cmd_command_prompt_entry }, { '-', 0, &cmd_delete_buffer_entry }, @@ -162,7 +162,7 @@ key_bindings_init(void) { KEYC_LEFT | KEYC_ESCAPE, 1, &cmd_resize_pane_entry }, { KEYC_RIGHT | KEYC_ESCAPE, 1, &cmd_resize_pane_entry }, { KEYC_UP | KEYC_CTRL, 1, &cmd_resize_pane_entry }, - { KEYC_DOWN | KEYC_CTRL, 1, &cmd_resize_pane_entry }, + { KEYC_DOWN | KEYC_CTRL, 1, &cmd_resize_pane_entry }, { KEYC_LEFT | KEYC_CTRL, 1, &cmd_resize_pane_entry }, { KEYC_RIGHT | KEYC_CTRL, 1, &cmd_resize_pane_entry }, }; @@ -199,7 +199,7 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...) va_end(ap); *msg = toupper((u_char) *msg); - status_message_set(ctx->curclient, "%s", msg); + status_message_set(ctx->curclient, "%s", msg); xfree(msg); } @@ -232,7 +232,7 @@ key_bindings_info(struct cmd_ctx *ctx, const char *fmt, ...) va_end(ap); *msg = toupper((u_char) *msg); - status_message_set(ctx->curclient, "%s", msg); + status_message_set(ctx->curclient, "%s", msg); xfree(msg); } diff --git a/key-string.c b/key-string.c index b94f3a39..4ee1d509 100644 --- a/key-string.c +++ b/key-string.c @@ -1,4 +1,4 @@ -/* $Id: key-string.c,v 1.27 2009-11-28 14:57:04 tcunha Exp $ */ +/* $Id: key-string.c,v 1.28 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -136,7 +136,7 @@ key_string_lookup_string(const char *string) key = (u_char) ptr[0]; } - /* + /* * Figure out if the single character in key is a valid ctrl * key. */ @@ -150,7 +150,7 @@ key_string_lookup_string(const char *string) return (key - 96); return (KEYC_NONE); } - + if ((string[0] == 'M' || string[0] == 'm') && string[1] == '-') { ptr = string + 2; if (ptr[0] == '\0') diff --git a/layout-set.c b/layout-set.c index 7a1bff84..96231fb4 100644 --- a/layout-set.c +++ b/layout-set.c @@ -1,4 +1,4 @@ -/* $Id: layout-set.c,v 1.3 2009-07-28 23:04:29 tcunha Exp $ */ +/* $Id: layout-set.c,v 1.4 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -295,7 +295,7 @@ layout_set_main_h(struct window *w) continue; } - /* Add in the columns. */ + /* Add in the columns. */ layout_make_node(lcrow, LAYOUT_LEFTRIGHT); for (i = 0; i < columns; i++) { /* Create and add a pane cell. */ @@ -312,11 +312,11 @@ layout_set_main_h(struct window *w) /* Adjust the row to fit the full width if necessary. */ if (i == columns) i--; - used = ((i + 1) * width) - 1; - if (w->sx <= used) - continue; - lcchild = TAILQ_LAST(&lcrow->cells, layout_cells); - layout_resize_adjust(lcchild, LAYOUT_LEFTRIGHT, w->sx - used); + used = ((i + 1) * width) - 1; + if (w->sx <= used) + continue; + lcchild = TAILQ_LAST(&lcrow->cells, layout_cells); + layout_resize_adjust(lcchild, LAYOUT_LEFTRIGHT, w->sx - used); } /* Adjust the last row height to fit if necessary. */ @@ -422,10 +422,10 @@ layout_set_main_v(struct window *w) if (i == rows) i--; used = ((i + 1) * height) - 1; - if (w->sy <= used) - continue; - lcchild = TAILQ_LAST(&lccolumn->cells, layout_cells); - layout_resize_adjust(lcchild, LAYOUT_TOPBOTTOM, w->sy - used); + if (w->sy <= used) + continue; + lcchild = TAILQ_LAST(&lccolumn->cells, layout_cells); + layout_resize_adjust(lcchild, LAYOUT_TOPBOTTOM, w->sy - used); } /* Adjust the last column width to fit if necessary. */ diff --git a/layout.c b/layout.c index 92953d03..e9f94077 100644 --- a/layout.c +++ b/layout.c @@ -1,4 +1,4 @@ -/* $Id: layout.c,v 1.16 2009-07-20 15:42:05 tcunha Exp $ */ +/* $Id: layout.c,v 1.17 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -45,13 +45,13 @@ layout_create_cell(struct layout_cell *lcparent) lc->parent = lcparent; TAILQ_INIT(&lc->cells); - + lc->sx = UINT_MAX; lc->sy = UINT_MAX; - + lc->xoff = UINT_MAX; lc->yoff = UINT_MAX; - + lc->wp = NULL; return (lc); @@ -201,8 +201,8 @@ layout_fix_panes(struct window *w, u_int wsx, u_int wsy) if (sx < 1) sx = lc->sx; } - - /* + + /* * Similarly for the vertical size; the minimum vertical size * is two because scroll regions cannot be one line. */ @@ -231,7 +231,7 @@ layout_resize_check(struct layout_cell *lc, enum layout_type type) available = lc->sx; else available = lc->sy; - + if (available > PANE_MINIMUM) available -= PANE_MINIMUM; else @@ -269,7 +269,7 @@ layout_resize_adjust(struct layout_cell *lc, enum layout_type type, int change) lc->sx += change; else lc->sy += change; - + /* If this is a leaf cell, that is all that is necessary. */ if (type == LAYOUT_WINDOWPANE) return; @@ -281,8 +281,8 @@ layout_resize_adjust(struct layout_cell *lc, enum layout_type type, int change) return; } - /* - * Child cell runs in the same direction. Adjust each child equally + /* + * Child cell runs in the same direction. Adjust each child equally * until no further change is possible. */ while (change != 0) { @@ -327,10 +327,10 @@ layout_resize(struct window *w, u_int sx, u_int sy) struct layout_cell *lc = w->layout_root; int xlimit, ylimit, xchange, ychange; - /* + /* * Adjust horizontally. Do not attempt to reduce the layout lower than * the minimum (more than the amount returned by layout_resize_check). - * + * * This can mean that the window size is smaller than the total layout * size: redrawing this is handled at a higher level, but it does leave * a problem with growing the window size here: if the current size is @@ -366,7 +366,7 @@ layout_resize(struct window *w, u_int sx, u_int sy) } if (ychange != 0) layout_resize_adjust(lc, LAYOUT_TOPBOTTOM, ychange); - + /* Fix cell offsets. */ layout_fix_offsets(lc); layout_fix_panes(w, sx, sy); @@ -408,7 +408,7 @@ layout_resize_pane(struct window_pane *wp, enum layout_type type, int change) if (size == 0) /* no more change possible */ break; } - + /* Fix cell offsets. */ layout_fix_offsets(wp->window->layout_root); layout_fix_panes(wp->window, wp->window->sx, wp->window->sy); @@ -423,14 +423,14 @@ layout_resize_pane_grow( /* Growing. Always add to the current cell. */ lcadd = lc; - + /* Look towards the tail for a suitable cell for reduction. */ lcremove = TAILQ_NEXT(lc, entry); while (lcremove != NULL) { size = layout_resize_check(lcremove, type); if (size > 0) break; - lcremove = TAILQ_NEXT(lcremove, entry); + lcremove = TAILQ_NEXT(lcremove, entry); } /* If none found, look towards the head. */ @@ -514,7 +514,7 @@ layout_split_pane(struct window_pane *wp, default: fatalx("bad layout type"); } - + if (lc->parent != NULL && lc->parent->type == type) { /* * If the parent exists and is of the same type as the split, @@ -528,7 +528,7 @@ layout_split_pane(struct window_pane *wp, /* * Otherwise create a new parent and insert it. */ - + /* Create and insert the replacement parent. */ lcparent = layout_create_cell(lc->parent); layout_make_node(lcparent, type); @@ -537,11 +537,11 @@ layout_split_pane(struct window_pane *wp, wp->window->layout_root = lcparent; else TAILQ_REPLACE(&lc->parent->cells, lc, lcparent, entry); - + /* Insert the old cell. */ lc->parent = lcparent; TAILQ_INSERT_HEAD(&lcparent->cells, lc, entry); - + /* Create the new child cell. */ lcnew = layout_create_cell(lcparent); TAILQ_INSERT_TAIL(&lcparent->cells, lcnew, entry); @@ -554,7 +554,7 @@ layout_split_pane(struct window_pane *wp, case LAYOUT_LEFTRIGHT: if (size < 0) size2 = ((sx + 1) / 2) - 1; - else + else size2 = size; if (size2 < PANE_MINIMUM) size2 = PANE_MINIMUM; @@ -600,7 +600,7 @@ layout_close_pane(struct window_pane *wp) lc = wp->layout_cell; lcparent = lc->parent; - /* + /* * If no parent, this is the last pane so window close is imminent and * there is no need to resize anything. */ @@ -623,8 +623,8 @@ layout_close_pane(struct window_pane *wp) /* Remove this from the parent's list. */ TAILQ_REMOVE(&lcparent->cells, lc, entry); layout_free_cell(lc); - - /* + + /* * If the parent now has one cell, remove the parent from the tree and * replace it by that cell. */ diff --git a/log.c b/log.c index 823d00e6..78f525ba 100644 --- a/log.c +++ b/log.c @@ -1,4 +1,4 @@ -/* $Id: log.c,v 1.16 2009-07-22 17:31:20 tcunha Exp $ */ +/* $Id: log.c,v 1.17 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -183,7 +183,7 @@ log_vfatal(const char *msg, va_list ap) log_vwrite(LOG_CRIT, fmt, ap); } else { if (asprintf(&fmt, "fatal: %s", msg) == -1) - exit(1); + exit(1); log_vwrite(LOG_CRIT, fmt, ap); } free(fmt); diff --git a/mode-key.c b/mode-key.c index 244137d0..73da4502 100644 --- a/mode-key.c +++ b/mode-key.c @@ -1,4 +1,4 @@ -/* $Id: mode-key.c,v 1.35 2009-11-13 16:58:24 tcunha Exp $ */ +/* $Id: mode-key.c,v 1.36 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -42,7 +42,7 @@ /* Edit keys command strings. */ struct mode_key_cmdstr mode_key_cmdstr_edit[] = { { MODEKEYEDIT_BACKSPACE, "backspace" }, - { MODEKEYEDIT_CANCEL, "cancel" }, + { MODEKEYEDIT_CANCEL, "cancel" }, { MODEKEYEDIT_COMPLETE, "complete" }, { MODEKEYEDIT_CURSORLEFT, "cursor-left" }, { MODEKEYEDIT_CURSORRIGHT, "cursor-right" }, @@ -61,7 +61,7 @@ struct mode_key_cmdstr mode_key_cmdstr_edit[] = { { 0, NULL } }; - + /* Choice keys command strings. */ struct mode_key_cmdstr mode_key_cmdstr_choice[] = { { MODEKEYCHOICE_CANCEL, "cancel" }, @@ -195,14 +195,14 @@ const struct mode_key_entry mode_key_vi_copy[] = { { KEYC_RIGHT, 0, MODEKEYCOPY_RIGHT }, { KEYC_UP | KEYC_CTRL, 0, MODEKEYCOPY_SCROLLUP }, { KEYC_UP, 0, MODEKEYCOPY_UP }, - + { 0, -1, 0 } }; struct mode_key_tree mode_key_tree_vi_copy; /* emacs editing keys. */ const struct mode_key_entry mode_key_emacs_edit[] = { - { '\001' /* C-a */, 0, MODEKEYEDIT_STARTOFLINE }, + { '\001' /* C-a */, 0, MODEKEYEDIT_STARTOFLINE }, { '\002' /* C-b */, 0, MODEKEYEDIT_CURSORLEFT }, { '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL }, { '\004' /* C-d */, 0, MODEKEYEDIT_DELETE }, @@ -218,7 +218,7 @@ const struct mode_key_entry mode_key_emacs_edit[] = { { '\031' /* C-y */, 0, MODEKEYEDIT_PASTE }, { '\033' /* Escape */, 0, MODEKEYEDIT_CANCEL }, { '\r', 0, MODEKEYEDIT_ENTER }, - { 'm' | KEYC_ESCAPE, 0, MODEKEYEDIT_STARTOFLINE }, + { 'm' | KEYC_ESCAPE, 0, MODEKEYEDIT_STARTOFLINE }, { KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE }, { KEYC_DC, 0, MODEKEYEDIT_DELETE }, { KEYC_DOWN, 0, MODEKEYEDIT_HISTORYDOWN }, @@ -287,7 +287,7 @@ const struct mode_key_entry mode_key_emacs_copy[] = { { KEYC_UP | KEYC_ESCAPE, 0, MODEKEYCOPY_HALFPAGEUP }, { KEYC_UP, 0, MODEKEYCOPY_UP }, - { 0, -1, 0 } + { 0, -1, 0 } }; struct mode_key_tree mode_key_tree_emacs_copy; @@ -343,7 +343,7 @@ const struct mode_key_table * mode_key_findtable(const char *name) { const struct mode_key_table *mtab; - + for (mtab = mode_key_tables; mtab->name != NULL; mtab++) { if (strcasecmp(name, mtab->name) == 0) return (mtab); diff --git a/names.c b/names.c index 002dfef6..d4d128c9 100644 --- a/names.c +++ b/names.c @@ -1,4 +1,4 @@ -/* $Id: names.c,v 1.20 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: names.c,v 1.21 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -59,7 +59,7 @@ window_name_callback(unused int fd, unused short events, void *data) if (name == NULL) wname = default_window_name(w); else { - /* + /* * If tmux is using the default command, it will be a login * shell and argv[0] may have a - prefix. Remove this if it is * present. Ick. @@ -71,13 +71,13 @@ window_name_callback(unused int fd, unused short events, void *data) wname = parse_window_name(name); xfree(name); } - + if (w->active->fd == -1) { xasprintf(&name, "%s[dead]", wname); xfree(wname); wname = name; } - + if (strcmp(wname, w->name) == 0) xfree(wname); else { diff --git a/paste.c b/paste.c index ec9eefb3..2ff4133e 100644 --- a/paste.c +++ b/paste.c @@ -1,4 +1,4 @@ -/* $Id: paste.c,v 1.12 2009-11-28 14:54:12 tcunha Exp $ */ +/* $Id: paste.c,v 1.13 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -106,7 +106,7 @@ paste_free_index(struct paste_stack *ps, u_int idx) return (0); } -/* +/* * Add an item onto the top of the stack, freeing the bottom if at limit. Note * that the caller is responsible for allocating data. */ @@ -133,7 +133,7 @@ paste_add(struct paste_stack *ps, char *data, size_t size, u_int limit) } -/* +/* * Replace an item on the stack. Note that the caller is responsible for * allocating data. */ diff --git a/screen-redraw.c b/screen-redraw.c index 8005dc38..ba694ff8 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1,4 +1,4 @@ -/* $Id: screen-redraw.c,v 1.49 2009-10-28 23:17:28 tcunha Exp $ */ +/* $Id: screen-redraw.c,v 1.50 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -67,7 +67,7 @@ screen_redraw_cell_border(struct client *c, u_int px, u_int py) } /* Top/bottom borders. */ - if ((wp->xoff == 0 || px >= wp->xoff - 1) && + if ((wp->xoff == 0 || px >= wp->xoff - 1) && px <= wp->xoff + wp->sx) { if (wp->yoff != 0 && py == wp->yoff - 1) return (1); @@ -105,7 +105,7 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py) if (!screen_redraw_cell_border(c, px, py)) return (CELL_INSIDE); - /* + /* * Construct a bitmask of whether the cells to the left (bit * 4), right, top, and bottom (bit 1) of this cell are borders. */ @@ -119,7 +119,7 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py) if (py <= w->sy && screen_redraw_cell_border(c, px, py + 1)) borders |= 1; - /* + /* * Figure out what kind of border this cell is. Only one bit * set doesn't make sense (can't have a border cell with no * others connected). @@ -263,7 +263,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) tty_puts(tty, buf); return; } - + px -= len * 3; py -= 2; @@ -275,7 +275,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) if (*ptr < '0' || *ptr > '9') continue; idx = *ptr - '0'; - + for (j = 0; j < 5; j++) { for (i = px; i < px + 5; i++) { tty_cursor(tty, xoff + i, yoff + py + j); diff --git a/screen-write.c b/screen-write.c index b7360059..016127b7 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1,4 +1,4 @@ -/* $Id: screen-write.c,v 1.87 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: screen-write.c,v 1.88 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -183,7 +183,7 @@ screen_write_vnputs(struct screen_write_ctx *ctx, ssize_t maxlen, break; } size += utf8data.width; - + gc->flags |= GRID_FLAG_UTF8; screen_write_cell(ctx, gc, &utf8data); gc->flags &= ~GRID_FLAG_UTF8; @@ -376,7 +376,7 @@ screen_write_copy(struct screen_write_ctx *ctx, bx = gl->cellsize; else bx = px + nx; - + for (xx = ax; xx < bx; xx++) { if (xx >= gl->cellsize) gc = &grid_default_cell; @@ -646,7 +646,7 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny) ny = s->rlower + 1 - s->cy; if (ny == 0) return; - + screen_write_initctx(ctx, &ttyctx, 0); if (s->cy < s->rupper || s->cy > s->rlower) @@ -682,7 +682,7 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny) tty_write(tty_cmd_deleteline, &ttyctx); return; } - + if (ny > s->rlower + 1 - s->cy) ny = s->rlower + 1 - s->cy; if (ny == 0) @@ -728,7 +728,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx) if (s->cx <= sx - 1) grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1); - tty_write(tty_cmd_clearendofline, &ttyctx); + tty_write(tty_cmd_clearendofline, &ttyctx); } /* Clear to start of line from cursor. */ @@ -863,7 +863,7 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped) s->cy++; ttyctx.num = wrapped; - tty_write(tty_cmd_linefeed, &ttyctx); + tty_write(tty_cmd_linefeed, &ttyctx); } /* Carriage return (cursor to start of line). */ @@ -988,7 +988,7 @@ screen_write_cell(struct screen_write_ctx *ctx, /* * If the width is zero, combine onto the previous character, if - * there is space. + * there is space. */ if (width == 0) { if (screen_write_combine(ctx, utf8data) == 0) { diff --git a/screen.c b/screen.c index 1b149a4b..58776548 100644 --- a/screen.c +++ b/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.96 2009-08-09 17:28:23 tcunha Exp $ */ +/* $Id: screen.c,v 1.97 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -50,7 +50,7 @@ screen_reinit(struct screen *s) s->rlower = screen_size_y(s) - 1; s->mode = MODE_CURSOR; - + screen_reset_tabs(s); grid_clear_lines(s->grid, s->grid->hsize, s->grid->sy); @@ -151,12 +151,12 @@ screen_resize_y(struct screen *s, u_int sy) fatalx("zero size"); oldy = screen_size_y(s); - /* + /* * When resizing: * * If the height is decreasing, delete lines from the bottom until * hitting the cursor, then push lines from the top into the history. - * + * * When increasing, pull as many lines as possible from the history to * the top, then fill the remaining with blanks at the bottom. */ @@ -190,7 +190,7 @@ screen_resize_y(struct screen *s, u_int sy) grid_view_delete_lines(gd, 0, available); } s->cy -= needed; - } + } /* Resize line arrays. */ gd->linedata = xrealloc( diff --git a/server-client.c b/server-client.c index 9bde7175..fcfebb35 100644 --- a/server-client.c +++ b/server-client.c @@ -1,4 +1,4 @@ -/* $Id: server-client.c,v 1.25 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: server-client.c,v 1.26 2009-12-04 22:14:47 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -35,7 +35,7 @@ void server_client_reset_state(struct client *); int server_client_m