Git Product home page Git Product logo

Comments (3)

utoddl avatar utoddl commented on August 22, 2024

Hmm. This is in the category of "historical accident". There was a brief time when the Paragraph command tried to do what you indicated above, and it usually worked out alright. But there were lots of corner cases -- paragraphs that had nothing to do with programming or that contained comment-like characters that weren't comments at all -- which prompted us to revert back to a "dumber but consistent" behavior. Looks like the docs didn't make the transition.

I would like to have a comment-aware paragraphing option, but not at the expense of breaking normal text. Ne is supposed to be a Nice Editor, where unexpectedly mangling your text is decidedly Not Nice. I hope to revisit this issue some day.

from ne.

uvtc avatar uvtc commented on August 22, 2024

Thanks, Todd. Glad to hear it may be revisited in the future. Super useful feature, IMO, even if it were strictly limited to a subset of prefixes (like "> ", "// ", "# ") or to even just one prefix ("> ") to start with.

Maybe it would be possible for the user to set a default pref that says, "consider only the following strings as formatting prefixes when reflowing text with Paragraph: ...", if that simplifies and tightens things up.

Also, not sure if this is a corner case you were thinking about trying to solve, but I see that in code, lines of code usually directly follow comment lines (with no empty line between them). I could see how making Paragraph smart enough to handle that corner case would be complicated, and I would not expect Paragraph to try and figure that out. Paragraph works on paragraphs (delineated by blank lines). That is, I'd be happy to and expect to change:

// Comment line 1.
// Comment line 2.
function code(goes here) {...}

to

// Comment line 1.
// Comment line 2.

function code(goes here) {...}

before hitting [p on that comment block to Paragraph it, and then go back and remove the extra newline.

from ne.

uvtc avatar uvtc commented on August 22, 2024

It occurs to me that I could also use the ne Through command, and have a small shell script do this. I'll give that a try.

from ne.

Related Issues (20)

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.