Files
outline.nvim/lua/symbols-outline/providers/markdown.lua
hedy 9e96b54de9 feat: Add follow_cursor and restore_location
New lua API function: follow_cursor (supports opts.focus_outline).
This sets location in outline to match location in code.

New keymap: restore_location (C-g) by default.
This provides the same functionality as follow_cursor.

I've also refactored other lua API functions for consistency of using
`opts.focus_outline`. If opts is not provided, focus_outline is
defaulted to true. To change this behaviour, set it to false.
2023-11-06 09:20:52 +08:00

26 lines
539 B
Lua

local md_parser = require 'symbols-outline.markdown'
local M = {}
-- probably change this
function M.should_use_provider(bufnr)
return string.match(vim.api.nvim_buf_get_option(bufnr, 'ft'), 'markdown')
end
function M.hover_info(_, _, on_info)
on_info(nil, {
contents = {
kind = 'markdown',
contents = { 'No extra information availaible!' },
},
})
end
---@param on_symbols function
---@param opts table
function M.request_symbols(on_symbols, opts)
on_symbols(md_parser.handle_markdown(), opts)
end
return M