andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.77k stars 201 forks source link

Allow `:ccopy` to copy full string representation #832

Closed ndtodoroff closed 1 year ago

ndtodoroff commented 1 year ago

Fixes #688 by adding an configuration variable copy_to_clipboard_wysiwyg. When this variable is nonzero :ccopy will act the same way it did before this PR. When it is zero, :ccopy will now copy a full string representation of the selected range by calculating the necessary widths . When copy_to_clipboard_delimited_tab != 0:ccopy already copies a full representation, so we don't calculate anything new in this case. Documentation has been updated accordingly.

The logic for when to emit tabs was inconsistent, so I also fixed that. Tabs are now only emitted when copy_to_clipboard_delimited_tab != 0.

I also fixed a bug in pad_and_align(). There were some uses of wmemset(str_out, ...) which then immediately returned from pad_and_align() without null terminating; this is fixed. I also removed some unecessary calls to wcslen().

I also fixed some grammar in the documentation.

andmarti1424 commented 1 year ago

@ndtodoroff thanks. will check it out.

andmarti1424 commented 1 year ago

@ndtodoroff fixed this image and merged it. thank you!

ndtodoroff commented 1 year ago

@andmarti1424 Could've swore I compiled before pushing... thank you!