mirror of
https://github.com/typst/typst
synced 2025-08-23 19:24:14 +08:00
Compare commits
No commits in common. "e632bffc2ed4c005e5e989b527a05e87f077a8a0" and "832fab58b31a16d049418bdbfe98b0352758579f" have entirely different histories.
e632bffc2e
...
832fab58b3
@ -298,20 +298,13 @@ fn complete_math(ctx: &mut CompletionContext) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start of an interpolated identifier: "$#|$".
|
||||
// Start of an interpolated identifier: "#|".
|
||||
if ctx.leaf.kind() == SyntaxKind::Hash {
|
||||
ctx.from = ctx.cursor;
|
||||
code_completions(ctx, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Behind existing interpolated identifier: "$#pa|$".
|
||||
if ctx.leaf.kind() == SyntaxKind::Ident {
|
||||
ctx.from = ctx.leaf.offset();
|
||||
code_completions(ctx, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Behind existing atom or identifier: "$a|$" or "$abc|$".
|
||||
if matches!(
|
||||
ctx.leaf.kind(),
|
||||
@ -1673,13 +1666,6 @@ mod tests {
|
||||
test("#{() .a}", -2).must_include(["at", "any", "all"]);
|
||||
}
|
||||
|
||||
/// Test that autocomplete in math uses the correct global scope.
|
||||
#[test]
|
||||
fn test_autocomplete_math_scope() {
|
||||
test("$#col$", -2).must_include(["colbreak"]).must_exclude(["colon"]);
|
||||
test("$col$", -2).must_include(["colon"]).must_exclude(["colbreak"]);
|
||||
}
|
||||
|
||||
/// Test that the `before_window` doesn't slice into invalid byte
|
||||
/// boundaries.
|
||||
#[test]
|
||||
|
@ -114,9 +114,7 @@ pub fn globals<'a>(world: &'a dyn IdeWorld, leaf: &LinkedNode) -> &'a Scope {
|
||||
| Some(SyntaxKind::Math)
|
||||
| Some(SyntaxKind::MathFrac)
|
||||
| Some(SyntaxKind::MathAttach)
|
||||
) && leaf
|
||||
.prev_leaf()
|
||||
.is_none_or(|prev| !matches!(prev.kind(), SyntaxKind::Hash));
|
||||
);
|
||||
|
||||
let library = world.library();
|
||||
if in_math {
|
||||
|
@ -549,7 +549,7 @@ impl Gradient {
|
||||
}
|
||||
|
||||
/// Repeats this gradient a given number of times, optionally mirroring it
|
||||
/// at every second repetition.
|
||||
/// at each repetition.
|
||||
///
|
||||
/// ```example
|
||||
/// #circle(
|
||||
@ -564,17 +564,7 @@ impl Gradient {
|
||||
&self,
|
||||
/// The number of times to repeat the gradient.
|
||||
repetitions: Spanned<usize>,
|
||||
/// Whether to mirror the gradient at every second repetition, i.e.,
|
||||
/// the first instance (and all odd ones) stays unchanged.
|
||||
///
|
||||
/// ```example
|
||||
/// #circle(
|
||||
/// radius: 40pt,
|
||||
/// fill: gradient
|
||||
/// .conic(green, black)
|
||||
/// .repeat(2, mirror: true)
|
||||
/// )
|
||||
/// ```
|
||||
/// Whether to mirror the gradient at each repetition.
|
||||
#[named]
|
||||
#[default(false)]
|
||||
mirror: bool,
|
||||
|
@ -112,18 +112,11 @@
|
||||
a few more functions that create delimiter pairings for absolute, ceiled,
|
||||
and floored values as well as norms.
|
||||
|
||||
To prevent a delimiter from being matched by Typst, and thus auto-scaled,
|
||||
escape it with a backslash. To instead disable auto-scaling completely, use
|
||||
`{set math.lr(size: 1em)}`.
|
||||
|
||||
# Example
|
||||
```example
|
||||
$ [a, b/2] $
|
||||
$ lr(]sum_(x=1)^n], size: #50%) x $
|
||||
$ abs((x + y) / 2) $
|
||||
$ \{ (x / y) \} $
|
||||
#set math.lr(size: 1em)
|
||||
$ { (a / b), a, b in (0; 1/2] } $
|
||||
```
|
||||
|
||||
- name: calc
|
||||
|
Loading…
x
Reference in New Issue
Block a user