Git Product home page Git Product logo

ascii-lines-sort's People

Contributors

verazab avatar

Stargazers

 avatar

Watchers

 avatar

ascii-lines-sort's Issues

filtering empty lines moves line number locations

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".

Ascii vs unicode

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 :) )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.