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

Sorting with column block selection uses incorrect key #8674

Closed
sasumner opened this issue Aug 6, 2020 · 3 comments
Closed

Sorting with column block selection uses incorrect key #8674

sasumner opened this issue Aug 6, 2020 · 3 comments
Assignees

Comments

@sasumner
Copy link
Contributor

sasumner commented Aug 6, 2020

Description of the Issue

Steps to Reproduce the Issue

  1. Consider this text in an editor tab:
abcdef
abcddef
  1. Make this column block selection:
    image

  2. Execute Edit > Line Operations > Sort Lines Lexicographically Ascending.

Expected Behavior

Since the selected column key contains the same characters for both lines, the lines should remain in the original order after the sort.

Actual Behavior

The lines incorrectly change order.

Additionally

A zero-width column-block selection should use as the sort key each line's content from the column of the selection out to the end of line. Currently, this type of selection will cause the single character at the caret column to be used as the key.

So, using the same data as above, and this selection:

image

will result in no change in line order, when it should swap the lines.

Debug Information

Notepad++ v7.8.9 (32-bit)
Build time : Jul 15 2020 - 20:26:50
Path : C:\.............\npp.7.8.9.bin\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1039
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll PythonScript.dll

@donho
Copy link
Member

donho commented Aug 9, 2020

Column selection should not be considered while sorting, otherwise there'll be a lot of cases (operations) should take column and multi-selection into consideration.

@sasumner
Copy link
Contributor Author

sasumner commented Aug 9, 2020

@donho said:

Column selection should not be considered while sorting

I don't understand this. Column selection currently (N++ 7.8.9) IS considered while sorting, the current code is just doing it WRONGLY.

a lot of cases (operations) should take column and multi-selection into consideration.

I agree that currently these types of selection operation support is lacking in N++, but it doesn't relate to current issue where column selection is already supported.

@sasumner
Copy link
Contributor Author

Changes from this issue released in Notepad++ version 7.9

alef162 pushed a commit to alef162/notepad-plus-plus that referenced this issue Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants