зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-08 08:25:51 +03:00
show 'Available on crate feature search only' on docs.rs
Этот коммит содержится в:
@@ -66,3 +66,4 @@ lto = "thin"
|
|||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
all-features = true
|
all-features = true
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#![allow(clippy::needless_range_loop)]
|
#![allow(clippy::needless_range_loop)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(clippy::dbg_macro, clippy::print_stdout)]
|
#![warn(clippy::dbg_macro, clippy::print_stdout)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
mod cursor;
|
mod cursor;
|
||||||
|
|||||||
@@ -1312,6 +1312,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert!(textarea.set_search_pattern("(hello").is_err());
|
/// assert!(textarea.set_search_pattern("(hello").is_err());
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn set_search_pattern(&mut self, query: impl AsRef<str>) -> Result<(), regex::Error> {
|
pub fn set_search_pattern(&mut self, query: impl AsRef<str>) -> Result<(), regex::Error> {
|
||||||
self.search.set_pattern(query.as_ref())
|
self.search.set_pattern(query.as_ref())
|
||||||
}
|
}
|
||||||
@@ -1330,6 +1331,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert_eq!(textarea.search_pattern().unwrap().as_str(), "hello+");
|
/// assert_eq!(textarea.search_pattern().unwrap().as_str(), "hello+");
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn search_pattern(&self) -> Option<®ex::Regex> {
|
pub fn search_pattern(&self) -> Option<®ex::Regex> {
|
||||||
self.search.pat.as_ref()
|
self.search.pat.as_ref()
|
||||||
}
|
}
|
||||||
@@ -1372,6 +1374,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert!(!match_found);
|
/// assert!(!match_found);
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn search_forward(&mut self, match_cursor: bool) -> bool {
|
pub fn search_forward(&mut self, match_cursor: bool) -> bool {
|
||||||
if let Some(cursor) = self.search.forward(&self.lines, self.cursor, match_cursor) {
|
if let Some(cursor) = self.search.forward(&self.lines, self.cursor, match_cursor) {
|
||||||
self.cursor = cursor;
|
self.cursor = cursor;
|
||||||
@@ -1415,6 +1418,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert!(!match_found);
|
/// assert!(!match_found);
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn search_back(&mut self, match_cursor: bool) -> bool {
|
pub fn search_back(&mut self, match_cursor: bool) -> bool {
|
||||||
if let Some(cursor) = self.search.back(&self.lines, self.cursor, match_cursor) {
|
if let Some(cursor) = self.search.back(&self.lines, self.cursor, match_cursor) {
|
||||||
self.cursor = cursor;
|
self.cursor = cursor;
|
||||||
@@ -1435,6 +1439,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert_eq!(textarea.search_style(), Style::default().bg(Color::Blue));
|
/// assert_eq!(textarea.search_style(), Style::default().bg(Color::Blue));
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn search_style(&self) -> Style {
|
pub fn search_style(&self) -> Style {
|
||||||
self.search.style
|
self.search.style
|
||||||
}
|
}
|
||||||
@@ -1452,6 +1457,7 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert_eq!(textarea.search_style(), red_bg);
|
/// assert_eq!(textarea.search_style(), red_bg);
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "search")]
|
#[cfg(feature = "search")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "search")))]
|
||||||
pub fn set_search_style(&mut self, style: Style) {
|
pub fn set_search_style(&mut self, style: Style) {
|
||||||
self.search.style = style;
|
self.search.style = style;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user