kikito / inspect.lua

Human-readable representation of Lua tables
https://github.com/kikito/inspect.lua
MIT License
1.38k stars 196 forks source link

Looks strange with `inspect {{ x = 1 }}` #55

Closed sumneko closed 1 year ago

sumneko commented 2 years ago

The result of inspect {{ x = 1 }} is

{ {
    x = 1
  } }

The indentation is not aligned, is this a special case or bug?

borsuczyna commented 2 years ago

You did table inside table, where's the problem

sumneko commented 2 years ago

You did table inside table, where's the problem

It may be a common special case of this structure:

inspect { { x = 1 }, { x = 2 }, { x = 3 } }

Is it possible to keep their performance consistent?

However, I have no strong demand for this. If considering workload, cost performance or difficult ambiguity, I can accept the maintenance status.

kikito commented 1 year ago

You might not get exactly the output you want, but tweaking options.newline and options.indent might help.

See #58 for reference.