Skip to content

Commit 0c869cc

Browse files
GunnarFarnebackKristofferC
authored andcommitted
[REPL] 0nly do NFD normalization for latex tab-completion help if no match without it (#41870)
(cherry picked from commit ab600f8)
1 parent 1e3bd52 commit 0c869cc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

stdlib/REPL/src/docview.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,13 @@ function symbol_latex(s::String)
338338
return get(symbols_latex, s, "")
339339
end
340340
function repl_latex(io::IO, s::String)
341-
# decompose NFC-normalized identifier to match tab-completion input
342-
s = normalize(s, :NFD)
343341
latex = symbol_latex(s)
342+
if isempty(latex)
343+
# Decompose NFC-normalized identifier to match tab-completion
344+
# input if the first search came up empty.
345+
s = normalize(s, :NFD)
346+
latex = symbol_latex(s)
347+
end
344348
if !isempty(latex)
345349
print(io, "\"")
346350
printstyled(io, s, color=:cyan)

test/docs.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,8 @@ end
10091009

10101010
# issue #36378 (\u1e8b and x\u307 are the fully composed and decomposed forms of ẋ, respectively)
10111011
@test sprint(repl_latex, "\u1e8b") == "\"x\u307\" can be typed by x\\dot<tab>\n\n"
1012+
# issue 39814
1013+
@test sprint(repl_latex, "\u2209") == "\"\u2209\" can be typed by \\notin<tab>\n\n"
10121014

10131015
# issue #15684
10141016
begin

0 commit comments

Comments
 (0)