Sorting broken with v7.8.9 update?





  • Sorting worked fine until I updated to v7.8.9, which ironically has the following in the change.log:

    "Notepad++ v7.8.9 Enhancements & bug-fixes:

    1. Fix Line operations (join lines, split lines, remove duplicate lines and sort lines) doing one too many lines issue."

    Now, regardless of which sort I choose, it has no effect at all. Any clues?



  • @Doc-John said in Sorting broken with v7.8.9 update?:

    Now, regardless of which sort I choose, it has no effect at all. Any clues?

    Works for me. I put in

    one
    two
    three
    four
    

    and Edit > Lines > Sort Lines … Ascending, and get

    four
    one
    three
    two
    

    if I pick Descending, I get

    two
    three
    one
    four
    

    it behaves exactly the way I would expect.

    ?-menu Debug Info shows:

    Notepad++ v7.8.9   (64-bit)
    Build time : Jul 15 2020 - 20:31:49
    Path : C:\usr\local\apps\notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS Name : Windows 10 Enterprise (64-bit) 
    OS Version : 1903
    OS Build : 18362.1016
    Current ANSI codepage : 1252
    Plugins : ComparePlugin.dll LuaScript.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConsole.dll NppConverter.dll NppEditorConfig.dll NppExec.dll NppExport.dll NppFTP.dll NppUISpy.dll PreviewHTML.dll PythonScript.dll QuickText.dll TagLEET.dll XMLTools.dll 
    

    Could you provide your ?-menu Debug Info, and an example of data that doesn’t sort properly for you. Please use the </> button to format your example text:
    6a6ab3d2-fda6-4bd6-b810-ca00da081263-image.png



  • @Doc-John said in Sorting broken with v7.8.9 update?:

    1. Fix Line operations (join lines, split lines, remove duplicate lines and sort lines) doing one too many lines issue."

    I think this refers to the following:

    Start with this text:

    four
    three
    two
    one
    

    Select text as follows by clicking on line number 1 (the actual 1 in the line number column) and dragging down so that line 3 becomes fully selected, but not line 4:

    ea8d46f9-7f11-44dc-9463-31856162cebb-image.png

    Sort line ascending to get (in N++ 7.8.9):

    26f1c2c2-ec3b-43cc-ae2d-77f5ce3cd981-image.png

    In version 7.8.8 and earlier, the sort would have resulted in:

    447e23fb-ec69-40a5-966e-6e9501c41279-image.png

    …which, I have not considered before, but now indeed appears to be a bug (not what the user intended to include in the sort).



  • @Alan-Kilborn said in Sorting broken with v7.8.9 update?:

    I have not considered before, but now indeed appears to be a bug

    Just to clarify, the prevoius behavior “appears to be a bug” or the new behavior is? I actually prefer the new way (not that I use this often), but when using keyboard to select rows I always had to hold Shift and down arrow and then remember to press the left arrow once so that the cursor is as the end of “two” on line 3 instead of before “one” on line 4. This behaves on the actually selected (block highlight selected) lines versus just where the cursor is.

    Cheers.



  • @Michael-Vincent

    Just to clarify, the previous behavior “appears to be a bug” or the new behavior is?

    Sorry, that was a bit unclear, but I meant it tied to what appeared closest to the last statement I made.

    I’ll restate my last line from earlier:

    …which, I have not considered before, but now indeed appears to be a bug in 7.8.8 and earlier (not what the user intended to include in the sort)

    It’s kind of a dichotomy:

    You want to sort only selected lines, but that darned skinny-edged caret can be on a separate line in column 1. Now, is that caret part of the selection, helping to define the lines I want to sort, or isn’t it?

    There were workarounds to avoid it:

    • Select from lower part of file, towards upper part to define your line range – no caret-on-line-by-itself issue that way

    • Select only a portion of the final line at the bottom – even just having the first character in column 1 selected works great – but this doesn’t work for the line-number-margin draggers of the world

    Like you, I prefer the 7.8.9 (and presumably greater) behavior.



  • @Alan-Kilborn said in Sorting broken with v7.8.9 update?:

    but now indeed appears to be a bug in 7.8.8 and earlier
    […]
    Like you, I prefer the 7.8.9 (and presumably greater) behavior.

    We are in violent agreement! :-)



  • @Michael-Vincent

    Here’s a situation that is still bad IMO even with 7.8.9:

    Start with:

    999315c5-3a36-45a1-98cf-a1dd59a0563a-image.png

    Sort ascending without specifying a selection to obtain:

    7fe17303-07cc-4bda-85fc-9de38ae25fa0-image.png

    I start (in my mind) with 4 lines of data.
    Just because I believe line 4 isn’t complete without a line-ending, doesn’t (again, for me) mean that I have 5 lines, and that five lines should be sorted.

    I think this would be a much better and more expected result:

    309a6c1d-4286-4979-aece-f1d65bdb19ed-image.png



  • @Alan-Kilborn said in Sorting broken with v7.8.9 update?:

    I think this would be a much better and more expected result:

    Yes, I agree.



  • @Alan-Kilborn said in Sorting broken with v7.8.9 update?:

    I think this would be a much better and more expected result:

    If I understand the pull request properly, there seems to be an available PR to fix this - just not yet integrated.

    Cheers.



  • @Michael-Vincent said in Sorting broken with v7.8.9 update?:

    seems to be an available PR to fix this

    Oh nice, I must have missed seeing that.
    Hope it is in next version.
    Maybe they are saving up a lot of changes as the odometer rolls over to 7.9



  • @Alan-Kilborn said in Sorting broken with v7.8.9 update?:

    Maybe they are saving up a lot of changes as the odometer rolls over to 7.9

    Here’s hoping they add my Function List feature update - please give it a thumbs up if you agree.

    Cheers.



  • @PeterJones
    Debug info:
    Notepad++ v7.8.9 (64-bit)
    Build time : Jul 15 2020 - 20:31:49
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : ON
    Local Conf mode : OFF
    OS Name : Windows 10 Pro (64-bit)
    OS Version : 1909
    OS Build : 18363.815
    Current ANSI codepage : 1252
    Plugins : CustomLineNumbers.dll ExtSettings.dll mimeTools.dll NppConverter.dll NppExport.dll RunMe.dll _CustomizeToolbar.dll

    As for examples, I haven’t been able to sort any of dozens of files, including lists of only numbers, so take your pick.
    You’ll notice I have very few plugins installed, to speed up load times. Is there a plugin needed for the sort function
    to operate properly?



  • @Doc-John said in Sorting broken with v7.8.9 update?:

    Is there a plugin needed for the sort function
    to operate properly?

    No. Sorting is built into the main notepad++.exe.

    I just downloaded a fresh npp.7.8.9.bin.x64.zip, unzipped to a writeable location on my drive, and ran from there. I typed the four lines

    one
    two
    three
    four
    

    Then ran Edit > Line Operations > Sort Lines Lexicographically Ascending, and the file now contains:

    four
    one
    three
    two
    

    It sorts exactly as I would expect it to. Here is a screenshot:
    5e98ce33-5422-487f-8bb5-35344d9b6710-image.png

    I haven’t been able to sort any of dozens of files, including lists of only numbers, so take your pick.

    I just picked a file with four simple words, and it sorted just fine.

    I’ll try another file:

    3
    14
    15
    9
    27
    65
    

    if I sort lexicographically ascending, it shows

    14
    15
    27
    3
    65
    9
    

    which is what I expect, because “lexicographically” means sorted by character in ASCII/codepoint order, not sorted numerically. So a line starting with 14 comes before 15 comes before 27 comes before 3, because the character 1 comes before the character 2 comes before the character 3.
    If, instead, I Sort Lines as Integers Ascending, I get

    3
    9
    14
    15
    27
    65
    

    because the integer 3 is less than the integer 9 is less than the integer 14, and so on.

    It works exactly as I would expect with the default version of Notepad++, no extra plugins installed.

    If this isn’t true for you, you will need to show us the data and the exact steps that don’t work for you. Because it works for me with the data shown; and everyone else who has commented, directly or tangentially, in this discussion has shown that sort is fundamentally working (even if they have quibbles with the treatment of the blank line at the end of the selection).



  • @Doc-John said in Sorting broken with v7.8.9 update?:

    As for examples, I haven’t been able to sort any of dozens of files, including lists of only numbers, so take your pick.

    This is an idiotic statement.
    YOU are the one that needs help.
    You’d think you’d bend over backwards to provide even the simplest example and show how it doesn’t work for you.
    Sheesh.


Log in to reply