! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Add an option to sort the selected lines alphabetically.
Status:
RESOLVED: MOVED
Severity:
enhancement
Product:
Mousepad
Component:
General

Comments

Description negora 2014-09-11 19:04:20 CEST
Just as other editors do, I think that it would be useful to have an option to sort the lines alphabetically, in both orders, ascending and descending.

Thank you.
Comment 1 Andre Miranda editbugs 2014-09-17 04:25:20 CEST
This could be handled by Bug 11097.
Comment 2 negora 2014-09-17 08:56:37 CEST
Sincerely, one of the reasons because I opened the Bug 11097 was the need to sort lines, he he he. However, since it's not easy to implement a feature to pipe text to commands, and because ordering lines can be considered somewhat of general use, I decided to open this new report.

In my opinion, it would be useful to count with something like this, out-of-the-box.
Comment 3 Julien [nodiscc] editbugs 2018-07-12 14:43:00 CEST
My workaround for this is to create a bash alias in ~/.bash_aliases or ~/.bashrc like:

    alias sortclipboard='xclip -selection c -o | sort | xclip -selection c -i'

When I need to sort text I just end it to the clipboard with Ctrl+C and run 'sortclipboard' in a terminal emulator.

This is ok to me (I have an idle terminal window already opened most of the time) but I still wish a basic sorting feature could be added to mousepad, built-in or through external commands (Bug 11097).

PS: Is there a roadmap or a priority list for mousepad bugs/feature requests?
Comment 4 n1dr+cmxfce 2019-02-18 10:16:18 CET
+1 voting for this as well, it's a very desired feature. (Piping would work as well.)
Comment 5 Theo Linkspfeifer editbugs 2019-11-24 12:35:15 CET
Created attachment 9274 
diff

The attached diff adds this functionality. It uses gtk_source_buffer_sort_lines() which was introduced in GTK 3.18:

https://developer.gnome.org/gtksourceview/stable/GtkSourceBuffer.html#gtk-source-buffer-sort-lines

It would probably make sense to expose the flags and column parameters via a small dialog window.
Comment 6 Andre Miranda editbugs 2019-12-08 22:58:39 CET
(In reply to Theo Linkspfeifer from comment #5)
> Created attachment 9274 
> diff
> 
> The attached diff adds this functionality. It uses
> gtk_source_buffer_sort_lines() which was introduced in GTK 3.18:
> 
> https://developer.gnome.org/gtksourceview/stable/GtkSourceBuffer.html#gtk-
> source-buffer-sort-lines
> 
> It would probably make sense to expose the flags and column parameters via a
> small dialog window.
LGTM!
Comment 7 Matthew Brush editbugs 2019-12-10 01:50:39 CET
Looks OK except it breaks building with with Gtk/GtkSourceView 2.
Comment 8 Andre Miranda editbugs 2019-12-10 17:11:36 CET
(In reply to Matthew Brush from comment #7)
> Looks OK except it breaks building with with Gtk/GtkSourceView 2.
Do you think we should keep supporting gtk2 now that Xfce is fully gtk3-based?
Comment 9 Matthew Brush editbugs 2019-12-11 00:43:33 CET
(In reply to Andre Miranda from comment #8)
> (In reply to Matthew Brush from comment #7)
> > Looks OK except it breaks building with with Gtk/GtkSourceView 2.
> Do you think we should keep supporting gtk2 now that Xfce is fully
> gtk3-based?

I don't feel very strongly, though I personally dislike GTK+3 for a variety of reasons. My main reason for maintaining GTK+2 is that IMO, there's no point to remove it if it's not a large maintenance burden, since it allows newer Mousepads to be used on older or non-Xfce distros.

If the other developers want to drop GTK+2 support because it is becoming a maintenance burden (ex. this patch), I'm OK with that. I don't think we should do it by just breaking the build without properly removing it though. If there is a desire to drop it, maybe someone could make a new bug report for that, to discuss what all needs to be removed/updated/fixed, and then once it's done we could merge this patch as is?
Comment 10 Git Bot editbugs 2020-05-24 01:28:40 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/12.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #11155

Reported by:
negora
Reported on: 2014-09-11
Last modified on: 2020-05-24

People

Assignee:
Matthew Brush
CC List:
5 users

Version

Version:
Unspecified
Target Milestone:
Mousepad 0.4.x

Attachments

diff (5.65 KB, patch)
2019-11-24 12:35 CET , Theo Linkspfeifer
no flags

Additional information