зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-03 06:16:17 +03:00
derive Debug for TextArea struct (fixes #23)
Этот коммит содержится в:
@@ -1,6 +1,6 @@
|
||||
use std::collections::VecDeque;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum EditKind {
|
||||
InsertChar(char, usize),
|
||||
DeleteChar(char, usize),
|
||||
@@ -54,7 +54,7 @@ impl EditKind {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Edit {
|
||||
kind: EditKind,
|
||||
cursor_before: (usize, usize),
|
||||
@@ -93,7 +93,7 @@ impl Edit {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct History {
|
||||
index: usize,
|
||||
max_items: usize,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::tui::style::{Color, Style};
|
||||
use regex::Regex;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Search {
|
||||
pub pat: Option<Regex>,
|
||||
pub style: Style,
|
||||
|
||||
@@ -44,7 +44,7 @@ use crate::word::{find_word_end_forward, find_word_start_backward};
|
||||
/// // Get lines as String.
|
||||
/// println!("Lines: {:?}", textarea.lines());
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TextArea<'a> {
|
||||
lines: Vec<String>,
|
||||
block: Option<Block<'a>>,
|
||||
|
||||
@@ -15,7 +15,7 @@ use std::sync::atomic::{AtomicU64, Ordering};
|
||||
// point we stick with using `tui::terminal::Frame::render_widget` because it is simpler API. Users don't need to
|
||||
// manage states of textarea instances separately.
|
||||
// https://docs.rs/tui/latest/tui/terminal/struct.Frame.html#method.render_stateful_widget
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Debug)]
|
||||
pub struct Viewport(AtomicU64);
|
||||
|
||||
impl Clone for Viewport {
|
||||
|
||||
Ссылка в новой задаче
Block a user