question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore leading spaces when sorting

See original GitHub issue

I try to sort this code with selection as shown below

   	>	$bundles[] = new DebugBundle();
   		$bundles[] = new SensioDistributionBundle();
   		$bundles[] = new WebProfilerBundle();<

(selection shown as >selected text<)

Expected:

   		$bundles[] = new WebProfilerBundle();
   		$bundles[] = new SensioDistributionBundle();
   		$bundles[] = new DebugBundle();
  • Leading whitespace is ignored

Actual:

   		$bundles[] = new DebugBundle(); <------ PROBLEM
   		$bundles[] = new WebProfilerBundle();
   		$bundles[] = new SensioDistributionBundle();
  • Leading whitespace is taken into account.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tomasfejfarcommented, Apr 3, 2017

I forgot to thank you 😃 I’m using it regularly and it works great.

0reactions
krasacommented, Feb 11, 2017

Done and released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the UNIX sort utility ignore leading spaces without ...
It depends on the locale. With LC_COLLATE=en_US.utf8 sort myfile. I get your unexpected result, and with. LC_COLLATE=C sort myfile.
Read more >
Sort with unequal whitespace in first column
Sort with unequal whitespace in first column · How is the file generated? You should use a different separator. · the file was...
Read more >
How to Remove Leading and Trailing Spaces in Excel
In Excel, you can easily remove Leading spaces (at start of text) and Trailing spaces (at end of text). Click here for Excel...
Read more >
GNU sort -t ":" -n numeric -b blanks ignored -f fold lowercase to ...
The --ignore-leading-blanks (-b) , --dictionary-order (-d) , --ignore-case (-f) and ignore unprintable ( -i ) options are dependent on LC_CTYPE locale.
Read more >
[Chapter 36] 36.4 Confusion with White Space Field Delimiters
And be careful of leading spaces; a word with an extra space before it will be sorted before other words. Therefore, use an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found