Merge branch 'obsd-master'

pull/1450/head
Thomas Adam 2018-08-20 17:02:39 +01:00
commit 098967a085
4 changed files with 20 additions and 14 deletions

View File

@ -32,8 +32,8 @@ const struct cmd_entry cmd_find_window_entry = {
.name = "find-window",
.alias = "findw",
.args = { "CNt:T", 1, 1 },
.usage = "[-CNT] " CMD_TARGET_PANE_USAGE " match-string",
.args = { "CNt:TZ", 1, 1 },
.usage = "[-CNTZ] " CMD_TARGET_PANE_USAGE " match-string",
.target = { 't', CMD_FIND_PANE, 0 },
@ -83,6 +83,8 @@ cmd_find_window_exec(struct cmd *self, struct cmdq_item *item)
xasprintf(&filter, "#{m:*%s*,#{pane_title}}", s);
new_args = args_parse("", 1, &argv);
if (args_has(args, 'Z'))
args_set(new_args, 'Z', NULL);
args_set(new_args, 'f', filter);
window_pane_set_mode(wp, &window_tree_mode, &item->target, new_args);

View File

@ -228,7 +228,7 @@ key_bindings_init(void)
"bind ] paste-buffer",
"bind c new-window",
"bind d detach-client",
"bind f command-prompt \"find-window -- '%%'\"",
"bind f command-prompt \"find-window -Z -- '%%'\"",
"bind i display-message",
"bind l last-window",
"bind m select-pane -m",

4
tmux.1
View File

@ -1553,7 +1553,7 @@ The default
.Ar template
is "select-pane -t '%%'".
.It Xo Ic find-window
.Op Fl CNT
.Op Fl CNTZ
.Op Fl t Ar target-pane
.Ar match-string
.Xc
@ -1572,6 +1572,8 @@ matches only the window name and
matches only the window title.
The default is
.Fl CNT .
.Fl Z
zooms the pane.
.Pp
This command works only if at least one client is attached.
.It Xo Ic join-pane

View File

@ -353,9 +353,6 @@ window_copy_pageup(struct window_pane *wp, int half_page)
oy = screen_hsize(data->backing) + data->cy - data->oy;
ox = window_copy_find_length(wp, oy);
if (data->lineflag == LINE_SEL_LEFT_RIGHT && oy == data->sely)
window_copy_other_end(wp);
if (data->cx != ox) {
data->lastcx = data->cx;
data->lastsx = ox;
@ -370,9 +367,13 @@ window_copy_pageup(struct window_pane *wp, int half_page)
n = screen_size_y(s) - 2;
}
if (data->oy + n > screen_hsize(data->backing))
if (data->oy + n > screen_hsize(data->backing)) {
data->oy = screen_hsize(data->backing);
else
if (data->cy < n)
data->cy = 0;
else
data->cy -= n;
} else
data->oy += n;
if (data->screen.sel == NULL || !data->rectflag) {
@ -397,9 +398,6 @@ window_copy_pagedown(struct window_pane *wp, int half_page, int scroll_exit)
oy = screen_hsize(data->backing) + data->cy - data->oy;
ox = window_copy_find_length(wp, oy);
if (data->lineflag == LINE_SEL_RIGHT_LEFT && oy == data->sely)
window_copy_other_end(wp);
if (data->cx != ox) {
data->lastcx = data->cx;
data->lastsx = ox;
@ -414,9 +412,13 @@ window_copy_pagedown(struct window_pane *wp, int half_page, int scroll_exit)
n = screen_size_y(s) - 2;
}
if (data->oy < n)
if (data->oy < n) {
data->oy = 0;
else
if (data->cy + (n - data->oy) >= screen_size_y(data->backing))
data->cy = screen_size_y(data->backing) - 1;
else
data->cy += n - data->oy;
} else
data->oy -= n;
if (data->screen.sel == NULL || !data->rectflag) {