Files
outline.nvim/lua/outline/code_action.lua
hedy e705330e40 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.
2023-11-24 14:50:24 +08:00

15 lines
386 B
Lua

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)
outline.current:_goto_location(true)
vim.lsp.buf.code_action()
vim.fn.win_gotoid(winnr)
vim.api.nvim_win_set_cursor(winnr, pos)
end
return M