Skip to content

#4132 breaks indentation in displayed functions in certain cases #4486

Open
@zickgraf

Description

Put the following code in a file test.g:

SetPrintFormattingStatus( "*stdout*", false );
Display(x -> x);

and execute gap test.g.

Observed behaviour

The output is:

function ( x )
return x;
end

Expected behaviour

The output should be:

function ( x )
    return x;
end

Notes

  1. I have bisected this to Fix a long standing bug which prevented SetPrintFormattingStatus( "*stdout*", false ); from working as expected #4132 (e62d395).
  2. In the REPL this problem does not occur, that's why putting the code into a file is important.
  3. Some background why I am interested in this:
    1. I have SetPrintFormattingStatus( "*stdout*", false ); in my gaprc because I'd like my terminal to reflow long lines if I change the size of my terminal.
    2. I want to stringify functions and print them to files. For this, I would like to have indentation but not line breaks due to long lines, so I would like to set SetPrintFormattingStatus to false without losing the indentation.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions