MAJOR: Project rename and preparation for v1.0.0
I hope I haven't missed any for the renames!
This commit is contained in:
2
.github/workflows/panvimdoc.yml
vendored
2
.github/workflows/panvimdoc.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- name: panvimdoc
|
- name: panvimdoc
|
||||||
uses: kdheepak/panvimdoc@main
|
uses: kdheepak/panvimdoc@main
|
||||||
with:
|
with:
|
||||||
vimdoc: symbols-outline
|
vimdoc: outline
|
||||||
version: "NVIM v0.7.0"
|
version: "NVIM v0.7.0"
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
121
README.md
121
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Fork status
|
# Fork status
|
||||||
|
|
||||||
[Skip to plugin readme](#symbols-outlinenvim)
|
[Skip to plugin readme](#outlinenvim)
|
||||||
|
|
||||||
This is a fork of the original symbols-outline.nvim which fixes a lot of bugs
|
This is a fork of the original symbols-outline.nvim which fixes a lot of bugs
|
||||||
from the original repo.
|
from the original repo.
|
||||||
@@ -45,7 +45,7 @@ I do not merge PRs from the original repo that I don't personally need.
|
|||||||
- simrat39/symbols-outline.nvim#178
|
- simrat39/symbols-outline.nvim#178
|
||||||
- simrat39/symbols-outline.nvim#209
|
- simrat39/symbols-outline.nvim#209
|
||||||
- Symbol preview empty (simrat39/symbols-outline.nvim#176)
|
- Symbol preview empty (simrat39/symbols-outline.nvim#176)
|
||||||
- `SymbolsOutlineClose` crashing when already closed: simrat39/symbols-outline.nvim#163
|
- `OutlineClose` crashing when already closed: simrat39/symbols-outline.nvim#163
|
||||||
- Symbols not showing by supporting Nerd fonts v3.0: simrat39/symbols-outline.nvim#225
|
- Symbols not showing by supporting Nerd fonts v3.0: simrat39/symbols-outline.nvim#225
|
||||||
- Newlines in symbols crash: simrat39/symbols-outline.nvim#204 (simrat39/symbols-outline.nvim#184)
|
- Newlines in symbols crash: simrat39/symbols-outline.nvim#204 (simrat39/symbols-outline.nvim#184)
|
||||||
- `code_actions`: simrat39/symbols-outline.nvim#168 (simrat39/symbols-outline.nvim#123)
|
- `code_actions`: simrat39/symbols-outline.nvim#168 (simrat39/symbols-outline.nvim#123)
|
||||||
@@ -59,6 +59,29 @@ outline.
|
|||||||
|
|
||||||
## 🛑 Breaking changes
|
## 🛑 Breaking changes
|
||||||
|
|
||||||
|
The fork has been renamed to outline.nvim for the following reasons:
|
||||||
|
|
||||||
|
1. While `symbols-outline` is a great name, using `SymbolsOutline*` everywhere
|
||||||
|
as a prefix for commands and highlight groups is quite long to type.
|
||||||
|
1. I did not find existing plugins that use the `outline` import path.
|
||||||
|
1. The only plugin I could find named `outline.nvim` does not use this import
|
||||||
|
path.
|
||||||
|
1. This is a fork starting anew, it makes sense to undergo a
|
||||||
|
[rename](https://github.com/lewis6991/pckr.nvim).
|
||||||
|
|
||||||
|
Regardless of this rename, I am eternally grateful to @simrat39 for their work
|
||||||
|
in the original symbols-outline.nvim. This plugin would not exist without it.
|
||||||
|
|
||||||
|
What this means for you:
|
||||||
|
|
||||||
|
- Commands and highlights that had the `SymbolsOutline*` prefix should now use
|
||||||
|
`Outline*`
|
||||||
|
- The import path should be changed from `symbols-outline` to `outline`
|
||||||
|
|
||||||
|
That is all.
|
||||||
|
|
||||||
|
Here are other breaking changes:
|
||||||
|
|
||||||
This section may be relevant to you if your existing config uses the mentioned
|
This section may be relevant to you if your existing config uses the mentioned
|
||||||
features:
|
features:
|
||||||
|
|
||||||
@@ -114,7 +137,7 @@ and behaviour of outline window is now moved to `outline_window` table;
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
[Skip to plugin readme](#symbols-outlinenvim)
|
[Skip to plugin readme](#outlinenvim)
|
||||||
|
|
||||||
Below is a list of features I've included in this fork which, at the time of
|
Below is a list of features I've included in this fork which, at the time of
|
||||||
writing, has not been included upstream (in the original repo). I try my best to
|
writing, has not been included upstream (in the original repo). I try my best to
|
||||||
@@ -126,7 +149,7 @@ Features/Changes:
|
|||||||
(simrat39/symbols-outline.nvim#194).
|
(simrat39/symbols-outline.nvim#194).
|
||||||
|
|
||||||
- Control focus between outline and code window.
|
- Control focus between outline and code window.
|
||||||
- New commands: SymbolsOutline`Focus,FocusOutline,FocusCode` (see
|
- New commands: Outline`Focus,FocusOutline,FocusCode` (see
|
||||||
[commands](#commands))
|
[commands](#commands))
|
||||||
- Fixed issues:
|
- Fixed issues:
|
||||||
- simrat39/symbols-outline.nvim#143
|
- simrat39/symbols-outline.nvim#143
|
||||||
@@ -276,7 +299,7 @@ Key:
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
[Skip to plugin readme](#symbols-outlinenvim)
|
[Skip to plugin readme](#outlinenvim)
|
||||||
|
|
||||||
Key:
|
Key:
|
||||||
```
|
```
|
||||||
@@ -327,7 +350,7 @@ Key:
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# symbols-outline.nvim
|
# outline.nvim
|
||||||
|
|
||||||
<!-- panvimdoc-ignore-end -->
|
<!-- panvimdoc-ignore-end -->
|
||||||
|
|
||||||
@@ -368,19 +391,19 @@ Table of contents
|
|||||||
|
|
||||||
Packer:
|
Packer:
|
||||||
```lua
|
```lua
|
||||||
use 'hedyhli/symbols-outline.nvim'
|
use 'hedyhli/outline.nvim'
|
||||||
```
|
```
|
||||||
|
|
||||||
Lazy:
|
Lazy:
|
||||||
```lua
|
```lua
|
||||||
{
|
{
|
||||||
"hedyhli/symbols-outline.nvim",
|
"hedyhli/outline.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
-- Example mapping to toggle outline
|
-- Example mapping to toggle outline
|
||||||
vim.keymap.set("n", "<leader>tt", "<cmd>SymbolsOutline<CR>",
|
vim.keymap.set("n", "<leader>tt", "<cmd>Outline<CR>",
|
||||||
{ desc = "SymbolsOutline" })
|
{ desc = "Toggle Outline" })
|
||||||
|
|
||||||
require("symbols-outline").setup {
|
require("outline").setup {
|
||||||
-- Your setup opts here (leave empty to use defaults)
|
-- Your setup opts here (leave empty to use defaults)
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
@@ -390,11 +413,11 @@ Lazy:
|
|||||||
Lazy with lazy-loading:
|
Lazy with lazy-loading:
|
||||||
```lua
|
```lua
|
||||||
{
|
{
|
||||||
"hedyhli/symbols-outline.nvim",
|
"hedyhli/outline.nvim",
|
||||||
cmd = { "SymbolsOutline", "SymbolsOutlineOpen" },
|
cmd = { "Outline", "OutlineOpen" },
|
||||||
keys = {
|
keys = {
|
||||||
-- Example mapping to toggle outline
|
-- Example mapping to toggle outline
|
||||||
{ "<leader>tt", "<cmd>SymbolsOutline<CR>", desc = "Toggle outline" },
|
{ "<leader>tt", "<cmd>Outline<CR>", desc = "Toggle outline" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
-- Your setup opts here
|
-- Your setup opts here
|
||||||
@@ -402,8 +425,8 @@ Lazy with lazy-loading:
|
|||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
This allows Lazy.nvim to lazy load the plugin on commands `SymbolsOutline`,
|
This allows Lazy.nvim to lazy load the plugin on commands `Outline`,
|
||||||
`SymbolsOutlineOpen`, and your keybindings.
|
`OutlineOpen`, and your keybindings.
|
||||||
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
@@ -414,7 +437,7 @@ Note that a call to `.setup()` is *required* for this plugin to work
|
|||||||
(simrat39/symbols-outline.nvim#213).
|
(simrat39/symbols-outline.nvim#213).
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require("symbols-outline").setup({})
|
require("outline").setup({})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@@ -494,7 +517,7 @@ Default values are shown:
|
|||||||
-- Only in this fork:
|
-- Only in this fork:
|
||||||
-- Whether to focus on the outline window when it is opened.
|
-- Whether to focus on the outline window when it is opened.
|
||||||
-- Set to false to remain focus on your previous buffer when opening
|
-- Set to false to remain focus on your previous buffer when opening
|
||||||
-- symbols-outline.
|
-- outline.
|
||||||
focus_on_open = true,
|
focus_on_open = true,
|
||||||
-- Only in this fork:
|
-- Only in this fork:
|
||||||
-- Winhighlight option for outline window.
|
-- Winhighlight option for outline window.
|
||||||
@@ -502,7 +525,7 @@ Default values are shown:
|
|||||||
-- To change background color to "CustomHl" for example, append "Normal:CustomHl".
|
-- To change background color to "CustomHl" for example, append "Normal:CustomHl".
|
||||||
-- Note that if you're adding highlight changes, you should append to this
|
-- Note that if you're adding highlight changes, you should append to this
|
||||||
-- default value, otherwise details/lineno will not have highlights.
|
-- default value, otherwise details/lineno will not have highlights.
|
||||||
winhl = "SymbolsOutlineDetails:Comment,SymbolsOutlineLineno:LineNr",
|
winhl = "OutlineDetails:Comment,OutlineLineno:LineNr",
|
||||||
},
|
},
|
||||||
|
|
||||||
outline_items = {
|
outline_items = {
|
||||||
@@ -682,39 +705,39 @@ string or a falsey value.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
- **:SymbolsOutline[!]**
|
- **:Outline[!]**
|
||||||
|
|
||||||
Toggle symbols outline. With bang (`!`) the cursor focus stays in your
|
Toggle outline. With bang (`!`) the cursor focus stays in your
|
||||||
original window after opening the outline window. Set `focus_on_win = true` to
|
original window after opening the outline window. Set `focus_on_win = true` to
|
||||||
always use this behaviour.
|
always use this behaviour.
|
||||||
|
|
||||||
- **:SymbolsOutlineOpen[!]**
|
- **:OutlineOpen[!]**
|
||||||
|
|
||||||
Open symbols outline. With bang (`!`) the cursor focus stays in your original
|
Open outline. With bang (`!`) the cursor focus stays in your original
|
||||||
window after opening the outline window. Set `focus_on_win = true` to always
|
window after opening the outline window. Set `focus_on_win = true` to always
|
||||||
use this behaviour.
|
use this behaviour.
|
||||||
|
|
||||||
- **:SymbolsOutlineClose**
|
- **:OutlineClose**
|
||||||
|
|
||||||
Close symbols outline
|
Close outline
|
||||||
|
|
||||||
- **:SymbolsOutlineFocus**
|
- **:OutlineFocus**
|
||||||
|
|
||||||
Toggle focus on symbols outline
|
Toggle focus on outline
|
||||||
|
|
||||||
- **:SymbolsOutlineFocusOutline**
|
- **:OutlineFocusOutline**
|
||||||
|
|
||||||
Focus on symbols outline
|
Focus on outline
|
||||||
|
|
||||||
- **:SymbolsOutlineFocusCode**
|
- **:OutlineFocusCode**
|
||||||
|
|
||||||
Focus on source window
|
Focus on source window
|
||||||
|
|
||||||
- **:SymbolsOutlineStatus**
|
- **:OutlineStatus**
|
||||||
|
|
||||||
Display current provider and outline window status in the messages area.
|
Display current provider and outline window status in the messages area.
|
||||||
|
|
||||||
- **:SymbolsOutlineFollow[!]**
|
- **:OutlineFollow[!]**
|
||||||
|
|
||||||
Go to corresponding node in outline based on cursor position in code, and
|
Go to corresponding node in outline based on cursor position in code, and
|
||||||
focus on the outline window.
|
focus on the outline window.
|
||||||
@@ -763,18 +786,18 @@ Default:
|
|||||||
|
|
||||||
```lua
|
```lua
|
||||||
outline_window = {
|
outline_window = {
|
||||||
winhl = "SymbolsOutlineDetails:Comment,SymbolsOutlineLineno:LineNr",
|
winhl = "OutlineDetails:Comment,OutlineLineno:LineNr",
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
Possible highlight groups provided by symbols-outline to customize:
|
Possible highlight groups provided by outline.nvim to customize:
|
||||||
|
|
||||||
| Highlight | Purpose |
|
| Highlight | Purpose |
|
||||||
| ----------------------- | ---------------------------------------------- |
|
| ---------------- | ---------------------------------------------- |
|
||||||
| SymbolsOutlineCurrent | Highlight of the focused symbol |
|
| OutlineCurrent | Highlight of the focused symbol |
|
||||||
| SymbolsOutlineConnector | Highlight of the table connectors |
|
| OutlineConnector | Highlight of the table connectors |
|
||||||
| SymbolsOutlineDetails | Highlight of the details info virtual text |
|
| OutlineDetails | Highlight of the details info virtual text |
|
||||||
| SymbolsOutlineLineno | Highlight of the lineno column |
|
| OutlineLineno | Highlight of the lineno column |
|
||||||
|
|
||||||
You can customize any other highlight groups using `winhl` too, this option is
|
You can customize any other highlight groups using `winhl` too, this option is
|
||||||
passed directly to the `winhl` vim option unprocessed.
|
passed directly to the `winhl` vim option unprocessed.
|
||||||
@@ -792,10 +815,10 @@ preview_window = {
|
|||||||
|
|
||||||
## Lua API
|
## Lua API
|
||||||
|
|
||||||
Symbols-outline provides the following public API for use in lua.
|
Outline.nvim provides the following public API for use in lua.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require'symbols-outline'
|
require'outline'
|
||||||
```
|
```
|
||||||
- setup(opts)
|
- setup(opts)
|
||||||
|
|
||||||
@@ -849,8 +872,8 @@ require'symbols-outline'
|
|||||||
|
|
||||||
## Tips
|
## Tips
|
||||||
|
|
||||||
- To open the outline but don't focus on it, you can use `:SymbolsOutline!` or
|
- To open the outline but don't focus on it, you can use `:Outline!` or
|
||||||
`:SymbolsOutlineOpen!`.
|
`:OutlineOpen!`.
|
||||||
|
|
||||||
This is useful in autocmds, say you have a filetype that, whenever a buffer with
|
This is useful in autocmds, say you have a filetype that, whenever a buffer with
|
||||||
that filetype is opened you want to open the outline.
|
that filetype is opened you want to open the outline.
|
||||||
@@ -897,7 +920,7 @@ symbol_folding = {
|
|||||||
auto_unfold_hover = true,
|
auto_unfold_hover = true,
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
<img width="900" alt="outline window showing auto fold depth" src="https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/2e0c5f91-a979-4e64-a100-256ad062dce3">
|
<img width="900" alt="outline window showing auto fold depth" src="https://github.com/hedyhli/outline.nvim/assets/50042066/2e0c5f91-a979-4e64-a100-256ad062dce3">
|
||||||
|
|
||||||
|
|
||||||
- **Use outline window as a quick-jump window**
|
- **Use outline window as a quick-jump window**
|
||||||
@@ -908,7 +931,7 @@ preview_window = {
|
|||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/a473d791-d1b9-48e9-917f-b816b564a645
|
https://github.com/hedyhli/outline.nvim/assets/50042066/a473d791-d1b9-48e9-917f-b816b564a645
|
||||||
|
|
||||||
Note that in the recording I have `preview_window.open_hover_on_preview =
|
Note that in the recording I have `preview_window.open_hover_on_preview =
|
||||||
false`.
|
false`.
|
||||||
@@ -924,7 +947,7 @@ outline_window = {
|
|||||||
|
|
||||||
This feature was added by @stickperson in an upstream PR 🙌
|
This feature was added by @stickperson in an upstream PR 🙌
|
||||||
|
|
||||||
https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/3d06e342-97ac-400c-8598-97a9235de66c
|
https://github.com/hedyhli/outline.nvim/assets/50042066/3d06e342-97ac-400c-8598-97a9235de66c
|
||||||
|
|
||||||
Or, you can use keys `<C-j>` and `<C-k>` to achieve the same effect, whilst not
|
Or, you can use keys `<C-j>` and `<C-k>` to achieve the same effect, whilst not
|
||||||
having `auto_goto` on by default.
|
having `auto_goto` on by default.
|
||||||
@@ -952,7 +975,7 @@ outline_items = {
|
|||||||
The default highlight group for the line numbers is `LineNr`, you can customize
|
The default highlight group for the line numbers is `LineNr`, you can customize
|
||||||
it using `outline_window.winhl`: please see [highlights](#outline-window).
|
it using `outline_window.winhl`: please see [highlights](#outline-window).
|
||||||
|
|
||||||
<img width="900" alt="outline window showing lineno" src="https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/2bbb5833-f40b-4c53-8338-407252d61443">
|
<img width="900" alt="outline window showing lineno" src="https://github.com/hedyhli/outline.nvim/assets/50042066/2bbb5833-f40b-4c53-8338-407252d61443">
|
||||||
|
|
||||||
- **Single cursorline**
|
- **Single cursorline**
|
||||||
|
|
||||||
@@ -965,7 +988,7 @@ outline_window = {
|
|||||||
|
|
||||||
This will be how the outline window looks like when focused:
|
This will be how the outline window looks like when focused:
|
||||||
|
|
||||||
<img width="300" alt="outline window showing hide_cursor" src="https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/1e13c4db-ae51-4e1f-a388-2758871df36a">
|
<img width="300" alt="outline window showing hide_cursor" src="https://github.com/hedyhli/outline.nvim/assets/50042066/1e13c4db-ae51-4e1f-a388-2758871df36a">
|
||||||
|
|
||||||
Note that in the screenshot, `outline_items.show_symbol_lineno` is also enabled.
|
Note that in the screenshot, `outline_items.show_symbol_lineno` is also enabled.
|
||||||
|
|
||||||
@@ -989,7 +1012,7 @@ symbols = {
|
|||||||
The fetcher function, if provided, is checked first before using `icon_source`
|
The fetcher function, if provided, is checked first before using `icon_source`
|
||||||
and `icons` as fallback.
|
and `icons` as fallback.
|
||||||
|
|
||||||
<img width="300" alt="outline with plain text icons" src="https://github.com/hedyhli/symbols-outline.nvim/assets/50042066/655b534b-da16-41a7-926e-f14475376a04">
|
<img width="300" alt="outline with plain text icons" src="https://github.com/hedyhli/outline.nvim/assets/50042066/655b534b-da16-41a7-926e-f14475376a04">
|
||||||
|
|
||||||
|
|
||||||
<!-- panvimdoc-ignore-start -->
|
<!-- panvimdoc-ignore-start -->
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local main = require 'symbols-outline'
|
local main = require 'outline'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ M.defaults = {
|
|||||||
show_relative_numbers = false,
|
show_relative_numbers = false,
|
||||||
show_cursorline = true,
|
show_cursorline = true,
|
||||||
hide_cursor = false,
|
hide_cursor = false,
|
||||||
winhl = "SymbolsOutlineDetails:Comment,SymbolsOutlineLineno:LineNr",
|
winhl = "OutlineDetails:Comment,OutlineLineno:LineNr",
|
||||||
},
|
},
|
||||||
preview_window = {
|
preview_window = {
|
||||||
auto_preview = false,
|
auto_preview = false,
|
||||||
@@ -195,7 +195,7 @@ end
|
|||||||
|
|
||||||
function M.check_config()
|
function M.check_config()
|
||||||
if M.o.outline_window.hide_cursor and not M.o.outline_window.show_cursorline then
|
if M.o.outline_window.hide_cursor and not M.o.outline_window.show_cursorline then
|
||||||
vim.notify("[symbols-outline.config]: hide_cursor enabled WITHOUT cursorline enabled!", vim.log.levels.ERROR)
|
vim.notify("[outline.config]: hide_cursor enabled WITHOUT cursorline enabled!", vim.log.levels.ERROR)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
|
|
||||||
M.is_foldable = function(node)
|
M.is_foldable = function(node)
|
||||||
return node.children and #node.children > 0
|
return node.children and #node.children > 0
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local so = require 'symbols-outline'
|
local so = require 'outline'
|
||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
local util = vim.lsp.util
|
local util = vim.lsp.util
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
local parser = require 'symbols-outline.parser'
|
local parser = require 'outline.parser'
|
||||||
local providers = require 'symbols-outline.providers.init'
|
local providers = require 'outline.providers.init'
|
||||||
local ui = require 'symbols-outline.ui'
|
local ui = require 'outline.ui'
|
||||||
local writer = require 'symbols-outline.writer'
|
local writer = require 'outline.writer'
|
||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
local utils = require 'symbols-outline.utils.init'
|
local utils = require 'outline.utils.init'
|
||||||
local View = require 'symbols-outline.view'
|
local View = require 'outline.view'
|
||||||
local folding = require 'symbols-outline.folding'
|
local folding = require 'outline.folding'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ local function setup_global_autocmd()
|
|||||||
|
|
||||||
vim.api.nvim_create_autocmd('WinEnter', {
|
vim.api.nvim_create_autocmd('WinEnter', {
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
callback = require('symbols-outline.preview').close,
|
callback = require('outline.preview').close,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -154,12 +154,12 @@ local function setup_buffer_autocmd()
|
|||||||
if cfg.o.preview_window.auto_preview then
|
if cfg.o.preview_window.auto_preview then
|
||||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||||
buffer = 0,
|
buffer = 0,
|
||||||
callback = require('symbols-outline.preview').show,
|
callback = require('outline.preview').show,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||||
buffer = 0,
|
buffer = 0,
|
||||||
callback = require('symbols-outline.preview').close,
|
callback = require('outline.preview').close,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
if cfg.o.outline_window.auto_goto then
|
if cfg.o.outline_window.auto_goto then
|
||||||
@@ -321,27 +321,27 @@ local function setup_keymaps(bufnr)
|
|||||||
-- hover symbol
|
-- hover symbol
|
||||||
map(
|
map(
|
||||||
cfg.o.keymaps.hover_symbol,
|
cfg.o.keymaps.hover_symbol,
|
||||||
require('symbols-outline.hover').show_hover
|
require('outline.hover').show_hover
|
||||||
)
|
)
|
||||||
-- preview symbol
|
-- preview symbol
|
||||||
map(
|
map(
|
||||||
cfg.o.keymaps.toggle_preview,
|
cfg.o.keymaps.toggle_preview,
|
||||||
require('symbols-outline.preview').toggle
|
require('outline.preview').toggle
|
||||||
)
|
)
|
||||||
-- rename symbol
|
-- rename symbol
|
||||||
map(
|
map(
|
||||||
cfg.o.keymaps.rename_symbol,
|
cfg.o.keymaps.rename_symbol,
|
||||||
require('symbols-outline.rename').rename
|
require('outline.rename').rename
|
||||||
)
|
)
|
||||||
-- code actions
|
-- code actions
|
||||||
map(
|
map(
|
||||||
cfg.o.keymaps.code_actions,
|
cfg.o.keymaps.code_actions,
|
||||||
require('symbols-outline.code_action').show_code_actions
|
require('outline.code_action').show_code_actions
|
||||||
)
|
)
|
||||||
-- show help
|
-- show help
|
||||||
map(
|
map(
|
||||||
cfg.o.keymaps.show_help,
|
cfg.o.keymaps.show_help,
|
||||||
require('symbols-outline.config').show_help
|
require('outline.config').show_help
|
||||||
)
|
)
|
||||||
-- close outline
|
-- close outline
|
||||||
map(cfg.o.keymaps.close, function()
|
map(cfg.o.keymaps.close, function()
|
||||||
@@ -414,7 +414,7 @@ function M.follow_cursor(opts)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if require('symbols-outline.preview').has_code_win() then
|
if require('outline.preview').has_code_win() then
|
||||||
M._highlight_current_item(M.state.code_win)
|
M._highlight_current_item(M.state.code_win)
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
@@ -461,7 +461,7 @@ function M.toggle_outline(opts)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Used for SymbolsOutline user command
|
-- Used for Outline user command
|
||||||
local function _cmd_toggle_outline(opts)
|
local function _cmd_toggle_outline(opts)
|
||||||
if opts.bang then
|
if opts.bang then
|
||||||
M.toggle_outline({ focus_outline = false })
|
M.toggle_outline({ focus_outline = false })
|
||||||
@@ -479,7 +479,7 @@ function M.open_outline(opts)
|
|||||||
if not M.view:is_open() then
|
if not M.view:is_open() then
|
||||||
local found = providers.request_symbols(handler, opts)
|
local found = providers.request_symbols(handler, opts)
|
||||||
if not found then
|
if not found then
|
||||||
vim.notify("[symbols-outline]: No providers found for current buffer", vim.log.levels.WARN)
|
vim.notify("[outline]: No providers found for current buffer", vim.log.levels.WARN)
|
||||||
-- else
|
-- else
|
||||||
-- print("Using provider ".._G._symbols_outline_current_provider.name.."...")
|
-- print("Using provider ".._G._symbols_outline_current_provider.name.."...")
|
||||||
end
|
end
|
||||||
@@ -512,7 +512,7 @@ end
|
|||||||
---Set cursor to focus on the code window, return whether this operation was successful.
|
---Set cursor to focus on the code window, return whether this operation was successful.
|
||||||
---@return boolean ok Whether it was successful. If unsuccessful, it might mean that the attached code window has been closed or is no longer valid.
|
---@return boolean ok Whether it was successful. If unsuccessful, it might mean that the attached code window has been closed or is no longer valid.
|
||||||
function M.focus_code()
|
function M.focus_code()
|
||||||
if require('symbols-outline.preview').has_code_win() then
|
if require('outline.preview').has_code_win() then
|
||||||
vim.fn.win_gotoid(M.state.code_win)
|
vim.fn.win_gotoid(M.state.code_win)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -522,7 +522,7 @@ end
|
|||||||
---Toggle focus between outline and code window, returns whether it was successful.
|
---Toggle focus between outline and code window, returns whether it was successful.
|
||||||
---@return boolean ok Whether it was successful. If `ok=false`, either the outline window is not open or the code window is no longer valid.
|
---@return boolean ok Whether it was successful. If `ok=false`, either the outline window is not open or the code window is no longer valid.
|
||||||
function M.focus_toggle()
|
function M.focus_toggle()
|
||||||
if M.view:is_open() and require('symbols-outline.preview').has_code_win() then
|
if M.view:is_open() and require('outline.preview').has_code_win() then
|
||||||
local winid = vim.fn.win_getid()
|
local winid = vim.fn.win_getid()
|
||||||
if winid == M.state.code_win then
|
if winid == M.state.code_win then
|
||||||
vim.fn.win_gotoid(M.view.winnr)
|
vim.fn.win_gotoid(M.view.winnr)
|
||||||
@@ -550,7 +550,7 @@ function M.show_status()
|
|||||||
else
|
else
|
||||||
print("Outline window is not open.")
|
print("Outline window is not open.")
|
||||||
end
|
end
|
||||||
if require('symbols-outline.preview').has_code_win() then
|
if require('outline.preview').has_code_win() then
|
||||||
print("Code window is active.")
|
print("Code window is active.")
|
||||||
else
|
else
|
||||||
print("Warning: code window is either closed or invalid. Please close and reopen the outline window.")
|
print("Warning: code window is either closed or invalid. Please close and reopen the outline window.")
|
||||||
@@ -572,7 +572,7 @@ end
|
|||||||
|
|
||||||
local function setup_commands()
|
local function setup_commands()
|
||||||
local cmd = function(n, c, o)
|
local cmd = function(n, c, o)
|
||||||
vim.api.nvim_create_user_command('SymbolsOutline'..n, c, o)
|
vim.api.nvim_create_user_command('Outline'..n, c, o)
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd('', _cmd_toggle_outline, {
|
cmd('', _cmd_toggle_outline, {
|
||||||
@@ -602,7 +602,7 @@ With bang, don't switch cursor focus to outline window.",
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---Set up configuration options for symbols-outline.
|
---Set up configuration options for outline.
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
cfg.setup(opts)
|
cfg.setup(opts)
|
||||||
ui.setup_highlights()
|
ui.setup_highlights()
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
local symbols = require 'symbols-outline.symbols'
|
local symbols = require 'outline.symbols'
|
||||||
local ui = require 'symbols-outline.ui'
|
local ui = require 'outline.ui'
|
||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
local t_utils = require 'symbols-outline.utils.table'
|
local t_utils = require 'outline.utils.table'
|
||||||
local lsp_utils = require 'symbols-outline.utils.lsp_utils'
|
local lsp_utils = require 'outline.utils.lsp_utils'
|
||||||
local folding = require 'symbols-outline.folding'
|
local folding = require 'outline.folding'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ function M.get_lines(flattened_outline_items)
|
|||||||
node_line,
|
node_line,
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
'SymbolsOutlineConnector',
|
'OutlineConnector',
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local so = require 'symbols-outline'
|
local so = require 'outline'
|
||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
local hover = require 'symbols-outline.hover'
|
local hover = require 'outline.hover'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ local function convert_symbols(result)
|
|||||||
local s = {}
|
local s = {}
|
||||||
local kinds_index = {}
|
local kinds_index = {}
|
||||||
-- create a inverse indexing of symbols.kind
|
-- create a inverse indexing of symbols.kind
|
||||||
local symbols = require("symbols-outline.symbols")
|
local symbols = require("outline.symbols")
|
||||||
for k, v in pairs(symbols.kinds) do
|
for k, v in pairs(symbols.kinds) do
|
||||||
kinds_index[v] = k
|
kinds_index[v] = k
|
||||||
end
|
end
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local providers = {
|
local providers = {
|
||||||
'symbols-outline/providers/nvim-lsp',
|
'outline/providers/nvim-lsp',
|
||||||
'symbols-outline/providers/coc',
|
'outline/providers/coc',
|
||||||
'symbols-outline/providers/markdown',
|
'outline/providers/markdown',
|
||||||
}
|
}
|
||||||
|
|
||||||
_G._symbols_outline_current_provider = nil
|
_G._symbols_outline_current_provider = nil
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local md_parser = require 'symbols-outline.markdown'
|
local md_parser = require 'outline.markdown'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local config = require 'symbols-outline.config'
|
local config = require 'outline.config'
|
||||||
local lsp_utils = require 'symbols-outline.utils.lsp_utils'
|
local lsp_utils = require 'outline.utils.lsp_utils'
|
||||||
local jsx = require 'symbols-outline.utils.jsx'
|
local jsx = require 'outline.utils.jsx'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local so = require 'symbols-outline'
|
local so = require 'outline'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local cfg = require 'symbols-outline.config'
|
local cfg = require 'outline.config'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ function M.icon_from_kind(kind)
|
|||||||
if cfg.o.symbols.icon_source == 'lspkind' then
|
if cfg.o.symbols.icon_source == 'lspkind' then
|
||||||
local has_lspkind, lspkind = pcall(require, 'lspkind')
|
local has_lspkind, lspkind = pcall(require, 'lspkind')
|
||||||
if not has_lspkind then
|
if not has_lspkind then
|
||||||
vim.notify("[symbols-outline]: icon_source set to lspkind but failed to require lspkind!", vim.log.levels.ERROR)
|
vim.notify("[outline]: icon_source set to lspkind but failed to require lspkind!", vim.log.levels.ERROR)
|
||||||
else
|
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
|
||||||
@@ -10,7 +10,7 @@ function M.add_hover_highlight(bufnr, line, col_start)
|
|||||||
vim.api.nvim_buf_add_highlight(
|
vim.api.nvim_buf_add_highlight(
|
||||||
bufnr,
|
bufnr,
|
||||||
M.hovered_hl_ns,
|
M.hovered_hl_ns,
|
||||||
'SymbolsOutlineCurrent',
|
'OutlineCurrent',
|
||||||
line,
|
line,
|
||||||
col_start,
|
col_start,
|
||||||
-1
|
-1
|
||||||
@@ -18,15 +18,15 @@ function M.add_hover_highlight(bufnr, line, col_start)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.setup_highlights()
|
function M.setup_highlights()
|
||||||
-- Setup the SymbolsOutlineCurrent highlight group if it hasn't been done already by
|
-- Setup the OutlineCurrent highlight group if it hasn't been done already by
|
||||||
-- a theme or manually set
|
-- a theme or manually set
|
||||||
if vim.fn.hlexists 'SymbolsOutlineCurrent' == 0 then
|
if vim.fn.hlexists 'OutlineCurrent' == 0 then
|
||||||
local cline_hl = vim.api.nvim_get_hl_by_name('CursorLine', true)
|
local cline_hl = vim.api.nvim_get_hl_by_name('CursorLine', true)
|
||||||
local string_hl = vim.api.nvim_get_hl_by_name('String', true)
|
local string_hl = vim.api.nvim_get_hl_by_name('String', true)
|
||||||
|
|
||||||
vim.api.nvim_set_hl(
|
vim.api.nvim_set_hl(
|
||||||
0,
|
0,
|
||||||
'SymbolsOutlineCurrent',
|
'OutlineCurrent',
|
||||||
{ bg = cline_hl.background, fg = string_hl.foreground }
|
{ bg = cline_hl.background, fg = string_hl.foreground }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -41,9 +41,9 @@ function M.setup_highlights()
|
|||||||
'gui'
|
'gui'
|
||||||
)
|
)
|
||||||
|
|
||||||
if vim.fn.hlexists 'SymbolsOutlineConnector' == 0 then
|
if vim.fn.hlexists 'OutlineConnector' == 0 then
|
||||||
vim.cmd(
|
vim.cmd(
|
||||||
string.format('hi SymbolsOutlineConnector guifg=%s', comment_fg_gui)
|
string.format('hi OutlineConnector guifg=%s', comment_fg_gui)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local config = require 'symbols-outline.config'
|
local config = require 'outline.config'
|
||||||
local tbl_utils = require 'symbols-outline.utils.table'
|
local tbl_utils = require 'outline.utils.table'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local cfg = require('symbols-outline.config')
|
local cfg = require('outline.config')
|
||||||
|
|
||||||
local View = {}
|
local View = {}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
local parser = require 'symbols-outline.parser'
|
local parser = require 'outline.parser'
|
||||||
local cfg = require('symbols-outline.config')
|
local cfg = require('outline.config')
|
||||||
local ui = require 'symbols-outline.ui'
|
local ui = require 'outline.ui'
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ local function is_buffer_outline(bufnr)
|
|||||||
return string.match(name, 'OUTLINE') ~= nil and ft == 'Outline'
|
return string.match(name, 'OUTLINE') ~= nil and ft == 'Outline'
|
||||||
end
|
end
|
||||||
|
|
||||||
local hlns = vim.api.nvim_create_namespace 'symbols-outline-icon-highlight'
|
local hlns = vim.api.nvim_create_namespace 'outline-icon-highlight'
|
||||||
|
|
||||||
function M.write_outline(bufnr, lines)
|
function M.write_outline(bufnr, lines)
|
||||||
if not is_buffer_outline(bufnr) then
|
if not is_buffer_outline(bufnr) then
|
||||||
@@ -46,7 +46,7 @@ function M.add_highlights(bufnr, hl_info, nodes)
|
|||||||
M.add_hover_highlights(bufnr, nodes)
|
M.add_hover_highlights(bufnr, nodes)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ns = vim.api.nvim_create_namespace 'symbols-outline-virt-text'
|
local ns = vim.api.nvim_create_namespace 'outline-virt-text'
|
||||||
|
|
||||||
function M.write_details(bufnr, lines)
|
function M.write_details(bufnr, lines)
|
||||||
if not is_buffer_outline(bufnr) then
|
if not is_buffer_outline(bufnr) then
|
||||||
@@ -58,7 +58,7 @@ function M.write_details(bufnr, lines)
|
|||||||
|
|
||||||
for index, value in ipairs(lines) do
|
for index, value in ipairs(lines) do
|
||||||
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
||||||
virt_text = { { value, 'SymbolsOutlineDetails' } },
|
virt_text = { { value, 'OutlineDetails' } },
|
||||||
virt_text_pos = 'eol',
|
virt_text_pos = 'eol',
|
||||||
hl_mode = 'combine',
|
hl_mode = 'combine',
|
||||||
})
|
})
|
||||||
@@ -77,7 +77,7 @@ function M.write_lineno(bufnr, lines, max)
|
|||||||
for index, value in ipairs(lines) do
|
for index, value in ipairs(lines) do
|
||||||
local leftpad = string.rep(' ', maxwidth-#value)
|
local leftpad = string.rep(' ', maxwidth-#value)
|
||||||
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
||||||
virt_text = { {leftpad..value, 'SymbolsOutlineLineno' } },
|
virt_text = { {leftpad..value, 'OutlineLineno' } },
|
||||||
virt_text_pos = 'overlay',
|
virt_text_pos = 'overlay',
|
||||||
virt_text_win_col = 0,
|
virt_text_win_col = 0,
|
||||||
hl_mode = 'combine',
|
hl_mode = 'combine',
|
||||||
Reference in New Issue
Block a user