From df303770eadd8e3564cdfc26b5df2645d064acc7 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 21 Oct 2024 12:39:49 +0000 Subject: [PATCH 1/2] Add function to get current offset from copy mode, from Michael Grant. --- tmux.h | 2 ++ window-copy.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tmux.h b/tmux.h index 52fb13ad..0e8d600e 100644 --- a/tmux.h +++ b/tmux.h @@ -3245,6 +3245,8 @@ void window_copy_pagedown(struct window_pane *, int, int); void window_copy_start_drag(struct client *, struct mouse_event *); char *window_copy_get_word(struct window_pane *, u_int, u_int); char *window_copy_get_line(struct window_pane *, u_int); +int window_copy_get_current_offset(struct window_pane *, u_int *, + u_int *); /* window-option.c */ extern const struct window_mode window_customize_mode; diff --git a/window-copy.c b/window-copy.c index 7c8436f1..b271d5bb 100644 --- a/window-copy.c +++ b/window-copy.c @@ -4188,6 +4188,23 @@ window_copy_write_one(struct window_mode_entry *wme, } } +int +window_copy_get_current_offset(struct window_pane *wp, u_int *offset, + u_int *size) +{ + struct window_mode_entry *wme = TAILQ_FIRST(&wp->modes); + struct window_copy_mode_data *data = wme->data; + u_int hsize; + + if (data == NULL) + return (0); + hsize = screen_hsize(data->backing); + + *offset = hsize - data->oy; + *size = hsize; + return (1); +} + static void window_copy_write_line(struct window_mode_entry *wme, struct screen_write_ctx *ctx, u_int py) From 354926a956ba07ef38d2ddd91a7820e3c9634ab0 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 21 Oct 2024 12:42:06 +0000 Subject: [PATCH 2/2] Bump up the maximum for repeat-time (some people want it to be effectively infinite). --- options-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options-table.c b/options-table.c index 2ac552a6..014e97f1 100644 --- a/options-table.c +++ b/options-table.c @@ -577,7 +577,7 @@ const struct options_table_entry options_table[] = { .type = OPTIONS_TABLE_NUMBER, .scope = OPTIONS_TABLE_SESSION, .minimum = 0, - .maximum = 10000, + .maximum = 2000000, .default_num = 0, .unit = "milliseconds", .text = "Time to wait for a key binding to repeat the first time the " @@ -672,7 +672,7 @@ const struct options_table_entry options_table[] = { .type = OPTIONS_TABLE_NUMBER, .scope = OPTIONS_TABLE_SESSION, .minimum = 0, - .maximum = 10000, + .maximum = 2000000, .default_num = 500, .unit = "milliseconds", .text = "Time to wait for a key binding to repeat, if it is bound "