-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in 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.
![image](https://private-user-images.githubusercontent.com/49891479/352528731-5cb4d228-4133-4d7e-b6cb-01510a0098d8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MjIxODMsIm5iZiI6MTczOTQyMTg4MywicGF0aCI6Ii80OTg5MTQ3OS8zNTI1Mjg3MzEtNWNiNGQyMjgtNDEzMy00ZDdlLWI2Y2ItMDE1MTBhMDA5OGQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA0NDQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYxMzkyYWYxMWUzZjk4YjFiNTM3NjBmN2QwNWE0YzY3NjhhMjUwZTYxOWM5Y2I2OWMyYjI4MGVjMDQwZDA1ODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.txyddR8co0UpUpAwXGAjZhOUEK2ILM9u8ULQdC2X7YI)
Motivation
I feel it is more common that cursor and placeholder are shown together. Also users can understand easily they can input.