mirror of
https://github.com/tmux/tmux.git
synced 2024-11-01 07:08:49 +00:00
Do not stop stop at first padding in format_grid_line and handle tabs.
This commit is contained in:
parent
fdbc6cdea5
commit
eaec0a48f4
7
format.c
7
format.c
@ -5273,10 +5273,13 @@ format_grid_line(struct grid *gd, u_int y)
|
||||
for (x = 0; x < grid_line_length(gd, y); x++) {
|
||||
grid_get_cell(gd, x, y, &gc);
|
||||
if (gc.flags & GRID_FLAG_PADDING)
|
||||
break;
|
||||
continue;
|
||||
|
||||
ud = xreallocarray(ud, size + 2, sizeof *ud);
|
||||
memcpy(&ud[size++], &gc.data, sizeof *ud);
|
||||
if (gc.flags & GRID_FLAG_TAB)
|
||||
utf8_set(&ud[size++], '\t');
|
||||
else
|
||||
memcpy(&ud[size++], &gc.data, sizeof *ud);
|
||||
}
|
||||
if (size != 0) {
|
||||
ud[size].size = 0;
|
||||
|
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user