mirror of
https://github.com/tmux/tmux.git
synced 2025-01-26 16:13:34 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
5b8f033e06
6
cmd.c
6
cmd.c
@ -600,8 +600,10 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
|
||||
if (y < wp->yoff || y >= wp->yoff + wp->sy)
|
||||
return (-1);
|
||||
|
||||
*xp = x - wp->xoff;
|
||||
*yp = y - wp->yoff;
|
||||
if (xp != NULL)
|
||||
*xp = x - wp->xoff;
|
||||
if (yp != NULL)
|
||||
*yp = y - wp->yoff;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
21
paste.c
21
paste.c
@ -34,6 +34,7 @@ struct paste_buffer {
|
||||
size_t size;
|
||||
|
||||
char *name;
|
||||
time_t created;
|
||||
int automatic;
|
||||
u_int order;
|
||||
|
||||
@ -78,6 +79,20 @@ paste_buffer_name(struct paste_buffer *pb)
|
||||
return (pb->name);
|
||||
}
|
||||
|
||||
/* Get paste buffer order. */
|
||||
u_int
|
||||
paste_buffer_order(struct paste_buffer *pb)
|
||||
{
|
||||
return (pb->order);
|
||||
}
|
||||
|
||||
/* Get paste buffer created. */
|
||||
time_t
|
||||
paste_buffer_created(struct paste_buffer *pb)
|
||||
{
|
||||
return (pb->created);
|
||||
}
|
||||
|
||||
/* Get paste buffer data. */
|
||||
const char *
|
||||
paste_buffer_data(struct paste_buffer *pb, size_t *size)
|
||||
@ -87,7 +102,7 @@ paste_buffer_data(struct paste_buffer *pb, size_t *size)
|
||||
return (pb->data);
|
||||
}
|
||||
|
||||
/* Walk paste buffers by name. */
|
||||
/* Walk paste buffers by time. */
|
||||
struct paste_buffer *
|
||||
paste_walk(struct paste_buffer *pb)
|
||||
{
|
||||
@ -173,6 +188,8 @@ paste_add(char *data, size_t size)
|
||||
pb->automatic = 1;
|
||||
paste_num_automatic++;
|
||||
|
||||
pb->created = time(NULL);
|
||||
|
||||
pb->order = paste_next_order++;
|
||||
RB_INSERT(paste_name_tree, &paste_by_name, pb);
|
||||
RB_INSERT(paste_time_tree, &paste_by_time, pb);
|
||||
@ -263,6 +280,8 @@ paste_set(char *data, size_t size, const char *name, char **cause)
|
||||
pb->automatic = 0;
|
||||
pb->order = paste_next_order++;
|
||||
|
||||
pb->created = time(NULL);
|
||||
|
||||
if ((old = paste_get_name(name)) != NULL)
|
||||
paste_free(old);
|
||||
|
||||
|
@ -389,8 +389,8 @@ screen_write_cnputs(struct screen_write_ctx *ctx, ssize_t maxlen,
|
||||
|
||||
/* Copy from another screen. */
|
||||
void
|
||||
screen_write_copy(struct screen_write_ctx *ctx,
|
||||
struct screen *src, u_int px, u_int py, u_int nx, u_int ny)
|
||||
screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
|
||||
u_int py, u_int nx, u_int ny)
|
||||
{
|
||||
struct screen *s = ctx->s;
|
||||
struct grid *gd = src->grid;
|
||||
@ -1111,7 +1111,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
||||
gce = &gl->celldata[s->cx];
|
||||
if (gce->flags & GRID_FLAG_EXTENDED)
|
||||
skip = 0;
|
||||
else if (gc->flags != (gce->flags & ~GRID_FLAG_EXTENDED))
|
||||
else if (gc->flags != gce->flags)
|
||||
skip = 0;
|
||||
else if (gc->attr != gce->data.attr)
|
||||
skip = 0;
|
||||
@ -1119,7 +1119,9 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
||||
skip = 0;
|
||||
else if (gc->bg != gce->data.bg)
|
||||
skip = 0;
|
||||
else if (gc->data.width != 1 || gce->data.data != gc->data.data[0])
|
||||
else if (gc->data.width != 1)
|
||||
skip = 0;
|
||||
else if (gce->data.data != gc->data.data[0])
|
||||
skip = 0;
|
||||
}
|
||||
}
|
||||
@ -1267,10 +1269,12 @@ screen_write_overwrite(struct screen_write_ctx *ctx, struct grid_cell *gc,
|
||||
}
|
||||
|
||||
/*
|
||||
* Overwrite any padding cells that belong to any UTF-8 characters we'll be
|
||||
* overwriting with the current character.
|
||||
* Overwrite any padding cells that belong to any UTF-8 characters
|
||||
* we'll be overwriting with the current character.
|
||||
*/
|
||||
if (width != 1 || gc->data.width != 1 || gc->flags & GRID_FLAG_PADDING) {
|
||||
if (width != 1 ||
|
||||
gc->data.width != 1 ||
|
||||
gc->flags & GRID_FLAG_PADDING) {
|
||||
xx = s->cx + width - 1;
|
||||
while (++xx < screen_size_x(s)) {
|
||||
grid_view_get_cell(gd, xx, s->cy, &tmp_gc);
|
||||
|
2
tmux.h
2
tmux.h
@ -1589,6 +1589,8 @@ void cfg_show_causes(struct session *);
|
||||
/* paste.c */
|
||||
struct paste_buffer;
|
||||
const char *paste_buffer_name(struct paste_buffer *);
|
||||
u_int paste_buffer_order(struct paste_buffer *);
|
||||
time_t paste_buffer_created(struct paste_buffer *);
|
||||
const char *paste_buffer_data(struct paste_buffer *, size_t *);
|
||||
struct paste_buffer *paste_walk(struct paste_buffer *);
|
||||
struct paste_buffer *paste_get_top(const char **);
|
||||
|
Loading…
Reference in New Issue
Block a user