Optimize sort functionality#40
Merged
Conversation
Remove custom, recursive implementation of quicksort which becomes too slow to use after a couple of hundred lines.
Author
|
There is a bug here where it will input newlines in the wrong place if you don't sort the entire file. Will fix this. |
Member
|
+1 for what he said @MAPJe71 |
donho
added a commit
that referenced
this pull request
May 8, 2015
[ENHANCEMENT] Improve largely the performance of sort lines feature
Contributor
|
chcg
added a commit
to chcg/notepad-plus-plus
that referenced
this pull request
Feb 25, 2026
Scintilla Release 5.6.0 (https://www.scintilla.org/scintilla560.zip) Released 25 February 2026. Fix crash when window is too narrow to show any text. Release 5.5.9 Released 25 February 2026. Add option to disable drag/drop editing. Feature notepad-plus-plus#184. Allow Euro '€' in code page 936 for 0x80. Feature notepad-plus-plus#1575. Fix SCI_SETSELECTIONNSTART and SCI_SETSELECTIONNEND to behave more sensibly. Bug notepad-plus-plus#2488. Fix lexing after undo at end of document. Bug notepad-plus-plus#2491. When a line end is not selected, change the colour of the rectangle that indicates the line end is selected to white space background instead of previous character's background except for EOL filled style. On Qt, add const to ScintillaDocument and ScintillaEdit methods. Bug notepad-plus-plus#2494. On Qt, prevent crash when using ScintillaDocument object. Bug notepad-plus-plus#2495. Lexilla Release 5.4.7 (https://www.scintilla.org/lexilla547.zip) Release 5.4.7 Released 25 February 2026. Test a single lexer or multiple directories by specifying as command line arguments to TestLexers. Pull request notepad-plus-plus#344. Lexer added for escape sequences "escseq". Pull request notepad-plus-plus#336. Errorlist: Fix reset escape sequence to set style SCE_ERR_DEFAULT (0) instead of SCE_ERR_ES_BLACK. Issue notepad-plus-plus#333. Makefile: Recognize comments in more situations. Issue notepad-plus-plus#40. Perl: Handle 'method' the same as 'sub' for special cases. Issue notepad-plus-plus#342, Pull request notepad-plus-plus#343. Progress: Add SCE_ABL_ANNOTATION and SCE_ABL_TYPEDANNOTATION styles. Pull request notepad-plus-plus#346.
donho
pushed a commit
that referenced
this pull request
Feb 27, 2026
Release 5.6.0 (https://www.scintilla.org/scintilla560.zip) Released 25 February 2026. Fix crash when window is too narrow to show any text. Release 5.5.9 Released 25 February 2026. Add option to disable drag/drop editing. Feature #184. Allow Euro '€' in code page 936 for 0x80. Feature #1575. Fix SCI_SETSELECTIONNSTART and SCI_SETSELECTIONNEND to behave more sensibly. Bug #2488. Fix lexing after undo at end of document. Bug #2491. When a line end is not selected, change the colour of the rectangle that indicates the line end is selected to white space background instead of previous character's background except for EOL filled style. On Qt, add const to ScintillaDocument and ScintillaEdit methods. Bug #2494. On Qt, prevent crash when using ScintillaDocument object. Bug #2495. Lexilla Release 5.4.7 (https://www.scintilla.org/lexilla547.zip) Release 5.4.7 Released 25 February 2026. Test a single lexer or multiple directories by specifying as command line arguments to TestLexers. Pull request #344. Lexer added for escape sequences "escseq". Pull request #336. Errorlist: Fix reset escape sequence to set style SCE_ERR_DEFAULT (0) instead of SCE_ERR_ES_BLACK. Issue #333. Makefile: Recognize comments in more situations. Issue #40. Perl: Handle 'method' the same as 'sub' for special cases. Issue #342, Pull request #343. Progress: Add SCE_ABL_ANNOTATION and SCE_ABL_TYPEDANNOTATION styles. Pull request #346. Close #17562
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current "sort lines" functionality uses a custom, recursive implementation of quicksort. It becomes too slow to use after a couple of hundred lines, and is very complex to understand.
I have replaced it with the standard sort function.
I have also replaced "reverse sort" with "ascending/descending", since if one sort is designated "reverse" then you have to remember which type of sort is "normal" (something I will never be able to do).
https://sourceforge.net/p/notepad-plus/bugs/5294/