Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In multiple selections is it possible to order incremented numbers or pasted text by row first, and then by column? #28

Closed
Nieralyte opened this issue Apr 3, 2015 · 6 comments
Assignees
Milestone

Comments

@Nieralyte
Copy link

e.g. in multi-selections like this (| represents the text caret):

<td>|</td><td>|</td>
<td>|</td><td>|</td>
<td>|</td><td>|</td>

instead of having:

<td>1|</td><td>2|</td>
<td>3|</td><td>4|</td>
<td>5|</td><td>6|</td>

to be able to have:

<td>1|</td><td>4|</td>
<td>2|</td><td>5|</td>
<td>3|</td><td>6|</td>

or in case of copy-paste (with Ctrl+Alt+V), to be able to paste this:

foo
bar
baz
qux
quux
corge

like this:

<td>foo|</td><td>qux|</td>
<td>bar|</td><td>quux|</td>
<td>baz|</td><td>corge|</td>

instead of:

<td>foo|</td><td>bar|</td>
<td>baz|</td><td>qux|</td>
<td>quux|</td><td>corge|</td>
@duydao
Copy link
Owner

duydao commented Apr 4, 2015

Thank you for using Text Pastry! This is not supported in the current version, but this sounds interesting.

I have to check how Sublime Text handles word wrapped lines (could lead to a problem in identefying rows). Please allow me a few days to check how easy it would be to implement this feature.

I'm also working on a feature called bullet paste, which would solve this problem in a different way. Basically, you load up your clipboard with items to paste, and every time you paste into selections, those items will be removed from the clipboard.

With bullet paste, we would copy the list of words:

foo
bar
baz
qux
quux
corge

mark the first column, CTRL+ALT+V, mark the second column, CTRL+ALT+V, etc

and it would lead to the expected result:

<td>foo</td><td>qux</td>
<td>bar</td><td>quux</td>
<td>baz</td><td>corge</td>

So we don't have to copy-paste-copy-paste... any more, we just copy the data into our clipboard once and paste it until we're out of data.

@duydao duydao self-assigned this Apr 4, 2015
@Nieralyte Nieralyte changed the title In multi-column selections is it possible to order incremented numbers or pasted text by row first, and then by column? In multiple selections is it possible to order incremented numbers or pasted text by row first, and then by column? Apr 4, 2015
@Nieralyte
Copy link
Author

wow, bullet paste sounds really neat! in case of a number in a clipboard, i imagine, it could paste incremented numbers infinitely. "range 3 7" in a clipboard could paste 3-7 in an infinite loop by a single number. there are many possibilities.

P.S. here's a little demo i did using Text Pastry: http://i.imgur.com/AZ2LGR1.gif

@duydao duydao added this to the 1.4.5 milestone Apr 9, 2015
duydao added a commit that referenced this issue Apr 12, 2015
@duydao
Copy link
Owner

duydao commented Apr 12, 2015

Thanks for the demo! We can also set a cursor into the cells by using this command:

search <td>(.*?)</td>

I've just tagged 1.4.5, you can paste by row by using pror pbras command

Thanks for using text pastry!

@duydao duydao closed this as completed Apr 12, 2015
@Nieralyte
Copy link
Author

this is just great! even multiple selection pastes work great on wrapped lines. just a little problem i've encountered, it breaks when selections start somewhere on the first line.

six-piece pasting of

foo
bar
baz
qux
quux
corge

results in

<td>foo|</td><td>baz|</td>
<td>bar|</td><td>qux|</td>
<td>|</td><td>|</td>

if there are no lines prior to the block

see the demo of that: http://i.imgur.com/ZQigZ6x.gif

oh BTW it's nice to know, i wasn't aware of the <td>(.*?)</td> parens regex trick, certainly will save some typing.

@duydao
Copy link
Owner

duydao commented Apr 13, 2015

Thanks for reporting this bug, it has been fixed in 1.4.6!

@Nieralyte
Copy link
Author

yep, it worked! thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants