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

Wrong order of sorting line ascending #15516

Closed
TiagoSousa26 opened this issue Nov 15, 2016 · 1 comment
Closed

Wrong order of sorting line ascending #15516

TiagoSousa26 opened this issue Nov 15, 2016 · 1 comment
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@TiagoSousa26
Copy link

TiagoSousa26 commented Nov 15, 2016

  • VSCode Version: 1.7.1
  • OS Version: Windows 10 Home Version 1607

Steps to Reproduce:

  1. Have a css file with the following code:
height: 100px;
margin: 0;
margin-bottom: auto;
width: 100px;
  1. Select the the previous code.
  2. Press F1 (default key), write "sort lines ascending" and choose the option writed before.

And it will switch the margin with margin-bottom and it should be how it started.

@alexdima
Copy link
Member

alexdima commented Dec 2, 2016

The sort lines command is language agnostic and follows the standard lexicographic order.

i.e.

['margin: 0;', 'margin-bottom: auto;'].sort();
// results in
["margin-bottom: auto;", "margin: 0;"]

In this case:

  • margin-bottom: auto < margin: 0;
  • because margin- < margin:
  • because - < :
  • because 45 < 58

@alexdima alexdima closed this as completed Dec 2, 2016
@alexdima alexdima added invalid Issue identified as not relevant or not valid *as-designed Described behavior is as designed and removed invalid Issue identified as not relevant or not valid labels Dec 2, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

3 participants