mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +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:
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));
|
||||
}
|
||||
|
||||
int
|
||||
paste_is_empty(void)
|
||||
{
|
||||
return RB_ROOT(&paste_by_time) == NULL;
|
||||
}
|
||||
|
||||
/* Get the most recent automatic buffer. */
|
||||
struct paste_buffer *
|
||||
paste_get_top(const char **name)
|
||||
@ -119,6 +125,8 @@ paste_get_top(const char **name)
|
||||
struct paste_buffer *pb;
|
||||
|
||||
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)
|
||||
return (NULL);
|
||||
if (name != NULL)
|
||||
|
Reference in New Issue
Block a user