зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
fix crash in split example
Этот коммит содержится в:
@@ -13,12 +13,10 @@ use tui_textarea::{Input, Key, TextArea};
|
|||||||
fn inactivate(textarea: &mut TextArea<'_>) {
|
fn inactivate(textarea: &mut TextArea<'_>) {
|
||||||
textarea.set_cursor_line_style(Style::default());
|
textarea.set_cursor_line_style(Style::default());
|
||||||
textarea.set_cursor_style(Style::default());
|
textarea.set_cursor_style(Style::default());
|
||||||
let b = textarea
|
|
||||||
.block()
|
|
||||||
.cloned()
|
|
||||||
.unwrap_or_else(|| Block::default().borders(Borders::ALL));
|
|
||||||
textarea.set_block(
|
textarea.set_block(
|
||||||
b.style(Style::default().fg(Color::DarkGray))
|
Block::default()
|
||||||
|
.borders(Borders::ALL)
|
||||||
|
.style(Style::default().fg(Color::DarkGray))
|
||||||
.title(" Inactive (^X to switch) "),
|
.title(" Inactive (^X to switch) "),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -26,11 +24,12 @@ fn inactivate(textarea: &mut TextArea<'_>) {
|
|||||||
fn activate(textarea: &mut TextArea<'_>) {
|
fn activate(textarea: &mut TextArea<'_>) {
|
||||||
textarea.set_cursor_line_style(Style::default().add_modifier(Modifier::UNDERLINED));
|
textarea.set_cursor_line_style(Style::default().add_modifier(Modifier::UNDERLINED));
|
||||||
textarea.set_cursor_style(Style::default().add_modifier(Modifier::REVERSED));
|
textarea.set_cursor_style(Style::default().add_modifier(Modifier::REVERSED));
|
||||||
let b = textarea
|
textarea.set_block(
|
||||||
.block()
|
Block::default()
|
||||||
.cloned()
|
.borders(Borders::ALL)
|
||||||
.unwrap_or_else(|| Block::default().borders(Borders::ALL));
|
.style(Style::default())
|
||||||
textarea.set_block(b.style(Style::default()).title(" Active "));
|
.title(" Active "),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user