Fix UTF-8 in c&p mode.

pull/1/head
Nicholas Marriott 2009-03-30 19:57:02 +00:00
parent 6fdac02b53
commit e2a7ac4b36
2 changed files with 6 additions and 3 deletions

1
TODO
View File

@ -87,7 +87,6 @@
(hopefully) for 0.8, in no particular order:
- swap-pane-up, swap-pane-down (maybe move-pane-*)
- test bug sshing from freebsd console
- c&p is funny w/ UTF-8: skips over width=2
- document repeat behaviour and -r on bind-key
- document status-keys

View File

@ -1,4 +1,4 @@
/* $Id: window-copy.c,v 1.53 2009-03-29 11:18:28 nicm Exp $ */
/* $Id: window-copy.c,v 1.54 2009-03-30 19:57:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -481,6 +481,8 @@ window_copy_copy_line(struct window_pane *wp,
if (sx < ex) {
for (i = sx; i < ex; i++) {
gc = grid_peek_cell(wp->base.grid, i, sy);
if (gc->flags & GRID_FLAG_PADDING)
continue;
if (gc->flags & GRID_FLAG_UTF8) {
*buf = xrealloc(*buf, 1, (*off) + 1);
(*buf)[(*off)++] = gc->data;
@ -524,7 +526,9 @@ window_copy_find_length(struct window_pane *wp, u_int py)
px = wp->base.grid->size[py];
while (px > 0) {
gc = grid_peek_cell(wp->base.grid, px - 1, py);
if (!(gc->flags & GRID_FLAG_UTF8) && gc->data != ' ')
if (gc->flags & GRID_FLAG_UTF8)
break;
if (gc->data != ' ')
break;
px--;
}