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