microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.64k stars 29.04k forks source link

Sort Lines getting confused by indentation #39878

Closed selrond closed 2 years ago

selrond commented 6 years ago
Extension Author (truncated) Version
react-native-react-redux EQu 1.4.1
EditorConfig Edi 0.11.1
vsc-material-theme Equ 1.1.2
html-css-class-completion Zig 1.14.0
vscode-mjml att 0.0.9
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
gitignore cod 0.5.0
vscode-eslint dba 1.4.3
mjml-syntax dig 0.0.1
githistory don 0.2.3
gitlens eam 6.3.0
vscode-html-css ecm 0.1.8
vscode-npm-script eg2 0.3.3
php-debug fel 1.12.1
php-intellisense fel 2.0.4
php-pack fel 1.0.1
wordpress hri 1.0.1
sublime-babel-vscode jos 0.2.9
vscode-styled-components jpo 0.0.10
vscode-todo-parser min 1.9.1
vscode-apache mrm 1.1.1
vscode-scss mrm 0.6.2
sublime-keybindings ms- 3.0.3
color-highlight nau 2.3.0
php-docblocker nei 1.3.2
vscode-code-outline pat 0.0.12
vscode-versionlens pfl 0.19.1
stylelint shi 0.31.0
guides spy 0.9.1
vscode-todo-highlight way 0.5.11
vscode-import-cost wix 2.5.1
ReactSnippets xab 1.7.0
markdown-all-in-one yzh 0.11.2

(2 theme extensions excluded)


Steps to Reproduce:

  1. Initial JSON file (notice the tab in indentation) image
  2. After Sort Lines Ascending command (tab-indented line is first, should be third) image

Reproduces without extensions: Yes

alexdima commented 6 years ago

I think the command was not implemented to ignore leading whitespace.

\t (9) < (20)

selrond commented 6 years ago

@alexandrudima does this make it a feature request instead of bug though? Shouldn't lines sorting be by default independent of whitespace?