зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-09 00:35:51 +03:00
include all features at building doc on docs.rs
Этот коммит содержится в:
@@ -53,3 +53,6 @@ required-features = ["crossterm"]
|
|||||||
[[example]]
|
[[example]]
|
||||||
name = "variable"
|
name = "variable"
|
||||||
required-features = ["crossterm"]
|
required-features = ["crossterm"]
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pub struct Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Input {
|
impl Default for Input {
|
||||||
/// The default input is [`Key::Null`] without pressing Ctrl nor Alt, which means invalid input.
|
/// The default input is [`Key::Null`] without pressing any modifier keys, which means invalid input.
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Input {
|
Input {
|
||||||
key: Key::Null,
|
key: Key::Null,
|
||||||
@@ -79,6 +79,7 @@ impl Default for Input {
|
|||||||
|
|
||||||
#[cfg(feature = "crossterm")]
|
#[cfg(feature = "crossterm")]
|
||||||
impl From<CrosstermEvent> for Input {
|
impl From<CrosstermEvent> for Input {
|
||||||
|
/// Convert [`crossterm::event::Event`] to [`Input`].
|
||||||
fn from(event: CrosstermEvent) -> Self {
|
fn from(event: CrosstermEvent) -> Self {
|
||||||
if let CrosstermEvent::Key(key) = event {
|
if let CrosstermEvent::Key(key) = event {
|
||||||
Self::from(key)
|
Self::from(key)
|
||||||
@@ -90,6 +91,7 @@ impl From<CrosstermEvent> for Input {
|
|||||||
|
|
||||||
#[cfg(feature = "crossterm")]
|
#[cfg(feature = "crossterm")]
|
||||||
impl From<KeyEvent> for Input {
|
impl From<KeyEvent> for Input {
|
||||||
|
/// Convert [`crossterm::event::KeyEvent`] to [`Input`].
|
||||||
fn from(key: KeyEvent) -> Self {
|
fn from(key: KeyEvent) -> Self {
|
||||||
let ctrl = key.modifiers.contains(KeyModifiers::CONTROL);
|
let ctrl = key.modifiers.contains(KeyModifiers::CONTROL);
|
||||||
let alt = key.modifiers.contains(KeyModifiers::ALT);
|
let alt = key.modifiers.contains(KeyModifiers::ALT);
|
||||||
@@ -117,6 +119,7 @@ impl From<KeyEvent> for Input {
|
|||||||
|
|
||||||
#[cfg(feature = "termion")]
|
#[cfg(feature = "termion")]
|
||||||
impl From<TerimonEvent> for Input {
|
impl From<TerimonEvent> for Input {
|
||||||
|
/// Convert [`termion::event::Event`] to [`Input`].
|
||||||
fn from(event: TerimonEvent) -> Self {
|
fn from(event: TerimonEvent) -> Self {
|
||||||
if let TerimonEvent::Key(key) = event {
|
if let TerimonEvent::Key(key) = event {
|
||||||
Self::from(key)
|
Self::from(key)
|
||||||
@@ -128,6 +131,7 @@ impl From<TerimonEvent> for Input {
|
|||||||
|
|
||||||
#[cfg(feature = "termion")]
|
#[cfg(feature = "termion")]
|
||||||
impl From<TermionKey> for Input {
|
impl From<TermionKey> for Input {
|
||||||
|
/// Convert [`termion::event::Key`] to [`Input`].
|
||||||
fn from(key: TermionKey) -> Self {
|
fn from(key: TermionKey) -> Self {
|
||||||
use TermionKey::*;
|
use TermionKey::*;
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user