(rarily needed) "invert line order"

Ideas for new features

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
User avatar
AmigoJack
Posts: 482
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

(rarily needed) "invert line order"

Post by AmigoJack »

Maybe it is rather trivial to implement, so I'll just mention it, although I don't need it often:

the feature to invert the order of all selected lines (or the entire document). If I have the lines 1, 2 and 3 in that order I want them to invert into 3, 2 and 1. If I have the lines Red, Yellow and Green I want them to invert into Green, Yellow and Red.

I cannot achieve this thru "sort", because sorting is bound to the content of the lines, whereas I don't want to invert the existing order. As a workaround I prepend every line with a sequential value (regexp replacement \i) to then sort the lines in descending order and remove those prefixes again. Not much of additional work either, tho.
Post Reply