aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-10-19 22:01:25 +0100
committerThomas Adam <thomas@xteddy.org>2019-10-19 22:01:25 +0100
commit004ee66227dfaaeda99af1da87c854634331ab11 (patch)
treee8b18cab861285fe7b14b6d7d74fc3e058f176b1
parent1b96902d730fe46fc7d4957a3a7e46e08bb1526f (diff)
parent56e5067c462a8c03fd35fbd5833c5fe17c23b0fa (diff)
downloadrtmux-004ee66227dfaaeda99af1da87c854634331ab11.tar.gz
rtmux-004ee66227dfaaeda99af1da87c854634331ab11.tar.bz2
rtmux-004ee66227dfaaeda99af1da87c854634331ab11.zip
Merge branch 'obsd-master'
-rw-r--r--tmux.16
-rw-r--r--window-copy.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/tmux.1 b/tmux.1
index f9d84026..3d2d204d 100644
--- a/tmux.1
+++ b/tmux.1
@@ -4219,6 +4219,8 @@ The following variables are available, where appropriate:
.It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
.It Li "command_list_name" Ta "" Ta "Command name if listing commands"
.It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
+.It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode"
+.It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode"
.It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
.It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
.It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
@@ -4285,7 +4287,11 @@ 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_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"
+.It Li "selection_start_x" Ta "" Ta "X position of the start of the selection"
+.It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection"
.It Li "session_activity" Ta "" Ta "Time of session last activity"
.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
.It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
diff --git a/window-copy.c b/window-copy.c
index 76736ab2..bca236e3 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -565,9 +565,19 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
{
struct window_copy_mode_data *data = wme->data;
- format_add(ft, "selection_present", "%d", data->screen.sel != NULL);
format_add(ft, "scroll_position", "%d", data->oy);
format_add(ft, "rectangle_toggle", "%d", data->rectflag);
+
+ format_add(ft, "copy_cursor_x", "%d", data->cx);
+ format_add(ft, "copy_cursor_y", "%d", data->cy);
+
+ format_add(ft, "selection_present", "%d", data->screen.sel != NULL);
+ if (data->screen.sel != NULL) {
+ format_add(ft, "selection_start_x", "%d", data->selx);
+ 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);
+ }
}
static void