зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
Make Scrolling serializable
Этот коммит содержится в:
@@ -1,5 +1,6 @@
|
|||||||
use crate::widget::Viewport;
|
use crate::widget::Viewport;
|
||||||
|
#[cfg(feature = "serde")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
/// Specify how to scroll the textarea.
|
/// Specify how to scroll the textarea.
|
||||||
///
|
///
|
||||||
/// This type is marked as `#[non_exhaustive]` since more variations may be supported in the future. Note that the cursor will
|
/// This type is marked as `#[non_exhaustive]` since more variations may be supported in the future. Note that the cursor will
|
||||||
@@ -7,6 +8,8 @@ use crate::widget::Viewport;
|
|||||||
///
|
///
|
||||||
/// [`TextArea::scroll`]: https://docs.rs/tui-textarea/latest/tui_textarea/struct.TextArea.html#method.scroll
|
/// [`TextArea::scroll`]: https://docs.rs/tui-textarea/latest/tui_textarea/struct.TextArea.html#method.scroll
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub enum Scrolling {
|
pub enum Scrolling {
|
||||||
/// Scroll the textarea by rows (vertically) and columns (horizontally). Passing positive scroll amounts to `rows` and `cols`
|
/// Scroll the textarea by rows (vertically) and columns (horizontally). Passing positive scroll amounts to `rows` and `cols`
|
||||||
/// scolls it to down and right. Negative integers means the opposite directions. `(i16, i16)` pair can be converted into
|
/// scolls it to down and right. Negative integers means the opposite directions. `(i16, i16)` pair can be converted into
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user