advanced-tables-obsidian icon indicating copy to clipboard operation
advanced-tables-obsidian copied to clipboard

Feature: Pasting text with line-returns creates multiple rows

Open Wittionary opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. I came across a small irritation today. I was pasting a list of servers I'd copied out of my terminal and into a table and hoped they might each make a new record similar to how Excel would behave. Instead, they all went into the first cell. I ended up copying each line one-by-one and pasting that into its own row in the table image

Describe the solution you'd like I'd like to be able to paste text that has line returns (CR, LF, CRLF, whatever you fancy) into a cell, hit enter, and have new rows created, one for each line of text. (Ignore the 2nd column blobs 😅) image

Describe alternatives you've considered There might be a way to accomplish the same with espanso or other keyboard-shortcut software.

Additional context I love this plugin! Thanks for making it!

Wittionary avatar May 11 '21 21:05 Wittionary

One way I found of doing this in the meantime that was super easy if you happen to have Vim mode on:

  1. Enter visual line mode
  2. Highlight all the lines you want to add to the table
  3. Enter substitute mode and do this: :'<,'>s/^/| /

This should just add a bar before each line, and they'll get in the table that way. I also would love to see copy+paste support — thank you for this plugin! :D

nnothstine avatar Aug 04 '21 16:08 nnothstine

This could possibly be solved with #78. It's not perfect, but for your use-case it's not far off.

tgrosinger avatar Nov 25 '21 21:11 tgrosinger

There actually is an editor-paste event which would allow the plugin to capture the event and possibly alter the text before inserting.

tgrosinger avatar Nov 25 '21 21:11 tgrosinger