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:
@@ -1,11 +1,11 @@
|
||||
local main = require('outline')
|
||||
local outline = require('outline')
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.show_code_actions()
|
||||
-- keep the cursor info in outline and jump back (or not jump back?)
|
||||
local winnr, pos = vim.api.nvim_get_current_win(), vim.api.nvim_win_get_cursor(0)
|
||||
main._goto_location(true)
|
||||
outline.current:_goto_location(true)
|
||||
vim.lsp.buf.code_action()
|
||||
vim.fn.win_gotoid(winnr)
|
||||
vim.api.nvim_win_set_cursor(winnr, pos)
|
||||
|
||||
Reference in New Issue
Block a user