biati-digital / nova-text-tools

Swiss Army knife for text manipulation and selection Sort, Transform, Filter, Delete Duplicates, Encode, Decode and much more...
16 stars 2 forks source link

Sort lines preserving separator #10

Closed eahanson closed 2 years ago

eahanson commented 2 years ago

How about a line sort feature that preserves line separators?

bat,
cat,
ant

would be sorted to:

ant,
bat,
cat

The algorithm might be something like, "if all the lines except the last contain the same non-whitespace non-alphanumeric character, then after sorting remove that character from end of the last line and add it to the end of any other line that doesn't have it".

This would be super useful for languages that don't support trailing commas in lists.

biati-digital commented 2 years ago

Hi, that's a great idea, unfortunately my license already expired and i'm not planning to renew soon, i went back to PHP Storm.

I'll try Nova again in 1/2 years.

eahanson commented 2 years ago

I created my own extension for this: https://extensions.panic.com/extensions/eahanson/eahanson.smart-sort-lines/