Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Sort text by line length #15

Closed
Lichtenshtein opened this issue Dec 13, 2023 · 5 comments
Closed

[Feature request] Sort text by line length #15

Lichtenshtein opened this issue Dec 13, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Lichtenshtein
Copy link

Like this:

https://community.notepad-plus-plus.org/post/90069

Essentially, I just can't find a suitable replacement for this function from the old "Linesort" plugin after I switched to Notepad++ x64. I have to keep old Notepad++ x32 just because of this plugin...

@Coises
Copy link
Owner

Coises commented Dec 13, 2023

I can’t quite find a way that this fits well into Columns++. I’m not saying I can’t or won’t ever do it, but I’m hesitant because the feature seems unrelated to anything Columns++ already does or to its original “mission” as a tool for working with data arranged in columns.

However, I think the MultiReplace plugin might help. I’ve added a comment to the forum post you mentioned explaining how I think it can be done and asking for comments from the author of MultiReplace.

@Coises
Copy link
Owner

Coises commented Dec 14, 2023

@Lichtenshtein

Thank you for your suggestion.

I’ve thought about it some more, and I believe I spoke too soon in my initial response. It really shouldn’t be that difficult a fit — it just took me a bit of thought to see how it could work: the custom sort dialog could accommodate an additional setting, Size, as an alternative to Binary/Locale/Numeric. (Obvious once you think of it, but for some reason I wasn’t thinking that way at first.)

I know you closed this after I suggested using MultiReplace, but I’m going to reopen it and hopefully have something workable in the next few days. In the meantime, of course, the MultiReplace option should work for you.

@Coises
Copy link
Owner

Coises commented Dec 14, 2023

@Lichtenshtein

You can do this with Columns++ release 1.0.1. At present it’s marked pre-release; since the change is fairly small and contained, I’ll upgrade it to latest stable release and close this issue in a couple days if the new version appears to work as intended.

Select Sort... from the Columns++ menu and let it enclose the entire document in a rectangular selection (or make your own selection first).

Use Whole lines, Ascending or Descending as desired, and Width. You can then sort on Entire column, unless you wish to use one of the other options.

The sort is based on the on-screen width of text in the current font. Columns++ is meant to deal with data in columns using tabs, including elastic tabstops and proportionally-spaced fonts; I found that using the width, rather than a count of characters, was the most consistent way to deal with all the variations in a way that makes intuitive sense for users. For files using monospaced fonts and no tabs, the results are the same as counting characters.

Thank you again for the suggestion. If you get a chance, let me know if the new option works as desired.

@Coises Coises added enhancement New feature or request awaiting confirmation Waiting for confirmation that issue is resolved labels Dec 15, 2023
@Coises
Copy link
Owner

Coises commented Dec 17, 2023

I’m going to assume the 1.0.1 update effectively addresses this feature request. If there is a deficiency it can be re-opened.

@Coises Coises closed this as completed Dec 17, 2023
@Coises Coises removed the awaiting confirmation Waiting for confirmation that issue is resolved label Dec 17, 2023
@Lichtenshtein
Copy link
Author

Thank you so much for implementing this! The author of TextFX2 wrote that he is no longer actively working on the development. But in your plugin, just like in his, there were options for advanced sorting. I use Notepad++ as a text editor with advanced features, but funny enough, I have never used columns and rows in many years. So after your answer I thought that I really didn't address the right plugin developer. Your implementation works for me. Thank you again for adding this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants