From ab600f8ce704cafd519581ad62858d00f82a40d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnar=20Farneb=C3=A4ck?= Date: Mon, 16 Aug 2021 19:32:52 +0200 Subject: [PATCH] [REPL] 0nly do NFD normalization for latex tab-completion help if no match without it (#41870) --- stdlib/REPL/src/docview.jl | 8 ++++++-- test/docs.jl | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index 2e5fc361d8cbc..f4467b3e787bc 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -403,9 +403,13 @@ function symbol_latex(s::String) return get(symbols_latex, s, "") end function repl_latex(io::IO, s::String) - # decompose NFC-normalized identifier to match tab-completion input - s = normalize(s, :NFD) latex = symbol_latex(s) + if isempty(latex) + # Decompose NFC-normalized identifier to match tab-completion + # input if the first search came up empty. + s = normalize(s, :NFD) + latex = symbol_latex(s) + end if !isempty(latex) print(io, "\"") printstyled(io, s, color=:cyan) diff --git a/test/docs.jl b/test/docs.jl index 05442df9d4cbe..41c3746d7476f 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -1271,6 +1271,8 @@ end # issue #36378 (\u1e8b and x\u307 are the fully composed and decomposed forms of ẋ, respectively) @test sprint(repl_latex, "\u1e8b") == "\"x\u307\" can be typed by x\\dot\n\n" +# issue 39814 +@test sprint(repl_latex, "\u2209") == "\"\u2209\" can be typed by \\notin\n\n" # issue #15684 begin