Comments (8)
Ty, that worked beautifully. I should have asked you in the first place
from tui-textarea.
Ha - I almost mentioned the same solution in the Ratatui side of this :D
from tui-textarea.
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.
I know, hence the different block in my pr
from tui-textarea.
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.
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.
Great. Thanks for your confirmation.
from tui-textarea.
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)
- add os clipboard support HOT 26
- Remove Emacs-like shortcuts from `TextArea::input` HOT 11
- Support bracketed-paste terminal mode
- trying to use tui-textarea in another project - version conflict HOT 13
- Support text "hints" HOT 1
- make lines field public HOT 1
- Allow input widgets to appear wherever the are in a terminal session HOT 2
- selection is really hard to use for the non `input` caller HOT 1
- Update to ratatui 0.26 HOT 2
- Feature Request: syntax highlighting HOT 4
- Is this still maintained ? HOT 5
- Can this please be converted to use portable-atomic? HOT 5
- Add a non-regex search HOT 3
- Why shift is hardcoded here ? HOT 6
- Line Wrapping
- `WordEnd` member for `CursorMove` enum HOT 1
- In Vim example delete up to WordEnd doesn't delete last word character HOT 1
- Cursor can leave visible area when line numbers enabled HOT 2
- Why doesn't `TextArea` implement `Widget` trait HOT 6
- Feature Request: Method for getting selection direction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tui-textarea.