diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2024-10-25 15:13:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2024-10-25 15:13:11 +0000 |
commit | ae9ba25cfc7f852a93c1d98f48a0be5998cd2ee6 (patch) | |
tree | 577e6454b85946dffec61df062daf9fd5c00efb0 /usr.bin/tmux/window-copy.c | |
parent | bf92eb7a7424d3103c01f5b5be7d189d6e168b9c (diff) |
Do not stop stop at first padding in format_grid_line and handle tabs.
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
-rw-r--r-- | usr.bin/tmux/window-copy.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index e9578ea754f..d07dc2aee5d 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.359 2024/10/25 15:00:18 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.360 2024/10/25 15:13:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -4823,12 +4823,9 @@ window_copy_copy_line(struct window_mode_entry *wme, char **buf, size_t *off, grid_get_cell(gd, i, sy, &gc); if (gc.flags & GRID_FLAG_PADDING) continue; - if (gc.flags & GRID_FLAG_TAB) { - memset(ud.data, 0, sizeof ud.data); - *ud.data = '\t'; - ud.have = ud.size = 1; - ud.width = gc.data.width; - } else + if (gc.flags & GRID_FLAG_TAB) + utf8_set(&ud, '\t'); + else utf8_copy(&ud, &gc.data); if (ud.size == 1 && (gc.attr & GRID_ATTR_CHARSET)) { s = tty_acs_get(NULL, ud.data[0]); |