Skip to content

Commit

Permalink
fix GAP help access for Julia nightly
Browse files Browse the repository at this point in the history
In Julia 1.12, one can use `default_terminal()`
instead of `REPL.TerminalMenus.terminal`.
  • Loading branch information
ThomasBreuer committed Mar 19, 2024
1 parent bc4b5c2 commit 2a94e57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/help.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
import Markdown
import REPL

if isdefined( REPL.TerminalMenus, :default_terminal)
default_terminal = REPL.TerminalMenus.default_terminal
else
# before Julia 1.12
function default_terminal()
return REPL.TerminalMenus.terminal
end
end

function gap_help_string(topic::String, onlyexact::Bool = false,
term::REPL.Terminals.TTYTerminal = REPL.TerminalMenus.terminal;
term::REPL.Terminals.TTYTerminal = default_terminal();
suppress_output::Bool = false)
# Let GAP collect the information.
info = Globals.HELP_Info(GapObj(topic), onlyexact)
Expand Down
2 changes: 1 addition & 1 deletion test/help.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "help" begin
using GAP.REPL
tt = REPL.TerminalMenus.terminal
tt = GAP.default_terminal()

function test_gap_help(topic::String)
inp = Base.IOBuffer("qq") # exit the menu if applicable
Expand Down

0 comments on commit 2a94e57

Please sign in to comment.