SetCursorStyle documentation improvements (#744)
This commit is contained in:
parent
814df1c4a0
commit
fadec7a19c
@ -328,12 +328,11 @@ impl Command for Show {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A command that enables blinking of the terminal cursor.
|
/// A command that enables blinking of the terminal cursor.
|
||||||
///
|
///
|
||||||
/// See `SetCursorStyle` which is more advanced and better supported.
|
|
||||||
///
|
|
||||||
/// # Notes
|
/// # Notes
|
||||||
///
|
///
|
||||||
/// - Windows versions lower than Windows 10 do not support this functionality.
|
/// - Some Unix terminals (ex: GNOME and Konsole) as well as Windows versions lower than Windows 10 do not support this functionality.
|
||||||
|
/// Use `SetCursorStyle` for better cross-compatibility.
|
||||||
/// - Commands must be executed/queued for execution otherwise they do nothing.
|
/// - Commands must be executed/queued for execution otherwise they do nothing.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct EnableBlinking;
|
pub struct EnableBlinking;
|
||||||
@ -349,11 +348,10 @@ impl Command for EnableBlinking {
|
|||||||
|
|
||||||
/// A command that disables blinking of the terminal cursor.
|
/// A command that disables blinking of the terminal cursor.
|
||||||
///
|
///
|
||||||
/// See `SetCursorStyle` which is more advanced and better supported.
|
|
||||||
///
|
|
||||||
/// # Notes
|
/// # Notes
|
||||||
///
|
///
|
||||||
/// - Windows versions lower than Windows 10 do not support this functionality.
|
/// - Some Unix terminals (ex: GNOME and Konsole) as well as Windows versions lower than Windows 10 do not support this functionality.
|
||||||
|
/// Use `SetCursorStyle` for better cross-compatibility.
|
||||||
/// - Commands must be executed/queued for execution otherwise they do nothing.
|
/// - Commands must be executed/queued for execution otherwise they do nothing.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct DisableBlinking;
|
pub struct DisableBlinking;
|
||||||
@ -393,13 +391,13 @@ pub enum SetCursorStyle {
|
|||||||
impl Command for SetCursorStyle {
|
impl Command for SetCursorStyle {
|
||||||
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
|
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
SetCursorStyle::DefaultUserShape => f.write_str("\x1b[?12h\x1b[0 q"),
|
SetCursorStyle::DefaultUserShape => f.write_str("\x1b[0 q"),
|
||||||
SetCursorStyle::BlinkingBlock => f.write_str("\x1b[?12h\x1b[1 q"),
|
SetCursorStyle::BlinkingBlock => f.write_str("\x1b[1 q"),
|
||||||
SetCursorStyle::SteadyBlock => f.write_str("\x1b[?12l\x1b[2 q"),
|
SetCursorStyle::SteadyBlock => f.write_str("\x1b[2 q"),
|
||||||
SetCursorStyle::BlinkingUnderScore => f.write_str("\x1b[?12h\x1b[3 q"),
|
SetCursorStyle::BlinkingUnderScore => f.write_str("\x1b[3 q"),
|
||||||
SetCursorStyle::SteadyUnderScore => f.write_str("\x1b[?12l\x1b[4 q"),
|
SetCursorStyle::SteadyUnderScore => f.write_str("\x1b[4 q"),
|
||||||
SetCursorStyle::BlinkingBar => f.write_str("\x1b[?12h\x1b[5 q"),
|
SetCursorStyle::BlinkingBar => f.write_str("\x1b[5 q"),
|
||||||
SetCursorStyle::SteadyBar => f.write_str("\x1b[?12l\x1b[6 q"),
|
SetCursorStyle::SteadyBar => f.write_str("\x1b[6 q"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,15 +41,14 @@
|
|||||||
//! - Module [`cursor`](cursor/index.html)
|
//! - Module [`cursor`](cursor/index.html)
|
||||||
//! - Visibility - [`Show`](cursor/struct.Show.html), [`Hide`](cursor/struct.Hide.html)
|
//! - Visibility - [`Show`](cursor/struct.Show.html), [`Hide`](cursor/struct.Hide.html)
|
||||||
//! - Appearance - [`EnableBlinking`](cursor/struct.EnableBlinking.html),
|
//! - Appearance - [`EnableBlinking`](cursor/struct.EnableBlinking.html),
|
||||||
//! [`DisableBlinking`](cursor/struct.DisableBlinking.html)
|
//! [`DisableBlinking`](cursor/struct.DisableBlinking.html),
|
||||||
|
//! [`SetCursorStyle`](cursor/enum.SetCursorStyle.html)
|
||||||
//! - Position -
|
//! - Position -
|
||||||
//! [`SavePosition`](cursor/struct.SavePosition.html), [`RestorePosition`](cursor/struct.RestorePosition.html),
|
//! [`SavePosition`](cursor/struct.SavePosition.html), [`RestorePosition`](cursor/struct.RestorePosition.html),
|
||||||
//! [`MoveUp`](cursor/struct.MoveUp.html), [`MoveDown`](cursor/struct.MoveDown.html),
|
//! [`MoveUp`](cursor/struct.MoveUp.html), [`MoveDown`](cursor/struct.MoveDown.html),
|
||||||
//! [`MoveLeft`](cursor/struct.MoveLeft.html), [`MoveRight`](cursor/struct.MoveRight.html),
|
//! [`MoveLeft`](cursor/struct.MoveLeft.html), [`MoveRight`](cursor/struct.MoveRight.html),
|
||||||
//! [`MoveTo`](cursor/struct.MoveTo.html), [`MoveToColumn`](cursor/struct.MoveToColumn.html),[`MoveToRow`](cursor/struct.MoveToRow.html),
|
//! [`MoveTo`](cursor/struct.MoveTo.html), [`MoveToColumn`](cursor/struct.MoveToColumn.html),[`MoveToRow`](cursor/struct.MoveToRow.html),
|
||||||
//! [`MoveToNextLine`](cursor/struct.MoveToNextLine.html), [`MoveToPreviousLine`](cursor/struct.MoveToPreviousLine.html)
|
//! [`MoveToNextLine`](cursor/struct.MoveToNextLine.html), [`MoveToPreviousLine`](cursor/struct.MoveToPreviousLine.html)
|
||||||
//! - Shape -
|
|
||||||
//! [`SetCursorShape`](cursor/struct.SetCursorShape.html)
|
|
||||||
//! - Module [`event`](event/index.html)
|
//! - Module [`event`](event/index.html)
|
||||||
//! - Keyboard events -
|
//! - Keyboard events -
|
||||||
//! [`PushKeyboardEnhancementFlags`](event/struct.PushKeyboardEnhancementFlags.html),
|
//! [`PushKeyboardEnhancementFlags`](event/struct.PushKeyboardEnhancementFlags.html),
|
||||||
|
Loading…
Reference in New Issue
Block a user