-/* $OpenBSD: tmux.h,v 1.1234 2024/10/07 08:50:47 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1235 2024/10/21 12:39:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
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;
-/* $OpenBSD: window-copy.c,v 1.357 2024/10/05 00:35:35 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.358 2024/10/21 12:39:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
}
}
+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)