Skip to content

Sorting of stream selection can do one too many lines #8447

@sasumner

Description

@sasumner

Description of the Issue

When using the Edit menu > Line Operations > Sort > ... operations on a stream selection, the line at the bottom end (at the higher position) can be unintentionally included in the sort.

Steps to Reproduce the Issue

  1. Create some text in a new N++ tab:
Jack and Jill
Went up the hill
To fetch a pail of water
Jack fell down
And broke his crown,
And Jill came tumbling after.
  1. Select the lines I wish to sort via a single stream selection, by clicking in the line number margin starting in line 1 and dragging down to cover the lines I want to operate on:
    image

  2. Invoke the Edit menu > Line Operations > Sort > Sort Lines Lexographically Ascending command.

Expected Behavior

I expected line 6 And Jill came tumbling after. to NOT be included in the lines to be sorted.

Actual Behavior

Line 6 And Jill came tumbling after. IS included in the lines sorted:

image

Other

I do realize that if I don't include the line ending of line 5 in the stream selection, line 6 will not be included in the group of lines to be sorted. However, this feels unnatural and is hard to remember to do before conducting the sort.

Debug Information

Notepad++ v7.8.7 (32-bit)
Build time : Jun 5 2020 - 02:34:28
Path : C:\..............\npp.7.8.7.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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions