diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-29 22:04:07 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-06-29 22:04:07 +0000 |
commit | 503c6a33770358ec94f99fe71a99a993c56f8563 (patch) | |
tree | 0661147c0236672d0c19f6b26e1dbc3efac11546 /cmd-copy-mode.c | |
parent | 18ebc99906eef717ee93005e6b4fc482cf7cb4a2 (diff) | |
download | rtmux-503c6a33770358ec94f99fe71a99a993c56f8563.tar.gz rtmux-503c6a33770358ec94f99fe71a99a993c56f8563.tar.bz2 rtmux-503c6a33770358ec94f99fe71a99a993c56f8563.zip |
Don't try to page up with scroll-mode -u or copy-mode -u unless the mode was
successfully changed - if already in a different mode, it would corrupt the
mode data.
Diffstat (limited to 'cmd-copy-mode.c')
-rw-r--r-- | cmd-copy-mode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c index b5642a45..bba05e3a 100644 --- a/cmd-copy-mode.c +++ b/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $Id: cmd-copy-mode.c,v 1.16 2009-02-25 21:56:46 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.2 2009/06/29 07:11:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -44,13 +44,15 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_target_data *data = self->data; struct winlink *wl; + struct window_pane *wp; if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); + wp = wl->window->active; - window_pane_set_mode(wl->window->active, &window_copy_mode); - if (data->flags & CMD_UFLAG) - window_copy_pageup(wl->window->active); + window_pane_set_mode(wp, &window_copy_mode); + if (wp->mode == &window_copy_mode && data->flags & CMD_UFLAG) + window_copy_pageup(wp); return (0); } |