Index: src/natools-s_expressions-printers-pretty.adb ================================================================== --- src/natools-s_expressions-printers-pretty.adb +++ src/natools-s_expressions-printers-pretty.adb @@ -782,10 +782,18 @@ -- Printer Interface -- ----------------------- overriding procedure Open_List (Output : in out Printer) is begin + if Output.Param.Width > 0 + and then Output.Cursor > Output.Param.Width + and then Output.Cursor > Indent_Width (Output) + 1 + then + Newline (Output); + Output.First := True; -- inhibit extra space or newline + end if; + if not Output.First then if Output.Param.Newline_At (Output.Previous, Opening) then Newline (Output); elsif Output.Param.Space_At (Output.Previous, Opening) then Output.Stream.Write ((0 => Encodings.Space)); @@ -948,10 +956,18 @@ overriding procedure Close_List (Output : in out Printer) is begin Output.Indent_Level := Output.Indent_Level - 1; + + if Output.Param.Width > 0 + and then Output.Cursor > Output.Param.Width + and then Output.Cursor > Indent_Width (Output) + 1 + then + Newline (Output); + Output.First := True; -- inhibit extra space or newline + end if; if not Output.First then if Output.Param.Newline_At (Output.Previous, Closing) then Newline (Output); elsif Output.Param.Space_At (Output.Previous, Closing) then