Git Product home page Git Product logo

Comments (8)

pm100 avatar pm100 commented on August 15, 2024 1

Ty, that worked beautifully. I should have asked you in the first place

from tui-textarea.

joshka avatar joshka commented on August 15, 2024 1

Ha - I almost mentioned the same solution in the Ratatui side of this :D

from tui-textarea.

rhysd avatar rhysd commented on August 15, 2024

The lifetime parameter is used for ratatui's Block instance which is set to inner Pragraph on rendering. It cannot be removed.

from tui-textarea.

pm100 avatar pm100 commented on August 15, 2024

I know, hence the different block in my pr

from tui-textarea.

rhysd avatar rhysd commented on August 15, 2024

I saw your PR changes a bit. Do you mean adding new API which is very similar to Block only for removing the lifetime parameter? I don't think it is a good tradeoff. We should use ratatui's API as much as possible to make our API as minimal as possible. If we add new widget, users need to learn about it. I feel the cost is much bigger than just handling small one lifetime parameter.

If you want to hide the parameter and you're not benefit from it, you can do:

type TextArea = TextArea<'static>;

from tui-textarea.

pm100 avatar pm100 commented on August 15, 2024

I tried multiple things to avoid propagating the 'a over several weeks , and yet I never tried that one :-). I know it comes with some restrictions, I need to check if it will work in gitui.

from tui-textarea.

rhysd avatar rhysd commented on August 15, 2024

Great. Thanks for your confirmation.

from tui-textarea.

holly-hacker avatar holly-hacker commented on August 15, 2024

Could this be documented somewhere? I just spent 15 minutes adding and removing lifetimes everywhere and was about to open a duplicate of this issue. Using a 'static lifetime is a fine workaround but it's something you need to be aware off first.

from tui-textarea.

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.