Skip to content

Minimal example for missing Julia 1.0 compat #39

@Seelengrab

Description

@Seelengrab

Just to have this recorded - with the following patch to stylemacro.jl:

diff --git a/src/stylemacro.jl b/src/stylemacro.jl
index 852292e..3aedba1 100644
--- a/src/stylemacro.jl
+++ b/src/stylemacro.jl
@@ -703,9 +705,10 @@ function Base.showerror(io::IO, err::MalformedStylingMacro)
             begin_ellipsis = ifelse(start == firstindex(err.raw), "", "…")
             end_ellipsis = ifelse(stop == lastindex(err.raw), "", "…")
             npre = ncodeunits(Base.escape_string(err.raw[start:position]))
+            pad = ' '^(1+textwidth(begin_ellipsis)+npre)
+            println(io, styled"{error:│} $message:\n\n {error:│}  {bright_green:\"{shadow:$begin_ellipsis}$window{shadow:$end_ellipsis}\"}\n\n{error:│}  $pad{info:╰─╴$hint}")
-            println(io, styled"{error:│} $message:\n\
-                          {error:│}  {bright_green:\"{shadow:$begin_ellipsis}$window{shadow:$end_ellipsis}\"}\n\
-                          {error:│}  $(' '^(1+textwidth(begin_ellipsis)+npre)){info:╰─╴$hint}")

         end
     end
     pluralissues = length(err.problems) > 1

I was able to reduce the problem down to just styled"{1:{:{:aaaa}}}", which throws the same kind of error, as well as having trailing null-byte characters in the formatting message introduced somewhere along the way. This (to me) suggests there is some problem with offset calculation that subsequently got fixed with Julia 1.1 by accident. Since the code fails on 1.0.5 and there's ~1000 commits between those two versions, it should be (relatively) straightforward to bisect & hopefully fix through @static if style version queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions