Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added line prefixing option #41

Closed
wants to merge 1 commit into from
Closed

Conversation

edam
Copy link

@edam edam commented Sep 25, 2018

Added a line prefixing options, options.prefix, which prefixes all but the first line output.

E.g.

lua> t = { a = { b = 1 } }
lua> print( inspect( t, { newline = '', indent = '', prefix = ' ' ) )
{ a = { b = 1 } }
lua> print( '> '..inspect( t, { prefix = '> ' } )
> {
>   a = {
>     b = 1
>   }
> }

Also updated docs and tests

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.294% when pulling 5a41302 on edam:add-padding into b611db6 on kikito:master.

@hishamhm
Copy link

hishamhm commented Apr 5, 2019

This achieves the same result:

> t = { a = { b = 1 } }
> print( "> " .. inspect( t, { newline = '\n> ', } ) )
> {
>   a = {
>     b = 1
>   }
> }
> 

@kikito
Copy link
Owner

kikito commented Sep 23, 2021

Closing because of the existing alternative (thanks for the PR though!)

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

Successfully merging this pull request may close these issues.

None yet

4 participants