diff options
author | Nicholas Todoroff <nd.todoroff@gmail.com> | 2023-08-17 15:48:30 -0600 |
---|---|---|
committer | Nicholas Todoroff <nd.todoroff@gmail.com> | 2023-08-17 15:48:30 -0600 |
commit | 61ac2051c82c9d6f0e67e6efdfcb66b5a8d98070 (patch) | |
tree | 047f3833f866ec8664a0d3463c3243ece604a85a | |
parent | 2c3dda33b92cfd8792294522c2f3af1b8c4c0a85 (diff) |
Handle tabs in :ccopy consistently
Only output tabs when conf_clipboard_delimited_tab is set to 1, and only
pad with spaces when set to 0.
-rw-r--r-- | src/clipboard.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/clipboard.c b/src/clipboard.c index 2ca7fc9..94d8636 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -261,12 +261,15 @@ int save_plain(FILE * fout, int r0, int c0, int rn, int cn) { else { emptyfield++; } - if(emptyfield){ - fwprintf(fout, L"\t"); - } if (! conf_clipboard_delimited_tab) { - pad_and_align(text, num, roman->cur_sh->fwidth[col], align, 0, out, roman->cur_sh->row_format[row]); - fwprintf(fout, L"%ls", out); + if (emptyfield) { + fwprintf(fout, L"%*s", roman->cur_sh->fwidth[col], " "); + } else { + pad_and_align(text, num, roman->cur_sh->fwidth[col], align, 0, out, roman->cur_sh->row_format[row]); + fwprintf(fout, L"%ls", out); + } + } else if (emptyfield){ + fwprintf(fout, L"\t"); } else if ( (*pp)->flags & is_valid) { fwprintf(fout, L"%s\t", num); } else if ( (*pp)->label) { |