Skip to content

Optimize sort functionality#40

Merged
donho merged 2 commits intomasterfrom
unknown repository
May 8, 2015
Merged

Optimize sort functionality#40
donho merged 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented May 8, 2015

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/

jonandr added 2 commits May 8, 2015 23:27
Remove custom, recursive implementation of quicksort which becomes too
slow to use after a couple of hundred lines.
@ghost
Copy link
Author

ghost commented May 8, 2015

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.

@donho
Copy link
Member

donho commented May 8, 2015

+1 for what he said @MAPJe71
Otherwise, bravo @andreas-jonsson : the performance that your patch provides is much better than the current one!

donho added a commit that referenced this pull request May 8, 2015
[ENHANCEMENT] Improve largely the performance of sort lines feature
@donho donho merged commit 00c2e09 into notepad-plus-plus:master May 8, 2015
@ariccio
Copy link
Contributor

ariccio commented May 9, 2015

declared/defined with const as much as possible

Bravo sir, bravo.

@ghost ghost deleted the optimize_sort branch June 1, 2015 17:03
@milipili milipili modified the milestone: 6.x Jun 29, 2015
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants