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

Bump the default depth for recursive printing to 3 #6526

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/snippets/other.6526.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- (#6526) Default the depth of recursive printing/logging to 3 tables deep

The new default applies to all the `repr`-like functions. This only changes the developers experience.
6 changes: 5 additions & 1 deletion lua/system/repr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end
local function inspect(root, options)
options = options or {}

local depth = options.depth or 1
local depth = options.depth or 3
local newline = options.newline or '\n'
local indent = options.indent or ' '
local meta = options.meta or false
Expand All @@ -286,6 +286,10 @@ end
repr = inspect
repru = inspect
reprs = inspect

---@param root any
---@param options? DebugInspectOptions
---@return string
reprsl = function(root, options)
local str = inspect(root, options)
LOG(str)
Expand Down
Loading