Skip to content

feat(config): add view.foldlevel and default to 0#121

Merged
dlyongemallo merged 1 commit intomainfrom
folds
Apr 18, 2026
Merged

feat(config): add view.foldlevel and default to 0#121
dlyongemallo merged 1 commit intomainfrom
folds

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented Apr 18, 2026

Copilot AI review requested due to automatic review settings April 18, 2026 05:00
Copy link
Copy Markdown

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

Adds a new user-facing configuration option to control the initial fold level in diff windows, aligning folding behavior with upstream defaults while still allowing users to keep folds open when needed.

Changes:

  • Introduces view.foldlevel (default 0) with validation in config.setup().
  • Applies the configured foldlevel when opening diff buffers/windows.
  • Updates docs/tips and adds config-focused functional tests for the new option.

Reviewed changes

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

Show a summary per file
File Description
lua/diffview/vcs/file.lua Changes default diff-window foldlevel winopt baseline to 0 and notes it’s resolved at open time.
lua/diffview/scene/window.lua Applies conf.view.foldlevel to the file window options prior to saving/restoring winopts.
lua/diffview/config.lua Adds default view.foldlevel and validates it as a non-negative integer.
lua/diffview/tests/functional/config_features_spec.lua Adds functional tests covering default/override/invalid values for view.foldlevel.
doc/diffview_defaults.txt Documents the new default config key.
doc/diffview.txt Adds help documentation for view.foldlevel.
TIPS.md Updates vim-markdown workaround guidance to use view.foldlevel.

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

Comment thread lua/diffview/scene/window.lua Outdated
Comment thread lua/diffview/scene/window.lua Outdated
Copy link
Copy Markdown

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


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

Comment thread lua/diffview/tests/functional/window_spec.lua
Copy link
Copy Markdown

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


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

@dlyongemallo dlyongemallo merged commit f299d2d into main Apr 18, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the folds branch April 18, 2026 05:49
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.

2 participants