Skip to content

Commit

Permalink
adjustment to JuliaLang/Pkg.jl#3777
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 12, 2024
1 parent 78a4d87 commit 2d81cac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/BracketInserter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ enable_autocomplete_brackets(v::Bool) = AUTOMATIC_BRACKET_MATCH[] = v

const pkgmode = Ref{Any}()
import Pkg
@static if isdefined(Pkg.REPLMode, :promptf)
const pkg_prompf = Pkg.REPLMode.promptf
else # after https://github.com/JuliaLang/Pkg.jl/pull/3777
let REPLExt = Base.get_extension(Pkg, :REPLExt)
global const pkg_prompf = REPLExt.promptf
end
end
function insert_into_keymap!(D::Dict)
left_brackets = ['(', '{', '[']
right_brackets = [')', '}', ']']
Expand Down Expand Up @@ -81,7 +88,7 @@ function insert_into_keymap!(D::Dict)
found_pkg = false
for mode in Base.active_repl.interface.modes
if mode isa LineEdit.Prompt
if mode.prompt == Pkg.REPLMode.promptf
if mode.prompt == pkg_promptf
found_pkg = true
pkgmode[] = mode
end
Expand Down

0 comments on commit 2d81cac

Please sign in to comment.