diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-15 19:06:50 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-15 19:06:50 +0000 |
commit | 78cdabc160e265f0fe16767dcaa9024b783c9043 (patch) | |
tree | 4fd4070681ed03a9384bd630ca19dcf415a84b9c /usr.bin | |
parent | cbad81e5f94eb8475c2e9ec8815ee1188ff59ac1 (diff) |
Clear the selection and repeat the search on refresh same as resize.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/window-copy.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 0190ac35a0f..087e7621797 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.274 2020/04/15 17:50:02 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.275 2020/04/15 19:06:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -693,24 +693,13 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft) } static void -window_copy_resize(struct window_mode_entry *wme, u_int sx, u_int sy) +window_copy_size_changed(struct window_mode_entry *wme) { struct window_copy_mode_data *data = wme->data; struct screen *s = &data->screen; - struct screen_write_ctx ctx; - int search; - - screen_resize(s, sx, sy, 0); - screen_resize_cursor(data->backing, sx, sy, 1, 0, NULL, NULL); - - if (data->cy > sy - 1) - data->cy = sy - 1; - if (data->cx > sx) - data->cx = sx; - if (data->oy > screen_hsize(data->backing)) - data->oy = screen_hsize(data->backing); + struct screen_write_ctx ctx; + int search = (data->searchmark != NULL); - search = (data->searchmark != NULL); window_copy_clear_selection(wme); window_copy_clear_marks(wme); @@ -723,7 +712,25 @@ window_copy_resize(struct window_mode_entry *wme, u_int sx, u_int sy) data->searchx = data->cx; data->searchy = data->cy; data->searcho = data->oy; +} + +static void +window_copy_resize(struct window_mode_entry *wme, u_int sx, u_int sy) +{ + struct window_copy_mode_data *data = wme->data; + struct screen *s = &data->screen; + + screen_resize(s, sx, sy, 0); + screen_resize_cursor(data->backing, sx, sy, 1, 0, NULL, NULL); + + if (data->cy > sy - 1) + data->cy = sy - 1; + if (data->cx > sx) + data->cx = sx; + if (data->oy > screen_hsize(data->backing)) + data->oy = screen_hsize(data->backing); + window_copy_size_changed(wme); window_copy_redraw_screen(wme); } @@ -2030,6 +2037,7 @@ window_copy_cmd_refresh_from_pane(struct window_copy_cmd_state *cs) data->backing = window_copy_clone_screen(&wp->base, &data->screen, NULL, NULL); + window_copy_size_changed(wme); return (WINDOW_COPY_CMD_REDRAW); } |