Small fixes
This commit is contained in:
parent
4653ffebb4
commit
33585d9a3f
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1094,6 +1094,7 @@ dependencies = [
|
||||
"flate2",
|
||||
"if_chain",
|
||||
"image",
|
||||
"log",
|
||||
"miniz_oxide 0.5.4",
|
||||
"once_cell",
|
||||
"pdf-writer",
|
||||
|
@ -19,6 +19,7 @@ comemo = { git = "https://github.com/typst/comemo" }
|
||||
flate2 = "1"
|
||||
if_chain = "1"
|
||||
image = { version = "0.24", default-features = false, features = ["png", "jpeg", "gif"] }
|
||||
log = "0.4"
|
||||
miniz_oxide = "0.5"
|
||||
once_cell = "1"
|
||||
pdf-writer = "0.6"
|
||||
|
@ -31,7 +31,7 @@ impl VecNode {
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// #set vec(delim: "[")
|
||||
/// #set math.vec(delim: "[")
|
||||
/// $ vec(1, 2) $
|
||||
/// ```
|
||||
pub const DELIM: Delimiter = Delimiter::Paren;
|
||||
|
@ -56,6 +56,7 @@ pub fn module() -> Module {
|
||||
math.def_func::<FloorFunc>("floor");
|
||||
math.def_func::<CeilFunc>("ceil");
|
||||
math.def_func::<AbsFunc>("abs");
|
||||
math.def_func::<NormFunc>("norm");
|
||||
math.def_func::<AccentNode>("accent");
|
||||
math.def_func::<FracNode>("frac");
|
||||
math.def_func::<BinomNode>("binom");
|
||||
|
@ -37,7 +37,7 @@ impl LayoutMath for SqrtNode {
|
||||
///
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// $ radical(3, x) $
|
||||
/// $ root(3, x) $
|
||||
/// ```
|
||||
///
|
||||
/// ## Parameters
|
||||
|
@ -191,6 +191,13 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
|
||||
| SyntaxKind::Frac,
|
||||
) => Some(Category::Interpolated),
|
||||
Some(SyntaxKind::FuncCall) => Some(Category::Function),
|
||||
Some(SyntaxKind::FieldAccess)
|
||||
if node.parent().and_then(|p| p.parent_kind())
|
||||
== Some(SyntaxKind::SetRule)
|
||||
&& node.next_sibling().is_none() =>
|
||||
{
|
||||
Some(Category::Function)
|
||||
}
|
||||
Some(SyntaxKind::FieldAccess)
|
||||
if node
|
||||
.parent()
|
||||
|
@ -429,6 +429,7 @@ impl Lexer<'_> {
|
||||
'-' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
||||
'=' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
||||
':' if self.s.eat_if('=') => SyntaxKind::Shorthand,
|
||||
'.' if self.s.eat_if("..") => SyntaxKind::Shorthand,
|
||||
|
||||
'_' => SyntaxKind::Underscore,
|
||||
'$' => SyntaxKind::Dollar,
|
||||
|
Loading…
x
Reference in New Issue
Block a user