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 e2645de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/BracketInserter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ 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
const pkg_prompf = Base.get_extension(Pkg, :REPLExt).promptf
end
function insert_into_keymap!(D::Dict)
left_brackets = ['(', '{', '[']
right_brackets = [')', '}', ']']
Expand Down Expand Up @@ -81,7 +86,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 e2645de

Please # to comment.