Regression: when printing code, long literals are wrapped incorrectly #3205
Closed
Description
opened on Jan 21, 2019
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