mirror of
https://github.com/tmux/tmux.git
synced 2026-07-03 10:12:31 +00:00
Turn off preview if no draw callback and add a function to move to top.
This commit is contained in:
12
mode-tree.c
12
mode-tree.c
@@ -382,6 +382,13 @@ mode_tree_get_current_name(struct mode_tree_data *mtd)
|
||||
return (mtd->line_list[mtd->current].item->name);
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_select_top(struct mode_tree_data *mtd)
|
||||
{
|
||||
mtd->current = 0;
|
||||
mtd->offset = 0;
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_expand_current(struct mode_tree_data *mtd)
|
||||
{
|
||||
@@ -509,7 +516,9 @@ mode_tree_start(struct window_pane *wp, struct args *args,
|
||||
mtd->modedata = modedata;
|
||||
mtd->menu = menu;
|
||||
|
||||
if (args_has(args, 'N') > 1)
|
||||
if (drawcb == NULL)
|
||||
mtd->preview = MODE_TREE_PREVIEW_OFF;
|
||||
else if (args_has(args, 'N') > 1)
|
||||
mtd->preview = MODE_TREE_PREVIEW_BIG;
|
||||
else if (args_has(args, 'N'))
|
||||
mtd->preview = MODE_TREE_PREVIEW_OFF;
|
||||
@@ -1487,7 +1496,6 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
|
||||
mode_tree_search_set(mtd);
|
||||
break;
|
||||
case 'f':
|
||||
case 'F':
|
||||
mtd->references++;
|
||||
status_prompt_set(c, NULL, "(filter) ", mtd->filter,
|
||||
mode_tree_filter_callback, mode_tree_filter_free, mtd,
|
||||
|
||||
1
tmux.h
1
tmux.h
@@ -3570,6 +3570,7 @@ typedef const char** (*mode_tree_help_cb)(u_int *, const char**);
|
||||
u_int mode_tree_count_tagged(struct mode_tree_data *);
|
||||
void *mode_tree_get_current(struct mode_tree_data *);
|
||||
const char *mode_tree_get_current_name(struct mode_tree_data *);
|
||||
void mode_tree_select_top(struct mode_tree_data *);
|
||||
void mode_tree_expand_current(struct mode_tree_data *);
|
||||
void mode_tree_collapse_current(struct mode_tree_data *);
|
||||
void mode_tree_expand(struct mode_tree_data *, uint64_t);
|
||||
|
||||
Reference in New Issue
Block a user