Zim

Sort selected lines

Bug #318904 reported by rylleman
2
Affects Status Importance Assigned to Milestone
Zim
Fix Released
Undecided
Unassigned

Bug Description

I would like a sort feature for Zim.
Select the lines you want to sort and "sort" changes their order to be alphabetically, or reverse alphabetical, or by some other preferences.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Patch committed

Changed in zim:
status: New → Fix Committed
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Attached a plugin script you can drop into either /usr/share/zim/plugins or ~/.local/share/zim/plugins .

It adds a tool icon that will sort selected lines in the editor. Selected text is converted to wiki syntax, sorted by line and replaces in the editor.

Didn't do a whole lot of testing, so make backups first.

Revision history for this message
rylleman (rylleman) wrote :

Thank you very much!

After some quick testing it works quite well.
Strike through lines are sorted after standard lines but I guess that is intended behaviour and quite good if you think about it.

One thing that I guess is not working as intended is the following;
blaha
X25
apa
gets sorted as;
X25
apa
blaha
I guess the X25 is treated as a number for some reason. (using small letter x25 sorts it after blaha.)

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

No, that is just default behavior sorting capital letters before normal letters. Probably should make it insensitive. See new attachment.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fixed in 0.28

Changed in zim:
status: Fix Committed → Fix Released
Revision history for this message
rylleman (rylleman) wrote :

I can't get this to work in more recent versions of Zim.
There is no plugins-folder in /usr/share/zim and no zim-folder in /.local/share.
Also when looking for all other plugins it seems like they are in different python-folders and no longer in the same format as this plugin, *.pl. Tried to place this plugin at various places without success.

It also seems this plugin is not part of main trunk yet either. Missed to include it or decided against it?
Either way, I'm missing it!

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 318904] Re: Sort selected lines

On Wed, Mar 16, 2011 at 8:46 AM, rylleman <email address hidden> wrote:

> I can't get this to work in more recent versions of Zim.
> There is no plugins-folder in /usr/share/zim and no zim-folder in
> /.local/share.
> Also when looking for all other plugins it seems like they are in different
> python-folders and no longer in the same format as this plugin, *.pl. Tried
> to place this plugin at various places without success.
>
> It also seems this plugin is not part of main trunk yet either. Missed to
> include it or decided against it?
> Either way, I'm missing it!
>

Afraid the perl (.pl) plugin script is long out of date. Zim is no longer
written in Perl but moved to Python since the 0.4x series of releases. So
any plugin scripts written in Perl are incompatible with the newer versions.

Please see bug #725115 for a python version of this plugin. THis has been
committed to trunk, as can be seen here:
http://bazaar.launchpad.net/~jaap.karssenberg/zim/pyzim/revision/353.

Regards,

Jaap

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.