From b28b4d84fa425b7097675e4ae0d6ff6025bcfb43 Mon Sep 17 00:00:00 2001 From: sholderbach Date: Thu, 14 Dec 2023 17:51:09 +0100 Subject: [PATCH 1/3] Exclude the clipboard feature for docs.rs builds The 0.27.0 docs.rs build failed as the `xcb` crate build.rs failed in the docs.rs sandbox. Exclude the clipboard feature for now and only enable: - `bashisms` - `external_printer` - `sqlite` (should be pretty similar to `sqlite-dynlib`) --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3c8d0ed4..481b3db5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,4 +56,5 @@ required-features = ["external_printer"] [package.metadata.docs.rs] # Whether to pass `--all-features` to Cargo (default: false) -all-features = true +all-features = false +features = ["bashisms", "external_printer", "sqlite"] From fd407e65b14bee2cf2f8df23e1abc46dff3640b7 Mon Sep 17 00:00:00 2001 From: sholderbach Date: Thu, 14 Dec 2023 18:03:07 +0100 Subject: [PATCH 2/3] Fix hyperlink formatting --- src/edit_mode/vi/parser.rs | 2 +- src/engine.rs | 2 +- src/history/item.rs | 5 +++-- src/terminal_extensions/bracketed_paste.rs | 2 +- src/terminal_extensions/kitty.rs | 2 +- src/terminal_extensions/mod.rs | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/edit_mode/vi/parser.rs b/src/edit_mode/vi/parser.rs index f243e53b..e04bd5a6 100644 --- a/src/edit_mode/vi/parser.rs +++ b/src/edit_mode/vi/parser.rs @@ -67,7 +67,7 @@ impl ParsedViSequence { /// /// ### Note: /// - /// https://github.com/vim/vim/blob/140f6d0eda7921f2f0b057ec38ed501240903fc3/runtime/doc/motion.txt#L64-L70 + /// fn total_multiplier(&self) -> usize { self.multiplier.unwrap_or(1) * self.count.unwrap_or(1) } diff --git a/src/engine.rs b/src/engine.rs index e4ca9c7e..852d1eeb 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -254,7 +254,7 @@ impl Reedline { /// You can check for that with [`crate::kitty_protocol_available`] /// `Reedline` will perform this check internally /// - /// Read more: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ + /// Read more: pub fn use_kitty_keyboard_enhancement(mut self, enable: bool) -> Self { self.kitty_protocol.set(enable); self diff --git a/src/history/item.rs b/src/history/item.rs index 0c36fba3..d94af11b 100644 --- a/src/history/item.rs +++ b/src/history/item.rs @@ -98,8 +98,9 @@ pub struct HistoryItem { /// the exit status of the command pub exit_status: Option, /// arbitrary additional information that might be interesting - /// NOTE: this attribute is required because of https://github.com/rust-lang/rust/issues/41617 - /// (see https://github.com/serde-rs/serde/issues/1296#issuecomment-394056188 for the fix) + /// NOTE: this attribute is required because of + /// + /// (see for the fix) #[serde(deserialize_with = "Option::::deserialize")] pub more_info: Option, } diff --git a/src/terminal_extensions/bracketed_paste.rs b/src/terminal_extensions/bracketed_paste.rs index b6601cd8..81eea476 100644 --- a/src/terminal_extensions/bracketed_paste.rs +++ b/src/terminal_extensions/bracketed_paste.rs @@ -2,7 +2,7 @@ use crossterm::{event, execute}; /// Helper managing proper setup and teardown of bracketed paste mode /// -/// https://en.wikipedia.org/wiki/Bracketed-paste +/// #[derive(Default)] pub(crate) struct BracketedPasteGuard { enabled: bool, diff --git a/src/terminal_extensions/kitty.rs b/src/terminal_extensions/kitty.rs index e6bdd637..65fb6e34 100644 --- a/src/terminal_extensions/kitty.rs +++ b/src/terminal_extensions/kitty.rs @@ -11,7 +11,7 @@ use crossterm::{event, execute}; /// * [kakoune text editor](https://github.com/mawww/kakoune/issues/4103) /// * [dte text editor](https://gitlab.com/craigbarnes/dte/-/issues/138) /// -/// Refer to https://sw.kovidgoyal.net/kitty/keyboard-protocol/ if you're curious. +/// Refer to if you're curious. #[derive(Default)] pub(crate) struct KittyProtocolGuard { enabled: bool, diff --git a/src/terminal_extensions/mod.rs b/src/terminal_extensions/mod.rs index 927c96b5..b6f2dbeb 100644 --- a/src/terminal_extensions/mod.rs +++ b/src/terminal_extensions/mod.rs @@ -3,7 +3,7 @@ pub(crate) mod kitty; /// Return if the terminal supports the kitty keyboard enhancement protocol /// -/// Read more: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ +/// Read more: /// /// SIDE EFFECT: Touches the terminal file descriptors pub fn kitty_protocol_available() -> bool { From b1230d3e280e7eb0aee3c45a7fb2dd1df7a62cde Mon Sep 17 00:00:00 2001 From: sholderbach Date: Thu, 14 Dec 2023 18:23:07 +0100 Subject: [PATCH 3/3] Manually mention required features --- src/engine.rs | 3 +++ src/external_printer.rs | 3 +++ src/history/sqlite_backed.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/engine.rs b/src/engine.rs index 852d1eeb..43555eec 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -1697,6 +1697,9 @@ impl Reedline { } /// Adds an external printer + /// + /// ## Required feature: + /// `external_printer` #[cfg(feature = "external_printer")] pub fn with_external_printer(mut self, printer: ExternalPrinter) -> Self { self.external_printer = Some(printer); diff --git a/src/external_printer.rs b/src/external_printer.rs index c2cdf707..f4c71e7c 100644 --- a/src/external_printer.rs +++ b/src/external_printer.rs @@ -17,6 +17,9 @@ pub const EXTERNAL_PRINTER_DEFAULT_CAPACITY: usize = 20; /// An ExternalPrinter allows to print messages of text while editing a line. /// The message is printed as a new line, the line-edit will continue below the /// output. +/// +/// ## Required feature: +/// `external_printer` #[cfg(feature = "external_printer")] #[derive(Debug, Clone)] pub struct ExternalPrinter diff --git a/src/history/sqlite_backed.rs b/src/history/sqlite_backed.rs index 7ab56e96..ec3b021a 100644 --- a/src/history/sqlite_backed.rs +++ b/src/history/sqlite_backed.rs @@ -14,6 +14,9 @@ const SQLITE_APPLICATION_ID: i32 = 1151497937; /// A history that stores the values to an SQLite database. /// In addition to storing the command, the history can store an additional arbitrary HistoryEntryContext, /// to add information such as a timestamp, running directory, result... +/// +/// ## Required feature: +/// `sqlite` or `sqlite-dynlib` pub struct SqliteBackedHistory { db: rusqlite::Connection, session: Option,