Skip to content

Adds sort lines (ascending and descending) command#2796

Merged
alexdima merged 2 commits intomicrosoft:masterfrom
martellaj:joem/sort-lines
Mar 17, 2016
Merged

Adds sort lines (ascending and descending) command#2796
alexdima merged 2 commits intomicrosoft:masterfrom
martellaj:joem/sort-lines

Conversation

@martellaj
Copy link
Member

  • Took a crack at issue Add "sort lines" option #536, given it had the help wanted label
  • Adds keyboard shortcuts to sort lines (chose arbitrary shortcuts, probably want to change those)
  • Didn't create formal test cases (won't have the time for a while), but did verify changes using strings from random.org

@msftclas
Copy link

msftclas commented Feb 8, 2016

Hi @martellaj, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas
Copy link

msftclas commented Feb 8, 2016

@martellaj, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@csholmq
Copy link

csholmq commented Mar 15, 2016

Nice job. Question is; should this be merged or handled by an extension? E.g. Sort lines

@martellaj
Copy link
Member Author

I know Sublime Text has this functionality built in and that it's often a requested feature for IDEs. I don't see a downside of including it without having to download a third party extension, given that it's an operation on code lines with essentially no logic (I'm on the OneDrive team and would love to alphabetize our dependencies. 😋).

Really I was just trying to contribute where I could to a product I love using. Would love to see it merged!

@alexdima alexdima added this to the March 2016 milestone Mar 16, 2016
@Tyriar
Copy link
Member

Tyriar commented Mar 17, 2016

Commenting so I get a participating notification. I want to deprecate my extension if it gets in :)

@alexdima alexdima merged commit 60caccd into microsoft:master Mar 17, 2016
alexdima added a commit that referenced this pull request Mar 17, 2016
Adds sort lines (ascending and descending) command
@alexdima
Copy link
Member

@martellaj

Thank you! 👍

I took the liberty to tweak the keybindings and add some tests while merging.

@martellaj
Copy link
Member Author

Sweet! Happy to contribute. ☺️ Keep rocking, guys!

@martellaj martellaj deleted the joem/sort-lines branch March 22, 2016 13:28
@rafareino
Copy link

It took me a few minutes to me to understand how this works.

To me at least, do not seems particularly obvious that I must select the lines before sorting out, what if it acts like Copy/Paste with no selection (defaults to whole line) the command should either alert if there isn't any selection to act upon, or act over the whole file instead.

@dtromans
Copy link

Can someone please provide a link to the documentation for this feature? I can't find this feature in any of the menus.

@martellaj
Copy link
Member Author

Interesting. Seems it's no longer showing up in the command palette, but does show up as keyboard shortcuts.

@dtromans
Copy link

@martellaj Ahh, thank you. I do see it in the command palette if I type "sort". I was expecting to access the feature from one of the Edit/Selection/context menus.

@martellaj
Copy link
Member Author

Yep, I'm seeing it in the command palette now, too. Pretty sure it was absent on the Insider build I was on 2 days ago though. Regardless, all good now. 👍

@OlafvdSpek
Copy link

How does one access this feature?

Typing sort doesn't return anything.

@martellaj
Copy link
Member Author

@OlafvdSpek You're sure you're in the command palette, right? I still see it FWIW.

image

@OlafvdSpek
Copy link

No, I was trying the Ctrl-P one.. sorry.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants