mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Update dependencies
This commit is contained in:
parent
df0391aef2
commit
00f4b27794
18
CHANGELOG.md
18
CHANGELOG.md
@ -1,6 +1,22 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
# Next version (0.11.2)
|
## 0.12.0
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
|
||||||
|
- Updated `enumset` from 0.3 to 0.4
|
||||||
|
|
||||||
|
### API updates
|
||||||
|
|
||||||
|
- Add `Cursive::take_user_data`, replaces the current user data with `()`.
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- `DebugConsole` now has horizontal scrolling enabled.
|
||||||
|
- `pancurses` backend now correctly recognizes the "Enter" key from the numpad
|
||||||
|
as "Enter".
|
||||||
|
|
||||||
|
## 0.11.2
|
||||||
|
|
||||||
### API updates
|
### API updates
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ repository = "gyscos/Cursive"
|
|||||||
repository = "gyscos/Cursive"
|
repository = "gyscos/Cursive"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
enum-map = "0.5.0"
|
enum-map = "0.5"
|
||||||
enumset = "0.3.17"
|
enumset = "0.4"
|
||||||
log = "0.4.6"
|
log = "0.4.6"
|
||||||
owning_ref = "0.4.0"
|
owning_ref = "0.4.0"
|
||||||
toml = "0.5.0"
|
toml = "0.5.0"
|
||||||
@ -32,7 +32,7 @@ term_size = { version = "0.3.1", optional = true }
|
|||||||
crossbeam-channel = "0.3.8"
|
crossbeam-channel = "0.3.8"
|
||||||
lazy_static = "1.3.0"
|
lazy_static = "1.3.0"
|
||||||
chrono = "0.4.6"
|
chrono = "0.4.6"
|
||||||
hashbrown = "0.2.1"
|
hashbrown = "0.3"
|
||||||
cfg-if = "0.1.7"
|
cfg-if = "0.1.7"
|
||||||
|
|
||||||
[dependencies.num]
|
[dependencies.num]
|
||||||
@ -60,7 +60,7 @@ version = "0.16.1"
|
|||||||
[dependencies.pulldown-cmark]
|
[dependencies.pulldown-cmark]
|
||||||
default-features = false
|
default-features = false
|
||||||
optional = true
|
optional = true
|
||||||
version = "0.4.1"
|
version = "0.5"
|
||||||
|
|
||||||
[dependencies.termion]
|
[dependencies.termion]
|
||||||
optional = true
|
optional = true
|
||||||
|
@ -62,7 +62,7 @@ impl Style {
|
|||||||
impl From<Effect> for Style {
|
impl From<Effect> for Style {
|
||||||
fn from(effect: Effect) -> Self {
|
fn from(effect: Effect) -> Self {
|
||||||
Style {
|
Style {
|
||||||
effects: enum_set!(Effect, effect),
|
effects: enum_set!(effect),
|
||||||
color: None,
|
color: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
//! Parse various text markup formats.
|
|
||||||
//!
|
|
||||||
//! Each module is optional and relies on a feature.
|
|
||||||
|
|
||||||
#[cfg(feature = "markdown")]
|
|
||||||
pub mod markdown;
|
|
||||||
|
|
||||||
#[cfg(feature = "markdown")]
|
|
||||||
pub use self::markdown::MarkdownText;
|
|
||||||
use owning_ref::OwningHandle;
|
|
||||||
use owning_ref::StringRef;
|
|
||||||
use std::ops::Deref;
|
|
||||||
use theme::Style;
|
|
||||||
|
|
||||||
use utils::span::{StSpannedString;
|
|
||||||
|
|
||||||
/// A parsed string with markup style.
|
|
||||||
///
|
|
||||||
/// Contains both the source string, and parsed information indicating the
|
|
||||||
/// style to apply.
|
|
||||||
pub type StyledString = SpannedString<Style>;
|
|
||||||
|
|
||||||
pub type StyledIndexedSpan = IndexedSpan<Style>;
|
|
||||||
|
|
||||||
impl SpannedString<Style> {
|
|
||||||
/// Returns a plain StyledString without any style.
|
|
||||||
///
|
|
||||||
/// > You got no style, Dutch. You know that.
|
|
||||||
pub fn plain<S>(content: S) -> Self
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
{
|
|
||||||
Self::styled(content, Style::none())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new `StyledString` using a single style for the entire text.
|
|
||||||
pub fn styled<S, T>(content: S, style: T) -> Self
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
T: Into<Style>,
|
|
||||||
{
|
|
||||||
let content = content.into();
|
|
||||||
|
|
||||||
let spans = vec![
|
|
||||||
StyledIndexedSpan {
|
|
||||||
content: IndexedCow::Borrowed {
|
|
||||||
start: 0,
|
|
||||||
end: content.len(),
|
|
||||||
},
|
|
||||||
style: style.into(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
Self::new(content, spans)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Appends the given plain text to `self`.
|
|
||||||
pub fn append_plain<S>(&mut self, text: S)
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
{
|
|
||||||
self.append(Self::plain(text));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Appends `text` to `self`, using `style`.
|
|
||||||
pub fn append_styled<S, T>(&mut self, text: S, style: T)
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
T: Into<Style>,
|
|
||||||
{
|
|
||||||
self.append(Self::styled(text, style));
|
|
||||||
}
|
|
||||||
/// Appends the given plain text to `self`.
|
|
||||||
pub fn append_plain<S>(&mut self, text: S)
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
{
|
|
||||||
self.append(Self::plain(text));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Appends `text` to `self`, using `style`.
|
|
||||||
pub fn append_styled<S, T>(&mut self, text: S, style: T)
|
|
||||||
where
|
|
||||||
S: Into<String>,
|
|
||||||
T: Into<Style>,
|
|
||||||
{
|
|
||||||
self.append(Self::styled(text, style));
|
|
||||||
}
|
|
||||||
}
|
|
@ -82,7 +82,7 @@ impl<'a> Iterator for Parser<'a> {
|
|||||||
Tag::Rule => return Some(self.literal("---")),
|
Tag::Rule => return Some(self.literal("---")),
|
||||||
Tag::BlockQuote => return Some(self.literal("> ")),
|
Tag::BlockQuote => return Some(self.literal("> ")),
|
||||||
Tag::Link(_, _, _) => return Some(self.literal("[")),
|
Tag::Link(_, _, _) => return Some(self.literal("[")),
|
||||||
Tag::Code => return Some(self.literal("```")),
|
Tag::CodeBlock(_) => return Some(self.literal("```")),
|
||||||
Tag::Strong => self.stack.push(Style::from(Effect::Bold)),
|
Tag::Strong => self.stack.push(Style::from(Effect::Bold)),
|
||||||
Tag::Paragraph if !self.first => {
|
Tag::Paragraph if !self.first => {
|
||||||
return Some(self.literal("\n\n"))
|
return Some(self.literal("\n\n"))
|
||||||
@ -96,7 +96,7 @@ impl<'a> Iterator for Parser<'a> {
|
|||||||
Tag::Link(_, link, _) => {
|
Tag::Link(_, link, _) => {
|
||||||
return Some(self.literal(format!("]({})", link)))
|
return Some(self.literal(format!("]({})", link)))
|
||||||
}
|
}
|
||||||
Tag::Code => return Some(self.literal("```")),
|
Tag::CodeBlock(_) => return Some(self.literal("```")),
|
||||||
Tag::Emphasis | Tag::Strong => {
|
Tag::Emphasis | Tag::Strong => {
|
||||||
self.stack.pop().unwrap();
|
self.stack.pop().unwrap();
|
||||||
}
|
}
|
||||||
@ -108,7 +108,8 @@ impl<'a> Iterator for Parser<'a> {
|
|||||||
Event::FootnoteReference(text)
|
Event::FootnoteReference(text)
|
||||||
| Event::InlineHtml(text)
|
| Event::InlineHtml(text)
|
||||||
| Event::Html(text)
|
| Event::Html(text)
|
||||||
| Event::Text(text) => {
|
| Event::Text(text)
|
||||||
|
| Event::Code(text) => {
|
||||||
let text = match text {
|
let text = match text {
|
||||||
CowStr::Boxed(text) => Cow::Owned(text.into()),
|
CowStr::Boxed(text) => Cow::Owned(text.into()),
|
||||||
CowStr::Borrowed(text) => Cow::Borrowed(text),
|
CowStr::Borrowed(text) => Cow::Borrowed(text),
|
||||||
|
Loading…
Reference in New Issue
Block a user