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

Making multiple selections of lines, then performing the action Sort lines ascending or Sort lines descending only works on the first selection #36562

Closed
Markussss opened this issue Oct 19, 2017 · 3 comments · Fixed by #36652 or #37196
Assignees
Labels
editor-contrib Editor collection of extras feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Markussss
Copy link
Contributor

  • VSCode Version: Version 1.17.0
  • OS Version: Fedora 26, 4.13.5-200.fc26.x86_64

When trying to sort several highlighted blocks of text, using several cursors in one file, only one of the blocks are sorted.

Steps to Reproduce:

  1. Create a file with several sections that can be sorted. Exaple:
section 1:
a
d
b
c

section 2:
d
c
a
b
  1. Place cursor on the start of one of the sections, create a new cursor by holding down alt and clicking at the start of the other section.
  2. Highlight all four rows of letters in each section by holding Shift, while using the arrow/home/end keys.
  3. Press Ctrl+Shift+P and select «Sort Lines Ascending» or «Sort Lines Descending».
  4. Result is that only one of the highlighted blocks are sorted.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added editor editor-contrib Editor collection of extras labels Oct 19, 2017
@Markussss
Copy link
Contributor Author

I have only tested this with up to four different selected blocks. The result is the same every time, but what block is getting sorted depends on where I put the first cursor (the main cursor); the block highlighted by the main cursor is always getting sorted it seems.

@alexdima alexdima added the feature-request Request for new features or functionality label Oct 20, 2017
@alexdima
Copy link
Member

This would be a good opportunity for a PR. The SortLinesAscendingAction and SortLinesDescendingAction only operate on the primary selection.

@alexdima alexdima added the good first issue Issues identified as good for first-time contributors label Oct 20, 2017
@alexdima alexdima added this to the Backlog milestone Oct 20, 2017
@alexdima alexdima removed their assignment Oct 20, 2017
Markussss added a commit to Markussss/vscode that referenced this issue Oct 20, 2017
I copied the method of performing multiple actions from
AbstractCopyLinesAction.

This fixes microsoft#36562.
@MFry
Copy link

MFry commented Oct 25, 2017

Can I take a look at solving this?

@alexdima alexdima self-assigned this Nov 14, 2017
@alexdima alexdima modified the milestones: Backlog, November 2017 Nov 14, 2017
alexdima added a commit that referenced this issue Nov 14, 2017
@alexdima alexdima added the verification-needed Verification of issue is requested label Dec 5, 2017
@jrieken jrieken added the verified Verification succeeded label Dec 5, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-contrib Editor collection of extras feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
4 participants