diff options
author | andmarti1424 <andmarti@gmail.com> | 2017-04-21 19:54:55 -0300 |
---|---|---|
committer | andmarti1424 <andmarti@gmail.com> | 2017-04-21 19:54:55 -0300 |
commit | 006dcea2970b449f10056d89cc257b4c699788b5 (patch) | |
tree | 03cd7a794c2c9e93085845f3d643826258d41b6e | |
parent | 1603f3aeb1bfd2d28808ff8302eeabadc4b5349f (diff) |
new copy_to_clipboard tab delim option
-rwxr-xr-x | src/clipboard.c | 16 | ||||
-rwxr-xr-x | src/conf.c | 2 | ||||
-rw-r--r-- | src/doc | 4 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/clipboard.c b/src/clipboard.c index f4a28c6..a1e07f3 100755 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -159,12 +159,18 @@ int save_plain(FILE * fout, int r0, int c0, int rn, int cn) { text[0] = '\0'; } } - pad_and_align(text, num, fwidth[col], align, 0, out); - - fwprintf(fout, L"%ls", out); - - } else { + if (! atoi(get_conf_value("copy_to_clipboard_delimited_tab"))) { + pad_and_align(text, num, fwidth[col], align, 0, out); + fwprintf(fout, L"%ls", out); + } else if ( (*pp)->flags & is_valid) { + fwprintf(fout, L"%s\t", num); + } else if ( (*pp)->label) { + fwprintf(fout, L"%s\t", text); + } + } else if (! atoi(get_conf_value("copy_to_clipboard_delimited_tab"))) { fwprintf(fout, L"%*s", fwidth[col], " "); + } else { + fwprintf(fout, L"\t"); } } if (row != rn) fwprintf(fout, L"\n"); @@ -28,6 +28,8 @@ void store_default_config_values() { put(user_conf_d, "default_copy_to_clipboard_cmd", ""); #endif + put(user_conf_d, "copy_to_clipboard_delimited_tab", "0"); + #ifdef DEFAULT_PASTE_FROM_CLIPBOARD_CMD put(user_conf_d, "default_paste_from_clipboard_cmd", DEFAULT_PASTE_FROM_CLIPBOARD_CMD); #else @@ -410,6 +410,10 @@ Commands for handling cell content: options available. You can also set a different value of 'default_copy_to_clipboard_cmd' configuration variable at runtime, using the :set command. + This process will export content as plain text. It will not delimit columns + with '\t' chars. + If you wish to delimit columns with tabs, set + "copy_to_clipboard_delimited_tab" variable to "1". :cpaste Paste clipboard content to Sc-im. When 'cpaste' command is executed, the default value of macro |