mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 11:18:48 +00:00
When picking a buffer because one isn't specified by the user, ignore
named buffers. GitHub issue 3212 from David le Blanc.
This commit is contained in:
parent
3edda3c5e7
commit
020c403dff
@ -100,7 +100,7 @@ cmd_choose_tree_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
const struct window_mode *mode;
|
const struct window_mode *mode;
|
||||||
|
|
||||||
if (cmd_get_entry(self) == &cmd_choose_buffer_entry) {
|
if (cmd_get_entry(self) == &cmd_choose_buffer_entry) {
|
||||||
if (paste_get_top(NULL) == NULL)
|
if (paste_is_empty())
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
mode = &window_buffer_mode;
|
mode = &window_buffer_mode;
|
||||||
} else if (cmd_get_entry(self) == &cmd_choose_client_entry) {
|
} else if (cmd_get_entry(self) == &cmd_choose_client_entry) {
|
||||||
|
8
paste.c
8
paste.c
@ -112,6 +112,12 @@ paste_walk(struct paste_buffer *pb)
|
|||||||
return (RB_NEXT(paste_time_tree, &paste_by_time, pb));
|
return (RB_NEXT(paste_time_tree, &paste_by_time, pb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
paste_is_empty(void)
|
||||||
|
{
|
||||||
|
return RB_ROOT(&paste_by_time) == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the most recent automatic buffer. */
|
/* Get the most recent automatic buffer. */
|
||||||
struct paste_buffer *
|
struct paste_buffer *
|
||||||
paste_get_top(const char **name)
|
paste_get_top(const char **name)
|
||||||
@ -119,6 +125,8 @@ paste_get_top(const char **name)
|
|||||||
struct paste_buffer *pb;
|
struct paste_buffer *pb;
|
||||||
|
|
||||||
pb = RB_MIN(paste_time_tree, &paste_by_time);
|
pb = RB_MIN(paste_time_tree, &paste_by_time);
|
||||||
|
while (pb != NULL && !pb->automatic)
|
||||||
|
pb = RB_NEXT(paste_time_tree, &paste_by_time, pb);
|
||||||
if (pb == NULL)
|
if (pb == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
if (name != NULL)
|
if (name != NULL)
|
||||||
|
1
tmux.h
1
tmux.h
@ -2057,6 +2057,7 @@ u_int paste_buffer_order(struct paste_buffer *);
|
|||||||
time_t paste_buffer_created(struct paste_buffer *);
|
time_t paste_buffer_created(struct paste_buffer *);
|
||||||
const char *paste_buffer_data(struct paste_buffer *, size_t *);
|
const char *paste_buffer_data(struct paste_buffer *, size_t *);
|
||||||
struct paste_buffer *paste_walk(struct paste_buffer *);
|
struct paste_buffer *paste_walk(struct paste_buffer *);
|
||||||
|
int paste_is_empty(void);
|
||||||
struct paste_buffer *paste_get_top(const char **);
|
struct paste_buffer *paste_get_top(const char **);
|
||||||
struct paste_buffer *paste_get_name(const char *);
|
struct paste_buffer *paste_get_name(const char *);
|
||||||
void paste_free(struct paste_buffer *);
|
void paste_free(struct paste_buffer *);
|
||||||
|
Loading…
Reference in New Issue
Block a user