feat: Use more concise API names
No breaking change.
This commit is contained in:
@@ -54,9 +54,9 @@
|
|||||||
- Floating windows are now used for `show_help` keymap and `:OutlineStatus` command
|
- Floating windows are now used for `show_help` keymap and `:OutlineStatus` command
|
||||||
- `:OutlineStatus` command is now more informative (and prettier!)
|
- `:OutlineStatus` command is now more informative (and prettier!)
|
||||||
- New command `:OutlineRefresh` and corresponding lua API function
|
- New command `:OutlineRefresh` and corresponding lua API function
|
||||||
`refresh_outline()` triggers re-requesting of symbols from provider and
|
`refresh()` triggers re-requesting of symbols from provider and updating the
|
||||||
updating the outline
|
outline
|
||||||
- New lua API function `is_focus_in_outline()`
|
- New lua API function `has_focus()`
|
||||||
- Auto-unfold root nodes when there is only N nodes. Where N defaults to 1
|
- Auto-unfold root nodes when there is only N nodes. Where N defaults to 1
|
||||||
(meaning when there is only 1 root node, keep it unfolded). The added config
|
(meaning when there is only 1 root node, keep it unfolded). The added config
|
||||||
option is `symbol_folding.auto_unfold` with keys `hovered` and `only`.
|
option is `symbol_folding.auto_unfold` with keys `hovered` and `only`.
|
||||||
@@ -77,6 +77,8 @@
|
|||||||
provided. This requires `norg` parser to be installed for treesitter
|
provided. This requires `norg` parser to be installed for treesitter
|
||||||
- Outline.nvim now supports per-tabpage outlines
|
- Outline.nvim now supports per-tabpage outlines
|
||||||
([#37](https://github.com/hedyhli/outline.nvim/issues/37))
|
([#37](https://github.com/hedyhli/outline.nvim/issues/37))
|
||||||
|
- Added `get_symbol` and `get_breadcrumb` functions (useful in
|
||||||
|
statusline/winbar) ([#24](https://github.com/hedyhli/outline.nvim/issues/24))
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -729,19 +729,19 @@ require'outline'
|
|||||||
```
|
```
|
||||||
- setup(opts)
|
- setup(opts)
|
||||||
|
|
||||||
- **toggle_outline(opts)**
|
- **toggle(opts)**
|
||||||
|
|
||||||
Toggle opening/closing of outline window.
|
Toggle opening/closing of outline window.
|
||||||
|
|
||||||
If `opts.focus_outline=false`, keep focus on previous window.
|
If `opts.focus_outline=false`, keep focus on previous window.
|
||||||
|
|
||||||
- **open_outline(opts)**
|
- **open(opts)**
|
||||||
|
|
||||||
Open the outline window.
|
Open the outline window.
|
||||||
|
|
||||||
If `opts.focus_outline=false`, keep focus on previous window.
|
If `opts.focus_outline=false`, keep focus on previous window.
|
||||||
|
|
||||||
- **close_outline()**
|
- **close()**
|
||||||
|
|
||||||
Close the outline window.
|
Close the outline window.
|
||||||
|
|
||||||
@@ -767,7 +767,7 @@ require'outline'
|
|||||||
|
|
||||||
- **has_provider()**
|
- **has_provider()**
|
||||||
|
|
||||||
Returns whether a provider is available for current window.
|
Returns whether a provider is available.
|
||||||
|
|
||||||
- **follow_cursor(opts)**
|
- **follow_cursor(opts)**
|
||||||
|
|
||||||
@@ -779,11 +779,11 @@ require'outline'
|
|||||||
This is automatically called on events
|
This is automatically called on events
|
||||||
`outline_items.auto_update_events.follow` from config.
|
`outline_items.auto_update_events.follow` from config.
|
||||||
|
|
||||||
- **is_focus_in_outline()**
|
- **has_focus()**
|
||||||
|
|
||||||
Return whether outline is open and current focus is in outline.
|
Return whether outline is open and current focus is in outline.
|
||||||
|
|
||||||
- **refresh_outline()**
|
- **refresh()**
|
||||||
|
|
||||||
Re-request symbols from provider and update outline items.
|
Re-request symbols from provider and update outline items.
|
||||||
|
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ function M._sidebar_do(method, args)
|
|||||||
return sidebar[method](sidebar, unpack(args))
|
return sidebar[method](sidebar, unpack(args))
|
||||||
end
|
end
|
||||||
|
|
||||||
---Close the current outline window
|
|
||||||
function M.close_outline()
|
function M.close_outline()
|
||||||
return M._sidebar_do('close')
|
return M._sidebar_do('close')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.close = M.close_outline
|
||||||
|
|
||||||
---Toggle the outline window, and return whether the outline window is open
|
---Toggle the outline window, and return whether the outline window is open
|
||||||
-- after this operation.
|
-- after this operation.
|
||||||
---@see open_outline
|
|
||||||
---@param opts outline.OutlineOpts? Table of options
|
---@param opts outline.OutlineOpts? Table of options
|
||||||
---@return boolean is_open Whether outline window is now open
|
---@return boolean is_open Whether outline window is now open
|
||||||
function M.toggle_outline(opts)
|
function M.toggle_outline(opts)
|
||||||
@@ -83,6 +83,8 @@ function M.toggle_outline(opts)
|
|||||||
return sidebar:toggle(opts)
|
return sidebar:toggle(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.toggle = M.toggle_outline
|
||||||
|
|
||||||
---Set cursor to focus on the outline window, return whether the window is
|
---Set cursor to focus on the outline window, return whether the window is
|
||||||
-- currently open.
|
-- currently open.
|
||||||
---@return boolean is_open Whether the window is open
|
---@return boolean is_open Whether the window is open
|
||||||
@@ -115,6 +117,8 @@ function M.refresh_outline()
|
|||||||
return M._sidebar_do('__refresh')
|
return M._sidebar_do('__refresh')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.refresh = M.refresh_outline
|
||||||
|
|
||||||
---Open the outline window.
|
---Open the outline window.
|
||||||
---@param opts outline.OutlineOpts? Field focus_outline=false means don't focus on outline window after opening. If opts is not provided, focus will be on outline window after opening.
|
---@param opts outline.OutlineOpts? Field focus_outline=false means don't focus on outline window after opening. If opts is not provided, focus will be on outline window after opening.
|
||||||
function M.open_outline(opts)
|
function M.open_outline(opts)
|
||||||
@@ -131,6 +135,8 @@ function M.open_outline(opts)
|
|||||||
return sidebar:open(opts)
|
return sidebar:open(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.open = M.open_outline
|
||||||
|
|
||||||
---@return boolean? has_focus Nil when no outline opened yet, otherwise returns whether cursor is in outline window.
|
---@return boolean? has_focus Nil when no outline opened yet, otherwise returns whether cursor is in outline window.
|
||||||
function M.is_focus_in_outline()
|
function M.is_focus_in_outline()
|
||||||
return M._sidebar_do('has_focus')
|
return M._sidebar_do('has_focus')
|
||||||
|
|||||||
Reference in New Issue
Block a user