diff --git a/Project.toml b/Project.toml index eb6c93a2..8b13de94 100644 --- a/Project.toml +++ b/Project.toml @@ -14,9 +14,9 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" MyterialColors = "1c23619d-4212-4747-83aa-717207fae70f" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" -PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" @@ -33,8 +33,8 @@ Markdown = "1" MyterialColors = "0.3" OrderedCollections = "1" Parameters = "0.12" -ProgressLogging = "0.1" PrecompileTools = "1" +ProgressLogging = "0.1" REPL = "1" Tables = "1" UUIDs = "1" diff --git a/src/highlight.jl b/src/highlight.jl index 51cf4a17..4b705dec 100644 --- a/src/highlight.jl +++ b/src/highlight.jl @@ -116,7 +116,7 @@ function load_code_and_highlight(path::AbstractString, lineno::Int; δ::Int = 3) code = split(join(code), "\n") # clean - clean(line) = replace(line, " {/ }" => "", '\r' => "") + clean(line) = replace(replace(line, " {/ }" => ""), '\r' => "") # NOTE: julia `1.6` compat codelines = clean.(code) # [10-δ:10+δ] linenos = linenos # [10-δ:10+δ] diff --git a/test/19_test_repr.jl b/test/19_test_repr.jl index 564f688e..0ca1c8ba 100644 --- a/test/19_test_repr.jl +++ b/test/19_test_repr.jl @@ -24,7 +24,7 @@ end obj = Rocket(10, 50, 5000, "NASA") @with_repr struct T end - VERSION ≥ v"1.7" && begin + if VERSION ≥ v"1.7" IS_WIN || @compare_to_string sprint(termshow, obj) "repr_rocket" IS_WIN || @compare_to_string sprint(termshow, T()) "repr_T_struct" if VERSION ≤ v"1.10" @@ -41,7 +41,7 @@ end mts = MyTestStruct3("aa aa"^100, zeros(100, 100), 3, Panel(), "b b b"^100) - VERSION ≥ v"1.7" && begin + if VERSION ≥ v"1.7" IS_WIN || @compare_to_string sprint(termshow, mts) "mts_repr" end end @@ -90,14 +90,14 @@ else ) end -VERSION ≤ v"1.10" && @testset "TERMSHOW for types" begin +v"1.7" ≤ VERSION ≤ v"1.10" && @testset "TERMSHOW for types" begin for (i, t) in objs t = sprint(sprint_termshow, t) IS_WIN || @compare_to_string(t, "termshow_$i") end end -VERSION ≤ v"1.10" && @testset "Term automatic repr" begin +v"1.7" ≤ VERSION ≤ v"1.10" && @testset "Term automatic repr" begin repr_show(io, x) = show(io, MIME("text/plain"), x) @test sprint(repr_show, 1) == "\e[38;2;144;202;249m1\e[39m" @@ -105,7 +105,7 @@ VERSION ≤ v"1.10" && @testset "Term automatic repr" begin IS_WIN || @compare_to_string(sprint(repr_show, :(x + y)), "automatic_repr_2") end -VERSION ≤ v"1.10" && @testset "@showme" begin +v"1.7" ≤ VERSION ≤ v"1.10" && @testset "@showme" begin # fix for different path on remote CI loc = "\e[2m/Users/federicoclaudi/Documents/Github/Term.jl/src/" rem = " \e[2m/home/runner/work/Term.jl/Term.jl/src/"