GithubHelp home page GithubHelp logo

Comments (9)

SamVerschueren avatar SamVerschueren commented on June 18, 2024 4

I think we have an issue in log-update now as well (reported here sindresorhus/log-update#20). We started using wrap-ansi but because it trims all the whitespaces, some of the use cases are now foobar. I started to look into this but couldn't come up with a good solution yet. Maybe I should just do the PR (with what I have) and we can iterate from there?

// @sindresorhus

from wrap-ansi.

dthree avatar dthree commented on June 18, 2024

@bcoe we should discuss this, as adding trailing whitespace might break other implementations.

For example, take the string a b c d e, wrapped on 3, and for clarity we'll make * represent white-space. We can do one of two things:

// 1. Allow overflow for white-space only
a*b*
c*d*
e

// 2. Bump the beginning of the next line with white-space:
a*b
*c*
d*e

2 above is uglier, but it won't break anything. 1 above would seem to break things as it violates the expected width of the wrap.

What do you think?

from wrap-ansi.

bcoe avatar bcoe commented on June 18, 2024

@dthree my gut would be that we should opt for option .2; especially when hard is enabled, we can never afford to overflow since tools like cliui and yargs use wrap-ansi for multi-column layout (columns would start to flow into each other).

Either approach taken, it's probably best to opt for a major bump I think?

from wrap-ansi.

SBoudrias avatar SBoudrias commented on June 18, 2024

Maybe we could just keep the whitespace at the beginning and the end of the block?

from wrap-ansi.

bcoe avatar bcoe commented on June 18, 2024

@SBoudrias this sounds reasonable 👍 if you have the time, could you send a failing test case perhaps?

I'd love to see Inquirer using this, big fan 👍

from wrap-ansi.

dthree avatar dthree commented on June 18, 2024

@bcoe I agree on both points.

@SBoudrias yeah - could you please give some examples to ensure we understand you correctly?

from wrap-ansi.

sindresorhus avatar sindresorhus commented on June 18, 2024

and we can iterate from there?

👍

from wrap-ansi.

axe312ger avatar axe312ger commented on June 18, 2024

Yes please make that configurable! <3 :)

from wrap-ansi.

axe312ger avatar axe312ger commented on June 18, 2024

thank you! 🙇

from wrap-ansi.

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.