-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add an option to show cursor and placeholder together #73
Conversation
#[cfg(any( | ||
feature = "tuirs-crossterm", | ||
feature = "tuirs-termion", | ||
feature = "tuirs-no-backend", | ||
))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tui-rs, Text
does not have push_span
method, so I did not support them.
When I did not put above cfg
, I got this error.
error[E0599]: no method named `push_span` found for struct `tui::text::Text` in the current scope
--> src/widget.rs:[12](https://github.com/kyu08/tui-textarea/actions/runs/10096172842/job/27918026333#step:18:13)9:22
|
129 | text.push_span(self.0.placeholder.as_str());
| ^^^^^^^^^ method not found in `Text<'_>`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `tui-textarea` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `tui-textarea` (lib test) due to 1 previous error
Thank you for implementing this. I feel this behavior should be default. I will remove the option and make this as default behavior after merging this PR. |
I made this default behavior at 00f0010 |
@rhysd |
Okay, I'll announce the next release in this issue thread so that you can notice it. |
Thank you so much! |
Thanks for fixing image ratio. 🙏 |
This feature was included in v0.5.2 release. |
@rhysd |
What
I added an option to show cursor with placeholder. This is disabled by default.

Motivation
I feel it is more common that cursor and placeholder are shown together. Also users can understand easily they can input.