feat: Per-tabpage outlines

Closes #37

Almost completely refactored the UI parts outline.nvim to use a Sidebar
object that implements an outline window. In init.lua, we can then store
a table of the outline for each tabpage ID.

When tabs are closed the outline is closed and sidebar reset
responsibly.

This simplifies `init.lua` quite a lot, making it the highest level
control center for the outline elements.

All lua APIs and commands should work as before.
This commit is contained in:
hedy
2023-11-24 14:50:24 +08:00
parent 83dc477af5
commit e705330e40
9 changed files with 754 additions and 600 deletions

View File

@@ -17,10 +17,10 @@ end
-- handler yoinked from the default implementation
function M.show_hover()
local current_line = vim.api.nvim_win_get_cursor(outline.view.winnr)[1]
local node = outline.state.flattened_outline_items[current_line]
local current_line = vim.api.nvim_win_get_cursor(outline.current.view.winnr)[1]
local node = outline.current.flats[current_line]
local hover_params = get_hover_params(node, outline.state.code_win)
local hover_params = get_hover_params(node, outline.current.code.win)
vim.lsp.buf_request(
hover_params.bufnr,