Skip to content

Commit

Permalink
display
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Mar 26, 2021
1 parent 09500ef commit 68fed59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src-interactive/MadsDisplay.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ function display(filename::AbstractString)
@warn("File `$filename` is missing!")
return
end
ext = lowercase(Mads.getextension(filename))
if isdefined(Main, :TerminalExtensions) || (isdefined(Main, :IJulia) && Main.IJulia.inited)
trytoopen = false
ext = lowercase(Mads.getextension(filename))
if ext == "svg"
if isdefined(Main, :IJulia) && Main.IJulia.inited
open(filename) do f
Expand Down Expand Up @@ -48,6 +47,10 @@ function display(filename::AbstractString)
trytoopen = true
end
if trytoopen
if ext == "txt"
a = println.(readlines(filename))
return nothing
end
try
run(`open $filename`)
catch
Expand Down

0 comments on commit 68fed59

Please sign in to comment.