зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-03 14:26:17 +03:00
implement Clone for TextArea and its dependencies
Этот коммит содержится в:
@@ -54,6 +54,7 @@ impl EditKind {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Edit {
|
||||
kind: EditKind,
|
||||
cursor_before: (usize, usize),
|
||||
@@ -92,6 +93,7 @@ impl Edit {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct History {
|
||||
index: usize,
|
||||
max_items: usize,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use regex::Regex;
|
||||
use tui::style::{Color, Style};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Search {
|
||||
pub pat: Option<Regex>,
|
||||
pub style: Style,
|
||||
|
||||
@@ -31,6 +31,7 @@ use tui::widgets::{Block, Widget};
|
||||
/// // Get lines as String.
|
||||
/// println!("Lines: {:?}", textarea.lines());
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct TextArea<'a> {
|
||||
lines: Vec<String>,
|
||||
block: Option<Block<'a>>,
|
||||
|
||||
@@ -17,6 +17,13 @@ use tui::widgets::{Block, Paragraph, Widget};
|
||||
#[derive(Default)]
|
||||
pub struct ScrollTop(AtomicU32);
|
||||
|
||||
impl Clone for ScrollTop {
|
||||
fn clone(&self) -> Self {
|
||||
let u = self.0.load(Ordering::Relaxed);
|
||||
ScrollTop(AtomicU32::new(u))
|
||||
}
|
||||
}
|
||||
|
||||
impl ScrollTop {
|
||||
fn load(&self) -> (u16, u16) {
|
||||
let u = self.0.load(Ordering::Relaxed);
|
||||
|
||||
Ссылка в новой задаче
Block a user