feat: Autofold non-hovered symbol by default
This commit is contained in:
@@ -86,6 +86,11 @@
|
|||||||
- New outline window can be opened when no providers are found. A message is
|
- New outline window can be opened when no providers are found. A message is
|
||||||
displayed in the outline buffer. Same goes for refreshing outline during buffer
|
displayed in the outline buffer. Same goes for refreshing outline during buffer
|
||||||
switches.
|
switches.
|
||||||
|
- Config option `autofold_depth = 1` is now the default. To restore previous
|
||||||
|
behaviour set it to `false` (`nil` will NOT work). Reason being that it is
|
||||||
|
rarely beneficial to show neighboring symbol locations (sometimes even same
|
||||||
|
line!) when opening outline with the intention of getting an overall view of
|
||||||
|
the file and jumping elsewhere.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -274,8 +274,8 @@ Pass a table to the setup call with your configuration options.
|
|||||||
},
|
},
|
||||||
|
|
||||||
symbol_folding = {
|
symbol_folding = {
|
||||||
-- Depth past which nodes will be folded by default
|
-- Depth past which nodes will be folded by default. Set to false to unfold all on open.
|
||||||
autofold_depth = nil,
|
autofold_depth = 1,
|
||||||
-- When to auto unfold nodes
|
-- When to auto unfold nodes
|
||||||
auto_unfold = {
|
auto_unfold = {
|
||||||
-- Auto unfold currently hovered symbol
|
-- Auto unfold currently hovered symbol
|
||||||
@@ -884,6 +884,8 @@ unless specified otherwise.
|
|||||||
|
|
||||||
### Unfold others
|
### Unfold others
|
||||||
|
|
||||||
|
(Now a default behaviour, different to symbols-outline.nvim.)
|
||||||
|
|
||||||
Unfold all others except currently hovered item.
|
Unfold all others except currently hovered item.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
@@ -896,6 +898,14 @@ symbol_folding = {
|
|||||||
```
|
```
|
||||||
<div align=center><img width="900" alt="outline window showing auto fold depth" src="https://github.com/hedyhli/outline.nvim/assets/50042066/2e0c5f91-a979-4e64-a100-256ad062dce3"></div>
|
<div align=center><img width="900" alt="outline window showing auto fold depth" src="https://github.com/hedyhli/outline.nvim/assets/50042066/2e0c5f91-a979-4e64-a100-256ad062dce3"></div>
|
||||||
|
|
||||||
|
### Unfold entire symbol tree by default
|
||||||
|
|
||||||
|
```lua
|
||||||
|
symbol_folding = {
|
||||||
|
autofold_depth = false,
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
### Auto-unfold when there's only two (or any number of) root nodes
|
### Auto-unfold when there's only two (or any number of) root nodes
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ M.defaults = {
|
|||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
symbol_folding = {
|
symbol_folding = {
|
||||||
autofold_depth = nil,
|
autofold_depth = 1,
|
||||||
auto_unfold = {
|
auto_unfold = {
|
||||||
hovered = true,
|
hovered = true,
|
||||||
---@type boolean|integer
|
---@type boolean|integer
|
||||||
|
|||||||
Reference in New Issue
Block a user