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