aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-10 07:44:26 +0000
committernicm <nicm>2020-04-10 07:44:26 +0000
commitc0602f357d7b48ab830f93b446cb1830c5df7a0f (patch)
tree11b8275c72d23606de28e5104e5d78d0a51fcd0e /window.c
parenta1fc8f8b23bf6371877ff93e123b735d2c7d596d (diff)
downloadrtmux-c0602f357d7b48ab830f93b446cb1830c5df7a0f.tar.gz
rtmux-c0602f357d7b48ab830f93b446cb1830c5df7a0f.tar.bz2
rtmux-c0602f357d7b48ab830f93b446cb1830c5df7a0f.zip
Now that copy mode copies the pane content rather than keeping a
reference to it, it isn't necessary that the pane in copy mode is the same as the one copying from. Add a -s flag to copy-mode to specify a different pane for the source content. This means it is possible to view two places in a pane's history at the same time in different panes, or copy from a pane's history into an editor or shell in the same pane. From Anindya Mukherjee.
Diffstat (limited to 'window.c')
-rw-r--r--window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/window.c b/window.c
index 2169ede2..38e31810 100644
--- a/window.c
+++ b/window.c
@@ -1067,8 +1067,9 @@ window_pane_get_palette(struct window_pane *wp, int c)
}
int
-window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
- struct cmd_find_state *fs, struct args *args)
+window_pane_set_mode(struct window_pane *wp, struct window_pane *swp,
+ const struct window_mode *mode, struct cmd_find_state *fs,
+ struct args *args)
{
struct window_mode_entry *wme;
@@ -1085,6 +1086,7 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
} else {
wme = xcalloc(1, sizeof *wme);
wme->wp = wp;
+ wme->swp = swp;
wme->mode = mode;
wme->prefix = 1;
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);