-.\" $OpenBSD: tmux.1,v 1.565 2017/06/29 22:02:19 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.566 2017/07/04 22:21:31 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 29 2017 $
+.Dd $Mdocdate: July 4 2017 $
.Dt TMUX 1
.Os
.Sh NAME
.It Li "Enter" Ta "Choose selected item"
.It Li "Up" Ta "Select previous item"
.It Li "Down" Ta "Select next item"
+.It Li "<" Ta "Scroll list of previews left"
+.It Li ">" Ta "Scroll list of previews right"
.It Li "C-s" Ta "Search by name"
.It Li "n" Ta "Repeat last search"
.It Li "t" Ta "Toggle if item is tagged"
-/* $OpenBSD: window-tree.c,v 1.10 2017/07/04 12:26:14 nicm Exp $ */
+/* $OpenBSD: window-tree.c,v 1.11 2017/07/04 22:21:31 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
struct cmd_find_state fs;
enum window_tree_type type;
+
+ int offset;
};
static void
}
static void
-window_tree_draw_session(struct session *s, struct screen_write_ctx *ctx,
- u_int sx, u_int sy)
+window_tree_draw_session(struct window_tree_modedata *data, struct session *s,
+ struct screen_write_ctx *ctx, u_int sx, u_int sy)
{
struct options *oo = s->options;
struct winlink *wl;
end = start + visible;
}
+ if (data->offset < -(int)start)
+ data->offset = -(int)start;
+ if (data->offset > (int)(total - end))
+ data->offset = (int)(total - end);
+ start += data->offset;
+ end += data->offset;
+
left = (start != 0);
right = (end != total);
if (((left && right) && sx <= 6) || ((left || right) && sx <= 3))
}
static void
-window_tree_draw_window(struct session *s, struct window *w,
- struct screen_write_ctx *ctx, u_int sx, u_int sy)
+window_tree_draw_window(struct window_tree_modedata *data, struct session *s,
+ struct window *w, struct screen_write_ctx *ctx, u_int sx, u_int sy)
{
struct options *oo = s->options;
struct window_pane *wp;
end = start + visible;
}
+ if (data->offset < -(int)start)
+ data->offset = -(int)start;
+ if (data->offset > (int)(total - end))
+ data->offset = (int)(total - end);
+ start += data->offset;
+ end += data->offset;
+
left = (start != 0);
right = (end != total);
if (((left && right) && sx <= 6) || ((left || right) && sx <= 3))
}
static struct screen *
-window_tree_draw(__unused void *modedata, void *itemdata, u_int sx, u_int sy)
+window_tree_draw(void *modedata, void *itemdata, u_int sx, u_int sy)
{
struct window_tree_itemdata *item = itemdata;
struct session *sp;
case WINDOW_TREE_NONE:
return (0);
case WINDOW_TREE_SESSION:
- window_tree_draw_session(sp, &ctx, sx, sy);
+ window_tree_draw_session(modedata, sp, &ctx, sx, sy);
break;
case WINDOW_TREE_WINDOW:
- window_tree_draw_window(sp, wlp->window, &ctx, sx, sy);
+ window_tree_draw_window(modedata, sp, wlp->window, &ctx, sx, sy);
break;
case WINDOW_TREE_PANE:
screen_write_preview(&ctx, &wp->base, sx, sy);
int finished;
u_int tagged;
+ item = mode_tree_get_current(data->data);
finished = mode_tree_key(data->data, c, &key, m);
+ if (item != mode_tree_get_current(data->data))
+ data->offset = 0;
switch (key) {
+ case '<':
+ data->offset--;
+ break;
+ case '>':
+ data->offset++;
+ break;
case ':':
tagged = mode_tree_count_tagged(data->data);
if (tagged != 0)