feat(config): add view.foldlevel and default to 0#121
Conversation
There was a problem hiding this comment.
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(default0) with validation inconfig.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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
See #70 (comment).