-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(plugin): support fork of symbols-outline The symbols-outline.nvim plugin was archived, and there is a popular fork that added some nice new features. The fork's filetype is still "Outline", but the user commands have changed. ref: https://github.com/hedyhli/outline.nvim * feat(plugin): separate support for outline.nvim and symbols-outline.nvim --------- Co-authored-by: Ben Elan <[email protected]>
- Loading branch information
1 parent
03a1e1c
commit 36a4957
Showing
5 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ local plugins = { | |
'nvim_tree', | ||
'neo_tree', | ||
'symbols_outline', | ||
'outline', | ||
'tabby', | ||
'neotest', | ||
'dapui', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local plugins = require('possession.plugins') | ||
local utils = require('possession.utils') | ||
|
||
local function buf_is_plugin(buf) | ||
return vim.api.nvim_buf_get_option(buf, 'filetype') == 'Outline' | ||
end | ||
|
||
local find_tab_buf = function(tab) | ||
return utils.find_tab_buf(tab, buf_is_plugin) | ||
end | ||
|
||
-- NOTE: currently symbols-outline does not really work on per-tab basis so this does not make sense but in | ||
-- theory symbols-outline could easily work like other file-trees so stick with this implementation for now | ||
return plugins.implement_file_tree_plugin_hooks('symbols-outline', { | ||
has_plugin = 'outline', | ||
buf_is_plugin = buf_is_plugin, | ||
open_in_tab = function(tab) | ||
vim.cmd('OutlineOpen') | ||
-- Need to wait for some async stuff | ||
vim.wait(100, function() | ||
return find_tab_buf(tab) ~= nil | ||
end) | ||
end, | ||
}) |