Skip to content

Regression: when printing code, long literals are wrapped incorrectly #3205

Closed
@fingolfin

Description

Printing of function bodies with a long literals got broken somewhere between GAP 4.8 and GAP 4.9.

Using git bisect, I determined that this is caused by commit c78bb4c added by @stevelinton on 2017-08-17.

With GAP 4.8, we see this:

gap> SizeScreen([80,100]);;
gap> Display(f->2.12345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2.12345678901234567890123456789012345678901234567890123456789012345678901\
234567890;
end
gap> Display(f->212345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2123456789012345678901234567890123456789012345678901234567890123456789012\
34567890;
end
gap> Display(f->"212345678901234567890123456789012345678901234567890123456789012345678901234567890");
function ( f )
    return
     "212345678901234567890123456789012345678901234567890123456789012345678901\
234567890";
end

With GAP 4.9 or master, we see this:

gap> SizeScreen([80,100]);;
gap> Display(f->2.12345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2.12345678901234567890123456789012345678901234567890123456789012345678901\
\
234567890;
end
gap> Display(f->212345678901234567890123456789012345678901234567890123456789012345678901234567890);
function ( f )
    return
     2123456789012345678901234567890123456789012345678901234567890123456789012\
\
34567890;
end
function ( f )
    return
     "212345678901234567890123456789012345678901234567890123456789012345678901\
\
234567890";
end

My guess is that this can be fixed by also adding a Display method to complement the DisplayString method.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    kind: bugIssues describing general bugs, and PRs fixing themtopic: kernel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions