diff --git a/python3/vimspector/settings.py b/python3/vimspector/settings.py index a4295048..3b983ec7 100644 --- a/python3/vimspector/settings.py +++ b/python3/vimspector/settings.py @@ -24,6 +24,7 @@ 'bottombar_height': 10, 'disassembly_height': 20, 'variables_display_mode': 'compact', # compact/full + 'max_variable_children': 200, # For ui_mode = 'horizontal': 'sidebar_width': 50, diff --git a/python3/vimspector/variables.py b/python3/vimspector/variables.py index 4bbed1e2..9c4a5bfe 100644 --- a/python3/vimspector/variables.py +++ b/python3/vimspector/variables.py @@ -728,7 +728,16 @@ def GetMemoryReference( self ): def _DrawVariables( self, view, variables, indent_len, is_short = False ): assert indent_len > 0 - for variable in variables: + max_variable_children = settings.Int( 'max_variable_children' ) + for idx, variable in enumerate(variables): + if idx >= max_variable_children: + utils.AppendToBuffer( + view.buf, + f"{indent}... {len(variables) - max_variable_children} more", + hl = 'WarningMsg' + ) + break + text = '' # We borrow 1 space of indent to draw the change marker indent = ' ' * ( indent_len - 1 )