aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-30 20:14:50 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-30 20:14:50 +0000
commit8a160f2d589b1ea9dcc6859dd34ac6480605e478 (patch)
treee6c4f93ee7cd28a64aadec1395c83007230613fa
parente2a7ac4b36a2b9e24648582cc17aaca5e1f7dedf (diff)
downloadrtmux-8a160f2d589b1ea9dcc6859dd34ac6480605e478.tar.gz
rtmux-8a160f2d589b1ea9dcc6859dd34ac6480605e478.tar.bz2
rtmux-8a160f2d589b1ea9dcc6859dd34ac6480605e478.zip
- Unbreak selection colouring.
- Get UTF-8 check the right way round...
-rw-r--r--screen-write.c7
-rw-r--r--tty.c7
-rw-r--r--window-copy.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/screen-write.c b/screen-write.c
index da5b8ba0..526c6546 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1,4 +1,4 @@
-/* $Id: screen-write.c,v 1.42 2009-03-29 11:18:28 nicm Exp $ */
+/* $Id: screen-write.c,v 1.43 2009-03-30 20:14:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -617,9 +617,10 @@ screen_write_cell(
s->cx += width;
/* Draw to the screen if necessary. */
- if (screen_check_selection(s, s->cx - width, s->cy))
+ if (screen_check_selection(s, s->cx - width, s->cy)) {
+ s->sel.cell.data = gc->data;
tty_write_cmd(ctx->wp, TTY_CELL, &s->sel.cell, &gu);
- else
+ } else
tty_write_cmd(ctx->wp, TTY_CELL, gc, &gu);
}
diff --git a/tty.c b/tty.c
index 356c2845..d1ec0cb9 100644
--- a/tty.c
+++ b/tty.c
@@ -1,4 +1,4 @@
-/* $Id: tty.c,v 1.86 2009-03-29 11:18:28 nicm Exp $ */
+/* $Id: tty.c,v 1.87 2009-03-30 20:14:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -384,7 +384,6 @@ void
tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int oy)
{
const struct grid_cell *gc;
- struct grid_cell tmp_gc;
const struct grid_utf8 *gu;
u_int i, sx;
@@ -403,8 +402,8 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int oy)
tty_cursor(tty, i, py, oy);
if (screen_check_selection(s, i, py)) {
- memcpy(&tmp_gc, &s->sel.cell, sizeof tmp_gc);
- tty_cell(tty, &tmp_gc, gu);
+ s->sel.cell.data = gc->data;
+ tty_cell(tty, &s->sel.cell, gu);
} else
tty_cell(tty, gc, gu);
}
diff --git a/window-copy.c b/window-copy.c
index 8a4b183f..119af10b 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1,4 +1,4 @@
-/* $Id: window-copy.c,v 1.54 2009-03-30 19:57:02 nicm Exp $ */
+/* $Id: window-copy.c,v 1.55 2009-03-30 20:14:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -483,7 +483,7 @@ window_copy_copy_line(struct window_pane *wp,
gc = grid_peek_cell(wp->base.grid, i, sy);
if (gc->flags & GRID_FLAG_PADDING)
continue;
- if (gc->flags & GRID_FLAG_UTF8) {
+ if (!(gc->flags & GRID_FLAG_UTF8)) {
*buf = xrealloc(*buf, 1, (*off) + 1);
(*buf)[(*off)++] = gc->data;
} else {