Skip to content

Commit 2b6036e

Browse files
committed
adds latex lookup
1 parent cb2e1ec commit 2b6036e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ New language features
1111
- `` (U+U+1D45), `` (U+1D4B), `` (U+1DB2), `˱` (U+02F1), `˲` (U+02F2), and `` (U+2094) can now also be used as
1212
operator suffixes, accessible as `\^alpha`, `\^epsilon`, `\^ltphi`, `\_<`, `\_>`, and `\_schwa` at the REPL
1313
([#60285]).
14+
- Latex expansions can now be searched like `\?search<tab>` to show all symbols *containing* rather than starting
15+
with the search string ([#61464]).
1416
- The `@label` macro can now create labeled blocks that can be exited early with `break name [value]`. Use
1517
`@label name expr` for named blocks or `@label expr` for anonymous blocks. Anonymous `@label` blocks
1618
participate in the default break scope: a plain `break` or `break _` exits the innermost breakable scope,

stdlib/REPL/src/REPLCompletions.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,9 @@ function bslash_completions(string::String, pos::Int, hint::Bool=false)
879879
# return possible matches; these cannot be mixed with regular
880880
# Julian completions as only latex / emoji symbols contain the leading \
881881
symbol_dict = startswith(s, "\\:") ? emoji_symbols : latex_symbols
882-
namelist = Iterators.filter(k -> startswith(k, s), keys(symbol_dict))
883-
completions = Completion[BslashCompletion(name, "$(symbol_dict[name]) $name") for name in sort!(collect(namelist))]
882+
filt = startswith(s, "\\?") ? k -> contains(k, s[3:end]) : k -> startswith(k, s)
883+
namelist = Iterators.filter(filt, keys(symbol_dict)) |> collect |> sort!
884+
completions = Completion[BslashCompletion(name, "$(symbol_dict[name]) $name") for name in namelist]
884885
return (true, (completions, slashpos:pos, true))
885886
end
886887
return (false, (Completion[], 1:0, false))

0 commit comments

Comments
 (0)