summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-11 15:39:32 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-11 15:39:32 +0200
commit790bd536eba76a2a48d61ea6b1bde78cde3d31f3 (patch)
tree42833b51db568aa6fa474ad1becf367319a7b0b1 /src/syntax
parent3cc026cf394b8af6159b8f939762b23bb5a3bc7d (diff)
Fix incremental bugs
Co-Authored-By: Martin Haug <mhaug@live.de>
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs4
-rw-r--r--src/syntax/highlight.rs1
-rw-r--r--src/syntax/mod.rs7
3 files changed, 3 insertions, 9 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 97ab055f..087b8d77 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -63,9 +63,7 @@ impl Markup {
NodeKind::Space(2 ..) => Some(MarkupNode::Parbreak),
NodeKind::Space(_) => Some(MarkupNode::Space),
NodeKind::Linebreak => Some(MarkupNode::Linebreak),
- NodeKind::Text(s) | NodeKind::TextInLine(s) => {
- Some(MarkupNode::Text(s.clone()))
- }
+ NodeKind::Text(s) => Some(MarkupNode::Text(s.clone())),
NodeKind::Escape(c) => Some(MarkupNode::Text((*c).into())),
NodeKind::NonBreakingSpace => Some(MarkupNode::Text('\u{00A0}'.into())),
NodeKind::EnDash => Some(MarkupNode::Text('\u{2013}'.into())),
diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs
index b0486c7b..25b458ef 100644
--- a/src/syntax/highlight.rs
+++ b/src/syntax/highlight.rs
@@ -195,7 +195,6 @@ impl Category {
NodeKind::Markup(_) => None,
NodeKind::Space(_) => None,
NodeKind::Text(_) => None,
- NodeKind::TextInLine(_) => None,
NodeKind::List => None,
NodeKind::Enum => None,
NodeKind::CodeBlock => None,
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs
index b4908ff2..5857940c 100644
--- a/src/syntax/mod.rs
+++ b/src/syntax/mod.rs
@@ -590,8 +590,6 @@ pub enum NodeKind {
Linebreak,
/// A consecutive non-markup string.
Text(EcoString),
- /// A text node that cannot appear at the beginning of a source line.
- TextInLine(EcoString),
/// A non-breaking space: `~`.
NonBreakingSpace,
/// An en-dash: `--`.
@@ -757,6 +755,7 @@ impl NodeKind {
pub fn only_at_start(&self) -> bool {
match self {
Self::Heading | Self::Enum | Self::List => true,
+ Self::Text(t) => t == "-" || t.ends_with('.'),
_ => false,
}
}
@@ -767,7 +766,6 @@ impl NodeKind {
Self::Markup(_)
| Self::Linebreak
| Self::Text(_)
- | Self::TextInLine(_)
| Self::NonBreakingSpace
| Self::EnDash
| Self::EmDash
@@ -859,7 +857,7 @@ impl NodeKind {
Self::Space(2 ..) => "paragraph break",
Self::Space(_) => "space",
Self::Linebreak => "forced linebreak",
- Self::Text(_) | Self::TextInLine(_) => "text",
+ Self::Text(_) => "text",
Self::NonBreakingSpace => "non-breaking space",
Self::EnDash => "en dash",
Self::EmDash => "em dash",
@@ -980,7 +978,6 @@ impl Hash for NodeKind {
Self::Space(n) => n.hash(state),
Self::Linebreak => {}
Self::Text(s) => s.hash(state),
- Self::TextInLine(s) => s.hash(state),
Self::NonBreakingSpace => {}
Self::EnDash => {}
Self::EmDash => {}