verazab / ascii-lines-sort Goto Github PK
View Code? Open in Web Editor NEWAtom package to sort lines by ascii character order.
License: MIT License
Atom package to sort lines by ascii character order.
License: MIT License
If I have a file like this
1. a
2.
3. b
4.
... (1000 lines of code)
1004. end
and run this package function on the first 3 lines
1. a
2. b
3.
... (1000 lines of code)
1003. end
will it move every line up by one by removing the space?
I notice that in at least one other popular editor (emacs) the empty string line is moved to the top so that the results will actually look like
1.
2. a
3. b
4.
... (1000 lines of code)
1004. end
with the blank line moved upwards. This seems to fit into the philosophy of "make the least disruptive changes possible".
This seems to use the native JS sort (which is great to have exposed into the editor!).
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
That means that this package implements a character sort over all unicode code points which is a superset of Ascii.
Perhaps a change in the package description may be useful and even a link to the MDN article may be helpful. (The package might be more usefully named "line-sort" or some other generic name :) )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.