summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
-rw-r--r--usr.bin/tmux/window-copy.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 2e8e6f56945..a18347b2e23 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.205 2018/12/18 13:20:44 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.206 2019/03/07 19:01:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -31,10 +31,11 @@ static void window_copy_command(struct window_pane *, struct client *,
static struct screen *window_copy_init(struct window_pane *,
struct cmd_find_state *, struct args *);
static void window_copy_free(struct window_pane *);
+static void window_copy_resize(struct window_pane *, u_int, u_int);
+static void window_copy_formats(struct window_pane *, struct format_tree *);
static int window_copy_pagedown(struct window_pane *, int, int);
static void window_copy_next_paragraph(struct window_pane *);
static void window_copy_previous_paragraph(struct window_pane *);
-static void window_copy_resize(struct window_pane *, u_int, u_int);
static void window_copy_redraw_selection(struct window_pane *, u_int);
static void window_copy_redraw_lines(struct window_pane *, u_int, u_int);
@@ -113,6 +114,7 @@ const struct window_mode window_copy_mode = {
.resize = window_copy_resize,
.key_table = window_copy_key_table,
.command = window_copy_command,
+ .formats = window_copy_formats,
};
enum {
@@ -473,6 +475,16 @@ window_copy_next_paragraph(struct window_pane *wp)
}
static void
+window_copy_formats(struct window_pane *wp, struct format_tree *ft)
+{
+ struct window_copy_mode_data *data = wp->modedata;
+
+ 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);
+}
+
+static void
window_copy_resize(struct window_pane *wp, u_int sx, u_int sy)
{
struct window_copy_mode_data *data = wp->modedata;
@@ -2447,19 +2459,6 @@ window_copy_scroll_down(struct window_pane *wp, u_int ny)
screen_write_stop(&ctx);
}
-void
-window_copy_add_formats(struct window_pane *wp, struct format_tree *ft)
-{
- struct window_copy_mode_data *data = wp->modedata;
-
- if (wp->mode != &window_copy_mode)
- return;
-
- 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);
-}
-
static void
window_copy_rectangle_toggle(struct window_pane *wp)
{