aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-02-20 10:01:29 +0000
committerThomas Adam <thomas@xteddy.org>2020-02-20 10:01:29 +0000
commit4694afbed4f002a74354de518ba8daa9ae3b6fa6 (patch)
tree979724cf1a30f42d982c03b93d2359daf2bb34e5
parentba542e42b7a62ee4b205550d5da7fdfcd77fefa7 (diff)
parent229be034fb561ae32405f33797fc5a2b7f0c1b0c (diff)
downloadrtmux-4694afbed4f002a74354de518ba8daa9ae3b6fa6.tar.gz
rtmux-4694afbed4f002a74354de518ba8daa9ae3b6fa6.tar.bz2
rtmux-4694afbed4f002a74354de518ba8daa9ae3b6fa6.zip
Merge branch 'obsd-master'
-rw-r--r--tmux.11
-rw-r--r--window-copy.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/tmux.1 b/tmux.1
index 5bf5b1e7..dc78abdc 100644
--- a/tmux.1
+++ b/tmux.1
@@ -4351,6 +4351,7 @@ The following variables are available, where appropriate:
.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
+.It Li "selection_active" Ta "" Ta "1 if selection started and changes with the cursor in copy mode"
.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
diff --git a/window-copy.c b/window-copy.c
index a717884c..301fc16e 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -590,7 +590,10 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
format_add(ft, "selection_start_y", "%d", data->sely);
format_add(ft, "selection_end_x", "%d", data->endselx);
format_add(ft, "selection_end_y", "%d", data->endsely);
- }
+ format_add(ft, "selection_active", "%d",
+ data->cursordrag != CURSORDRAG_NONE);
+ } else
+ format_add(ft, "selection_active", "%d", 0);
s = format_grid_word(data->screen.grid, data->cx, data->cy);
if (s != NULL) {