From bbcd77332e676a4f494b71551faa252c8d6eae75 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Sun, 7 Jan 2018 14:34:44 +0100 Subject: [PATCH] fix autocompleting in cmd (#25410) --- base/repl/REPLCompletions.jl | 2 +- test/replcompletions.jl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/base/repl/REPLCompletions.jl b/base/repl/REPLCompletions.jl index 4c88d236fee6f..4c80882b94a2e 100644 --- a/base/repl/REPLCompletions.jl +++ b/base/repl/REPLCompletions.jl @@ -495,7 +495,7 @@ function completions(string, pos) # otherwise... if inc_tag in [:cmd, :string] - m = match(r"[\t\n\r\"><=*?|]| (?!\\)", reverse(partial)) + m = match(r"[\t\n\r\"`><=*?|]| (?!\\)", reverse(partial)) startpos = nextind(partial, reverseind(partial, m.offset)) r = startpos:pos diff --git a/test/replcompletions.jl b/test/replcompletions.jl index 497baa63a096d..116296ba3bb42 100644 --- a/test/replcompletions.jl +++ b/test/replcompletions.jl @@ -207,6 +207,12 @@ let s = "Pkg.add(\"lol" @test res == false end +# inexistent completion inside a cmd +let s = "run(`lol" + c, r, res = test_complete(s) + @test res == false +end + # test latex symbol completions let s = "\\alpha" c, r = test_bslashcomplete(s) @@ -888,3 +894,4 @@ test_dict_completion("test_repl_comp_customdict") c, r, res = test_complete("CompletionFoo.tϵsτc") @test "tϵsτcmδ`" in c end +