summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-01-05 09:07:15 +0000
committernicm <nicm@openbsd.org>2017-01-05 09:07:15 +0000
commit15c6df07bcd41a12cfbc2d619b851e5ac3f6788d (patch)
tree79222c5f8fb7fc25b00aad26c59f0c0fef9163c3 /usr.bin/tmux/screen-write.c
parentminor tweaks; (diff)
downloadwireguard-openbsd-15c6df07bcd41a12cfbc2d619b851e5ac3f6788d.tar.xz
wireguard-openbsd-15c6df07bcd41a12cfbc2d619b851e5ac3f6788d.zip
Highlight all occurrences of search string after searching in copy mode.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index fca9f91d484..2f53521cee3 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.101 2016/12/09 21:39:27 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.102 2017/01/05 09:07:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -392,12 +392,13 @@ 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)
+ u_int py, u_int nx, u_int ny, bitstr_t *markbs,
+ const struct grid_cell *markgc)
{
struct screen *s = ctx->s;
struct grid *gd = src->grid;
struct grid_cell gc;
- u_int xx, yy, cx, cy;
+ u_int xx, yy, cx, cy, b;
cx = s->cx;
cy = s->cy;
@@ -405,6 +406,14 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
for (yy = py; yy < py + ny; yy++) {
for (xx = px; xx < px + nx; xx++) {
grid_get_cell(gd, xx, yy, &gc);
+ if (markbs != NULL) {
+ b = (yy * screen_size_x(src)) + xx;
+ if (bit_test(markbs, b)) {
+ gc.attr = markgc->attr;
+ gc.fg = markgc->fg;
+ gc.bg = markgc->bg;
+ }
+ }
screen_write_cell(ctx, &gc);
}