Skip to content

Conversation

@BerniSc
Copy link

@BerniSc BerniSc commented Dec 18, 2025

Hi, this MR tries to implement Issue #141 by adding an auto_width option for the outline window. This allows the window width to automatically fit the longest entry, with an option to include or exclude inlay text in the calculation.

The new feature is disabled by default to not interfere with existing configurations. Otherwise no breaking changes should have been introduced.

Summary of changes:

  • Adds auto_width config
  • Option to include inlay hints in width calculation (include_inlay_hints)
  • Updates docs and implementation

Let me know if you have any feedback or suggestions!

Added a `shrinkwrap` conf to `outline_window` allowing the outline
sidebarwidth to dynamically adjust, based on contentsize. New options
include `enabled`, `max_width`, and `width_include_inlay`
Added documentation for the new `shrinkwrap` config under
`outline_window` in both README and vimdoc, changed default enabled
state to disabled to ensure backwardscompatibility
Renamed outwardfacing vars and options to be more concise and easier to
understand intuitively
Copilot AI review requested due to automatic review settings December 18, 2025 20:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an auto_width configuration option to enable dynamic resizing of the outline window based on content width, addressing Issue #141.

  • Adds auto_width config with options for enabling, max width, and inlay hints inclusion
  • Implements dynamic width calculation and window resizing in Sidebar:build_outline()
  • Updates documentation in README and help text

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
lua/outline/sidebar.lua Adds max_line_size field tracking, implements update_width() method, and integrates width calculation during outline building
lua/outline/config.lua Adds auto_width configuration table with defaults for enabled, max_width, and include_inlay_hints
doc/outline.txt Documents new auto_width configuration options and clarifies width behavior
README.md Documents new auto_width configuration options and clarifies width behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

enabled = false,
-- Maximum width (columns or percent if relative_width)
max_width = 40,
-- Include inlay-details in widthcalculation
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in 'widthcalculation'. Should be 'width calculation'.

Suggested change
-- Include inlay-details in widthcalculation
-- Include inlay-details in width calculation

Copilot uses AI. Check for mistakes.
-- Percentage or integer of columns
-- Percentage or integer of columns, sets min-width for auto_width option
width = 25,
-- Note: When auto_width is enabled, 'width' acts as the minimum windowwidth
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in 'windowwidth'. Should be 'window width'.

Suggested change
-- Note: When auto_width is enabled, 'width' acts as the minimum windowwidth
-- Note: When auto_width is enabled, 'width' acts as the minimum window width

Copilot uses AI. Check for mistakes.
enabled = false,
-- Maximum width (columns or percent if relative_width)
max_width = 40,
-- Include inlay-details in widthcalculation
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in 'widthcalculation'. Should be 'width calculation'.

Suggested change
-- Include inlay-details in widthcalculation
-- Include inlay-details in width calculation

Copilot uses AI. Check for mistakes.
-- Percentage or integer of columns
-- Percentage or integer of columns, sets min-width for auto_width option
width = 25,
-- Note: When auto_width is enabled, 'width' acts as minimum windowwidth
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in 'windowwidth'. Should be 'window width'.

Suggested change
-- Note: When auto_width is enabled, 'width' acts as minimum windowwidth
-- Note: When auto_width is enabled, 'width' acts as minimum window width

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant