зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-08 00:15:50 +03:00
Add serde feature
Этот коммит содержится в:
@@ -37,6 +37,7 @@ tuirs-termion = ["tuirs", "dep:termion", "tui/termion"]
|
|||||||
tuirs-no-backend = ["tuirs"]
|
tuirs-no-backend = ["tuirs"]
|
||||||
# Other optional features
|
# Other optional features
|
||||||
search = ["dep:regex"]
|
search = ["dep:regex"]
|
||||||
|
serde = ["dep:serde"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arbitrary = { version = "1", features = ["derive"], optional = true }
|
arbitrary = { version = "1", features = ["derive"], optional = true }
|
||||||
@@ -48,6 +49,7 @@ termion = { version = "2.0", optional = true }
|
|||||||
termwiz = { version = "0.20.0", optional = true }
|
termwiz = { version = "0.20.0", optional = true }
|
||||||
tui = { version = "0.19", default-features = false, optional = true }
|
tui = { version = "0.19", default-features = false, optional = true }
|
||||||
unicode-width = "0.1.11"
|
unicode-width = "0.1.11"
|
||||||
|
serde = { version = "1", optional = true }
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "minimal"
|
name = "minimal"
|
||||||
|
|||||||
@@ -2,14 +2,17 @@ use crate::widget::Viewport;
|
|||||||
use crate::word::{find_word_start_backward, find_word_start_forward};
|
use crate::word::{find_word_start_backward, find_word_start_forward};
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
use arbitrary::Arbitrary;
|
use arbitrary::Arbitrary;
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
|
|
||||||
/// Specify how to move the cursor.
|
/// Specify how to move the cursor.
|
||||||
///
|
///
|
||||||
/// This type is marked as `#[non_exhaustive]` since more variations may be supported in the future.
|
/// This type is marked as `#[non_exhaustive]` since more variations may be supported in the future.
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
|
#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
|
||||||
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub enum CursorMove {
|
pub enum CursorMove {
|
||||||
/// Move cursor forward by one character. When the cursor is at the end of line, it moves to the head of next line.
|
/// Move cursor forward by one character. When the cursor is at the end of line, it moves to the head of next line.
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user