Merge branch 'main' into preview_window_size_settings

This commit is contained in:
oskarrrrrrr
2024-08-13 08:18:26 -04:00
committed by GitHub
5 changed files with 75 additions and 14 deletions

31
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,31 @@
---
name: Bug report
about: Something isn't working
title: ''
labels: bug
assignees: ''
---
## Description
<!--
Include steps to reproduce, what you expect to happen, and the actual result with screenshots if you could.
If this issue is related to a particular filetype or provider (such as symbols not showing for a particular language or file), please include the output of `:OutlineStatus` on that particular buffer.
-->
## Neovim setup
- Neovim version: <!--[e.g. 0.9.4] (note that outline.nvim requires 0.7+)-->
- Outline.nvim version: <!--[e.g. v1.0.0, or a commit hash]-->
- Neovim distro (if applicable): <!--[e.g. LazyVim]-->
- Plugin manager: <!--[e.g. Lazy.nvim]-->
<!--Please include your relevant config for outline.nvim below, if any-->
Config:
```
```

View File

@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
## Description
<!--
Please include whether you're interested in implementing this feature yourself.
In many cases, a feature doesn't land solely because there isn't enough interest or motivation for someone to implement it.
Thanks for proposing ways to improve outline.nvim!
-->

View File

@@ -1,4 +1,4 @@
*outline.txt* For NVIM v0.7.0 Last change: 2024 July 05 *outline.txt* For NVIM v0.7.0 Last change: 2024 August 13
============================================================================== ==============================================================================
Table of Contents *outline-table-of-contents* Table of Contents *outline-table-of-contents*

View File

@@ -3,6 +3,7 @@ local cfg = require('outline.config')
local highlight = require('outline.highlight') local highlight = require('outline.highlight')
local providers = require('outline.providers.init') local providers = require('outline.providers.init')
local utils = require('outline.utils.init') local utils = require('outline.utils.init')
local symbols = require('outline.symbols')
local M = { local M = {
---@type outline.Sidebar[] ---@type outline.Sidebar[]
@@ -354,6 +355,7 @@ function M.setup(opts)
cfg.setup(opts) cfg.setup(opts)
highlight.setup() highlight.setup()
symbols.setup()
setup_global_autocmd() setup_global_autocmd()
setup_commands() setup_commands()

View File

@@ -45,6 +45,11 @@ for k, v in pairs(M.kinds) do
M.str_to_kind[v] = k M.str_to_kind[v] = k
end end
-- use a stub if lspkind is missing or not configured
local lspkind = {
symbolic = function(kind, opts) return '' end
}
---@param kind string|integer ---@param kind string|integer
---@param bufnr integer ---@param bufnr integer
---@return string icon ---@return string icon
@@ -65,22 +70,26 @@ function M.icon_from_kind(kind, bufnr)
end end
end end
if cfg.o.symbols.icon_source == 'lspkind' then
local has_lspkind, lspkind = pcall(require, 'lspkind')
if not has_lspkind then
vim.notify(
'[outline]: icon_source set to lspkind but failed to require lspkind!',
vim.log.levels.ERROR
)
else
local icon = lspkind.symbolic(kindstr, { with_text = false }) local icon = lspkind.symbolic(kindstr, { with_text = false })
if icon and icon ~= '' then if icon and icon ~= '' then
return icon return icon
end end
end
end
return cfg.o.symbols.icons[kindstr].icon return cfg.o.symbols.icons[kindstr].icon
end end
function M.setup()
if cfg.o.symbols.icon_source == 'lspkind' then
local has_lspkind, _lspkind = pcall(require, 'lspkind')
if has_lspkind then
lspkind = _lspkind
else
vim.notify(
'[outline]: icon_source set to lspkind but failed to require lspkind!',
vim.log.levels.ERROR
)
end
end
end
return M return M