Skip to content

Commit fc86c16

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 425e573 commit fc86c16

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
@@ -403,9 +403,13 @@ function symbol_latex(s::String)
403403
return get(symbols_latex, s, "")
404404
end
405405
function repl_latex(io::IO, s::String)
406-
# decompose NFC-normalized identifier to match tab-completion input
407-
s = normalize(s, :NFD)
408406
latex = symbol_latex(s)
407+
if isempty(latex)
408+
# Decompose NFC-normalized identifier to match tab-completion
409+
# input if the first search came up empty.
410+
s = normalize(s, :NFD)
411+
latex = symbol_latex(s)
412+
end
409413
if !isempty(latex)
410414
print(io, "\"")
411415
printstyled(io, s, color=:cyan)

test/docs.jl

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

12721272
# issue #36378 (\u1e8b and x\u307 are the fully composed and decomposed forms of ẋ, respectively)
12731273
@test sprint(repl_latex, "\u1e8b") == "\"x\u307\" can be typed by x\\dot<tab>\n\n"
1274+
# issue 39814
1275+
@test sprint(repl_latex, "\u2209") == "\"\u2209\" can be typed by \\notin<tab>\n\n"
12741276

12751277
# issue #15684
12761278
begin

0 commit comments

Comments
 (0)