summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-16 15:11:52 +0000
committernicm <nicm>2020-05-16 15:11:52 +0000
commit2391fe23ab09cfe8667abdcc3338a958ab3da31d (patch)
treecf3c4abfb3dc2b293bbd0059271a98f98499a47a /screen-write.c
parent80e52545a0cccba20fb4d96ed09ea2c129a30c93 (diff)
Copy mode search improvements:
- Add styles for the search marking styles (copy-mode-match-style and copy-mode-current-match-style). - Show the current match (the one with the cursor on it) in a different style. - Copying without a selection will copy the current match if there is one.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/screen-write.c b/screen-write.c
index afa1e96a..e3e51020 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -344,44 +344,9 @@ screen_write_vnputs(struct screen_write_ctx *ctx, ssize_t maxlen,
free(msg);
}
-/* Copy from another screen. Assumes target region is big enough. */
-void
-screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
- u_int py, u_int nx, u_int ny, bitstr_t *mbs, const struct grid_cell *mgc)
-{
- struct screen *s = ctx->s;
- struct grid *gd = src->grid;
- struct grid_cell gc;
- u_int xx, yy, cx, cy, b;
-
- if (nx == 0 || ny == 0)
- return;
-
- cx = s->cx;
- cy = s->cy;
-
- for (yy = py; yy < py + ny; yy++) {
- for (xx = px; xx < px + nx; xx++) {
- grid_get_cell(gd, xx, yy, &gc);
- if (mbs != NULL) {
- b = (yy * screen_size_x(src)) + xx;
- if (bit_test(mbs, b)) {
- gc.attr = mgc->attr;
- gc.fg = mgc->fg;
- gc.bg = mgc->bg;
- }
- }
- if (xx + gc.data.width <= px + nx)
- screen_write_cell(ctx, &gc);
- }
- cy++;
- screen_write_set_cursor(ctx, cx, cy);
- }
-}
-
/*
- * Copy from another screen but without the selection stuff. Also assumes the
- * target region is already big enough.
+ * Copy from another screen but without the selection stuff. Assumes the target
+ * region is already big enough.
*/
void
screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,