diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-03-12 13:19:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-03-12 13:19:21 +0000 |
commit | 1feff53a1339b64c7ae6c5342071e4e4c35966fa (patch) | |
tree | 564d465ad348e3c4a729a7c9f7888f015362ae97 /usr.bin | |
parent | 2a915ab1976251f0c3c7d57f865ecc655c60b585 (diff) |
Add a copy-mode -H flag to hide the position marker in the top right.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-copy-mode.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 7 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c index 8e9cb0c04be..22dd9bd731d 100644 --- a/usr.bin/tmux/cmd-copy-mode.c +++ b/usr.bin/tmux/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-copy-mode.c,v 1.38 2019/05/07 11:24:03 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.39 2020/03/12 13:19:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -30,8 +30,8 @@ const struct cmd_entry cmd_copy_mode_entry = { .name = "copy-mode", .alias = NULL, - .args = { "Met:u", 0, 0 }, - .usage = "[-Mu] " CMD_TARGET_PANE_USAGE, + .args = { "eHMt:u", 0, 0 }, + .usage = "[-eHMu] " CMD_TARGET_PANE_USAGE, .target = { 't', CMD_FIND_PANE, 0 }, diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 55662693e1e..08d278ad292 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.715 2020/03/12 09:49:43 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.716 2020/03/12 13:19:20 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> .\" @@ -1565,7 +1565,7 @@ The synopsis for the command is: .Bl -tag -width Ds .It Xo Ic copy-mode -.Op Fl Meu +.Op Fl eHMu .Op Fl t Ar target-pane .Xc Enter copy mode. @@ -1575,6 +1575,9 @@ option scrolls one page up. .Fl M begins a mouse drag (only valid if bound to a mouse key binding, see .Sx MOUSE SUPPORT ) . +.Fl H +hides the position indicator in the top right. +.Pp .Fl e specifies that scrolling to the bottom of the history (to the visible screen) should exit copy mode. diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 932256d4130..7560add5f60 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.248 2020/03/11 18:46:42 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.249 2020/03/12 13:19:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -230,6 +230,7 @@ struct window_copy_mode_data { } lineflag; /* line selection mode */ int rectflag; /* in rectangle copy mode? */ int scroll_exit; /* exit on scroll to end? */ + int hide_position; /* hide position marker */ enum { SEL_CHAR, /* select one char at a time */ @@ -345,6 +346,7 @@ window_copy_init(struct window_mode_entry *wme, data->cy = data->backing->cy; data->scroll_exit = args_has(args, 'e'); + data->hide_position = args_has(args, 'H'); data->screen.cx = data->cx; data->screen.cy = data->cy; @@ -2774,7 +2776,7 @@ window_copy_write_line(struct window_mode_entry *wme, style_apply(&gc, oo, "mode-style"); gc.flags |= GRID_FLAG_NOPALETTE; - if (py == 0 && s->rupper < s->rlower) { + if (py == 0 && s->rupper < s->rlower && !data->hide_position) { if (data->searchmark == NULL) { size = xsnprintf(hdr, sizeof hdr, "[%u/%u]", data->oy, screen_hsize(data->backing)); |