Skip to content

Strange behavior of the sort feature, with a zero-length column mode selection #12299

@guy038

Description

@guy038

Description of the Issue

In some cases, a rectangular selection, followed with an ascending sort, does not sort lines of that selection correctly !

Steps to Reproduce the Issue

    • In a new tab, insert the INPUT text, below :
    one
    two
    three
    four
    five
    six
    seven
    eight
    nine
    ten
  • Move the caret between the four leading space chars and the word three

  • Hit simustaneously the Alt and Shift keys and, at the same time, hit five times on the Down arrow key

=> The indication Sel: 6x0 should appear in the Status bar

  • Now, hit, for instance, the = sign

=> A = sign is inserted in front of the lines three to eight

  • Select the Edit > Line Operations > Sort lines Lexicographically Ascending

Expected Behavior

The alphabetic sort should work !

Actual Behavior

Nothing happens :-((


  • Now, hit the Left arrow key, once, to cancel the rectangular selection

  • Hit simustaneously the Alt and Shift keys and, at the same time, hit five times on the Down arrow key

=> Again, a rectangular selection ( Sel: 6x0 ), after the = sign, is created

  • Select, again, the Edit > Line Operations > Sort lines Lexicographically Ascending

=> This time, the expected behavior occurs and we get this OUTPUT text :

    one
    two
    =eight
    =five
    =four
    =seven
    =six
    =three
    nine
    ten

As you can see, the lines of the selection, with an = sign, have been correctly sorted, in an ascending order !

Debug Information

Notepad++ v8.4.6   (64-bit)
Build time : Sep 25 2022 - 19:51:39
Path : E:\846_x64\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit) 
OS Version : 21H2
OS Build : 19044.2075
Current ANSI codepage : 1252
Plugins : 
    mimeTools (2.8)
    NppConverter (4.4)
    NppExport (0.4)
    PythonScript (2)
    ComparePlus (1)
    BetterMultiSelection (1.5)

IMPORTANT note :

  • Although, the BetterMultiSelection plugin is present in my local configuration, I disabled the plugin for the tests above ! And, anyway, the results are similar when the BetterMultiSelection plugin is enabled

Refer for similar tests in the post :

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

And some replies to my initial post, below :

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

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

As well as a possible solution in :

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

Best Regards,

guy038

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions