Coder Social home page Coder Social logo

Comments (4)

kkinnear avatar kkinnear commented on August 17, 2024 1

Neat idea. I just implemented it:

(czprint i252a {:parse-string? true :width 79})
(defn example
  [vvvvvveeeeeeeerrrrrrryyyyy looooooooooooooooooonnnnggggg paraaaaaaams &
   body]
  (+ 1 2 3))

(czprint i252a {:parse-string? true :width 79 :vector {:no-wrap-after #{"&"}}})
(defn example
  [vvvvvveeeeeeeerrrrrrryyyyy looooooooooooooooooonnnnggggg paraaaaaaams
   & body]
  (+ 1 2 3))

There is now {:vector {:no-wrap-after ...}}, where the value of :no-wrap-after is a set of strings. If one of these strings appears in a vector and it is near the end of a line, then if the next element doesn't also fit on the line, they both go on the next line.

Probably you can just configure {:vector {:no-wrap-after #{"&"}}} globally, since other than in argument vectors, the chances of & appearing by itself in a vector and being at the end of the line is low. And even if that happened, it would
just end up on the next line, which might not even be noticeable. Certainly one could just do this for defn, but that seems like a bit more work than necessary to me.

Anyway, neat idea. The good news is it is coming. The bad news is that, having just released 1.2.4, it will be a while
before I release 1.2.5, which is where this will show up.

Thanks for the idea!

from zprint.

kkinnear avatar kkinnear commented on August 17, 2024 1

This is now implemented in 1.2.5. Use :vector {:no-wrap-after #{"&"}} to get the behavior you want!

from zprint.

NoahTheDuke avatar NoahTheDuke commented on August 17, 2024

hah No problems, I don't mind waiting. Thank you so much for your tireless work!

from zprint.

NoahTheDuke avatar NoahTheDuke commented on August 17, 2024

Excellent, thank you!

from zprint.

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.