Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mreishus
Created January 27, 2022 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mreishus/b3f070d9c175520080d52c8ef6b3a628 to your computer and use it in GitHub Desktop.
Save mreishus/b3f070d9c175520080d52c8ef6b3a628 to your computer and use it in GitHub Desktop.
diff for symbols-outline vim plugin to work with vim-pandoc handling markdown
diff --git a/lua/symbols-outline/providers/markdown.lua b/lua/symbols-outline/providers/markdown.lua
index 225dd66..c7afabd 100644
--- a/lua/symbols-outline/providers/markdown.lua
+++ b/lua/symbols-outline/providers/markdown.lua
@@ -4,7 +4,7 @@ local M = {}
-- probably change this
function M.should_use_provider(bufnr)
- return vim.api.nvim_buf_get_option(bufnr, "ft") == "markdown"
+ return vim.api.nvim_buf_get_option(bufnr, "ft") == "markdown" or vim.api.nvim_buf_get_option(bufnr, "ft") == "pandoc"
end
function M.hover_info(_, _, on_info)
diff --git a/lua/symbols-outline/utils/lsp_utils.lua b/lua/symbols-outline/utils/lsp_utils.lua
index 83c410f..0213e46 100644
--- a/lua/symbols-outline/utils/lsp_utils.lua
+++ b/lua/symbols-outline/utils/lsp_utils.lua
@@ -33,7 +33,7 @@ function M.is_buf_attached_to_lsp(bufnr)
end
function M.is_buf_markdown(bufnr)
- return vim.api.nvim_buf_get_option(bufnr, 'ft') == 'markdown'
+ return vim.api.nvim_buf_get_option(bufnr, 'ft') == 'markdown' or vim.api.nvim_buf_get_option(bufnr, 'ft') == 'pandoc'
end
return M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment