diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-04 11:03:03 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-04 11:03:03 +0000 |
commit | aaeee34c3250892c8a20e9c95efe66c1d0ec4be2 (patch) | |
tree | 71ddef687aed06d4eab527d00c2ec630253ac566 /grid.c | |
parent | 70397e4a957eefc2808c600214d8f7689caead71 (diff) | |
download | rtmux-aaeee34c3250892c8a20e9c95efe66c1d0ec4be2.tar.gz rtmux-aaeee34c3250892c8a20e9c95efe66c1d0ec4be2.tar.bz2 rtmux-aaeee34c3250892c8a20e9c95efe66c1d0ec4be2.zip |
Preserve trailing spaces with capture-pane -J, from George Nachman.
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -583,7 +583,7 @@ grid_string_cells_code(const struct grid_cell *lastgc, /* Convert cells into a string. */ char * grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, - struct grid_cell **lastgc, int with_codes, int escape_c0) + struct grid_cell **lastgc, int with_codes, int escape_c0, int trim) { const struct grid_cell *gc; static struct grid_cell lastgc1; @@ -638,8 +638,10 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, off += size; } - while (off > 0 && buf[off - 1] == ' ') - off--; + if (trim) { + while (off > 0 && buf[off - 1] == ' ') + off--; + } buf[off] = '\0'; return (buf); |