Code Monkey home page Code Monkey logo

Comments (6)

p-ranav avatar p-ranav commented on August 16, 2024 1

Related to #42

from indicators.

p-ranav avatar p-ranav commented on August 16, 2024 1

Should be fixed now. Thanks for reporting this issue.

terminal_width

from indicators.

p-ranav avatar p-ranav commented on August 16, 2024 1

Here you go: https://github.com/p-ranav/indicators/releases/tag/v1.9

from indicators.

p-ranav avatar p-ranav commented on August 16, 2024

Can you paste your code here? (just the relevant bits)

from indicators.

dd4e avatar dd4e commented on August 16, 2024

I wrote a small example that repeats my problem

    // prepare progress bar
    auto prepare_p = [](ProgressBar *p, const std::string &prefix){
        p->set_option(option::PrefixText{prefix});
        p->set_option(option::Start{""});
        p->set_option(option::Fill{""});
        p->set_option(option::Lead{""});
        p->set_option(option::Remainder{""});
        p->set_option(option::End{""});
        p->set_option(option::BarWidth{0});
    };

    ProgressBar p1, p2;

    prepare_p(&p1, "Progress #1");
    prepare_p(&p2, "Progress #2");

    MultiProgress<ProgressBar, 2> mp(p1, p2);

    std::string some_text[] = {"foo", "bar", "independence", "beta", "alfa"};
    std::string dynamic_text;

    // first pb with static postfix text
    p1.set_option(option::PostfixText{"Static text"});

    // second pb with dynamic postfix text
    for (auto &t: some_text) {
        dynamic_text += t + " ";
        p2.set_option(option::PostfixText{dynamic_text});
        mp.set_progress<0>(0);
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }

    // update postfix to little text for pb #2
    p2.set_option(option::PostfixText{"abcd"});
    mp.set_progress<0>(0);

Result:

Progress #1 Static text···········
Progress #2 abcd··························································

dot -- is space

from indicators.

dd4e avatar dd4e commented on August 16, 2024

Should be fixed now. Thanks for reporting this issue.

terminal_width

Thank! How long to wait for a release with this fix?

from indicators.

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.