summaryrefslogtreecommitdiff
path: root/src/layout/tree.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-04 20:22:11 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-04 20:22:11 +0200
commitef8aa763faa59fd62c90c6d6245e8d2c5eece35e (patch)
treed36192af0c770b076a5004ba8bcae3c2df728c75 /src/layout/tree.rs
parenta41d7ab47dda1e30465bdf91fd02bca0e634a38d (diff)
Shorten some names ↔
Diffstat (limited to 'src/layout/tree.rs')
-rw-r--r--src/layout/tree.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs
index 4dbf716e..5468a7cd 100644
--- a/src/layout/tree.rs
+++ b/src/layout/tree.rs
@@ -4,7 +4,7 @@ use super::*;
use crate::eval::Eval;
use crate::shaping;
use crate::syntax::{
- Decoration, Expr, NodeHeading, NodeRaw, Span, SpanWith, Spanned, SynNode, SynTree,
+ Deco, Expr, NodeHeading, NodeRaw, Span, SpanWith, Spanned, SynNode, SynTree,
};
use crate::DynFuture;
@@ -52,18 +52,18 @@ impl<'a> TreeLayouter<'a> {
}
async fn layout_node(&mut self, node: &Spanned<SynNode>) {
- let decorate = |this: &mut Self, deco: Decoration| {
- this.ctx.f.decorations.push(deco.span_with(node.span));
+ let decorate = |this: &mut Self, deco: Deco| {
+ this.ctx.f.decos.push(deco.span_with(node.span));
};
match &node.v {
SynNode::Space => self.layout_space(),
SynNode::Text(text) => {
if self.ctx.state.text.emph {
- decorate(self, Decoration::Emph);
+ decorate(self, Deco::Emph);
}
if self.ctx.state.text.strong {
- decorate(self, Decoration::Strong);
+ decorate(self, Deco::Strong);
}
self.layout_text(text).await;
}
@@ -72,11 +72,11 @@ impl<'a> TreeLayouter<'a> {
SynNode::Parbreak => self.layout_parbreak(),
SynNode::Emph => {
self.ctx.state.text.emph ^= true;
- decorate(self, Decoration::Emph);
+ decorate(self, Deco::Emph);
}
SynNode::Strong => {
self.ctx.state.text.strong ^= true;
- decorate(self, Decoration::Strong);
+ decorate(self, Deco::Strong);
}
SynNode::Heading(heading) => self.layout_heading(heading).await,
@@ -95,7 +95,7 @@ impl<'a> TreeLayouter<'a> {
fn layout_parbreak(&mut self) {
self.layouter.add_secondary_spacing(
- self.ctx.state.text.paragraph_spacing(),
+ self.ctx.state.text.par_spacing(),
SpacingKind::PARAGRAPH,
);
}
@@ -188,7 +188,7 @@ impl<'a> TreeLayouter<'a> {
} else {
error!(
@self.ctx.f, span,
- "page break cannot only be issued from root context",
+ "page break can only be issued from root context",
);
}
}
@@ -214,7 +214,7 @@ impl<'a> TreeLayouter<'a> {
} else {
error!(
@self.ctx.f, span,
- "page style cannot only be changed from root context",
+ "page style can only be changed from root context",
);
}
}