[Geany-Users] Sorting a selection of code

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Geany-Users] Sorting a selection of code

R. Mariotti
A while back I read on this list how one could select a section of
code and then trigger a sort of the contents while in the editor. I've
searched the archives but cannot seem to find the reference.

Does anyone remember how one can accomplish that task and advise -OR-
link to a similar tool for use within geany?

Thank you.
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Sorting a selection of code

Little Girl
Hey there,

R.Mariotti wrote:

> A while back I read on this list how one could select a section of
> code and then trigger a sort of the contents while in the editor.
> I've searched the archives but cannot seem to find the reference.
>
> Does anyone remember how one can accomplish that task and advise
> -OR- link to a similar tool for use within geany?

You'll need the Line Operations plug-in, from your package manager
or from here: https://plugins.geany.org/

Once you have that installed, go here:

Tools --> Line Operations --> Sort Lines Ascending

or:

Tools --> Line Operations --> Sort Lines Descending

--
Little Girl

There is no spoon.
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Sorting a selection of code

Lex Trotman
In reply to this post by R. Mariotti
On 16 April 2017 at 09:27, R.Mariotti <[hidden email]> wrote:
> A while back I read on this list how one could select a section of
> code and then trigger a sort of the contents while in the editor. I've
> searched the archives but cannot seem to find the reference.
>
> Does anyone remember how one can accomplish that task and advise -OR- link
> to a similar tool for use within geany?

You don't say which OS you are using.  On linux you can use
Menu->edit->format->send selection to to send the selection to the
sort command and the sorted result will replace the selection.

Don't know if there is an equivalent command on windows.

Cheers
Lex


>
> Thank you.
> _______________________________________________
> Users mailing list
> [hidden email]
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
rch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Sorting a selection of code

rch
In reply to this post by Little Girl
    Line Operations' option to
        Sort Lines Ascending||Descending
    looks good

    But when I try it, instead of sorting my Selection,
    it sorts the whole file ...

    Whereas in the same file, Geany's
        Edit->Format->Send Selection to->Sort
    sorts just the Selection, as expected

    So what am I doing wrong?

     Richard H
    [Geany 1.30.1 on Ubuntu 12.04]
--

On 04/16/2017 02:03 AM, Little Girl wrote:

> Hey there,
>
> R.Mariotti wrote:
>
>> A while back I read on this list how one could select a section of
>> code and then trigger a sort of the contents while in the editor.
>> I've searched the archives but cannot seem to find the reference.
>>
>> Does anyone remember how one can accomplish that task and advise
>> -OR- link to a similar tool for use within geany?
>
> You'll need the Line Operations plug-in, from your package manager
> or from here: https://plugins.geany.org/
>
> Once you have that installed, go here:
>
> Tools --> Line Operations --> Sort Lines Ascending
>
> or:
>
> Tools --> Line Operations --> Sort Lines Descending
>
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] Sorting a selection of code

Little Girl
Hey there,

rch wrote:

>     Line Operations' option to
>         Sort Lines Ascending||Descending
>     looks good
>
>     But when I try it, instead of sorting my Selection,
>     it sorts the whole file ...
>
>     Whereas in the same file, Geany's
>         Edit->Format->Send Selection to->Sort
>     sorts just the Selection, as expected
>
>     So what am I doing wrong?

I'm not sure. I just opened Geany, typed a few unsorted lines of text
into it, selected some of them, used Line Operations to sort them,
and only the selected lines got sorted. If it helps any, I'm using
Geany 1.30.1 under Linux Mint MATE, and I hadn't saved the file when
I did the test.

--
Little Girl

There is no spoon.
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Loading...